Andrea Bollini commented on Bug DS-1620
suggested solution by Raul Ruiz:
from: https://jira.duraspace.org/browse/DS-1571?focusedCommentId=28349&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-28349


The solution is to add zeros before currentTop date and bottom date.

Class DiscoverUtility.java look for set facet method and add:
 else
                                {
                                    // We need to do -1 on this one to
                                    // get a
                                    // better result
                                    currentTop--;
                                }
/*Patch*/
String bottomYearStr = String.valueOf(bottomYear);
String currentTopStr = String.valueOf(currentTop);
while( bottomYearStr.length() < 4){
bottomYearStr = "0" + bottomYearStr;
}
while( currentTopStr.length() < 4){
currentTopStr = "0" + currentTopStr;
}
                                                               /*End patch*/
                                                             facetQueries.add(dateFacet + ":[" + bottomYearStr
                                                             + " TO " + currentTopStr + "]");


Class SolrServiceImpl.java look for retrieveResult method and add:


                    String name = facetQuery.substring(facetQuery.indexOf('[') + 1);

                    name = name.substring(0, name.lastIndexOf(']')).replaceAll("TO", "-");
/* ADD*/
int bottomYear = Integer.parseInt(name.substring(0,4));
int currentTop = Integer.parseInt(name.substring(7,11));
name = bottomYear + name.substring(4,6)+ currentTop;
/*End CHANGES*/

                    String filter = facetQuery.substring(facetQuery.indexOf('['));
                    filter = filter.substring(0, filter.lastIndexOf(']') + 1);


Now discovery display is correct but when you search with a date issued filter over discovery you must put a date with zeros if is less than 1000 to show results. P.e. 2 = 0002 , 99 = 0099 , 700 = 0700 ¿How can I solve this bug?

Thanks all
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to