Encountered a problem today with bobo grouped in ascending price actually two standing in the front than the 1000. Obviously it is a string sort.
Then I went online to find a moment in this regard the article, the basic not be found. No option but to look at their source. Silly very naive BrowseRequest found in setFacetSpecO (String name, FacetSpec facetSpec) method. FacetSpec class have setOrderBy (FacetSortSpec order) method.
When the order = FacetSortSpec.OrderByCustom can be customized to sort by.
Call setCustomComparatorFactory (ComparatorFactory comparatorFactory); when I wrote a method to achieve after ComparatorFactory interface. Indeed achieved a sort, but only achieved a sort of grouping fields. Carefully looked at the code, the original starting point of my wrong. This class has always been a class action group. I would like to sort the results with the present is not here. Then I went to read under the lucene source. Found FieldSortedHitQueue this class, this class is the class to sort the results. Similarly, in the bobo, I also hit the LuceneSortDocComparatorFactory, but there had to say something a little problem. In the bobo in it if you do not set the default sorting rules, so it will not enter LuceneSortDocComparatorFactory category. It is the default sort in SimpleFacetHandler under getScoreDocComparator (). The getScoreDocComparator return is FacetDataCache the getScoreDocComparator (), how to do it. The simplest is to write their own class inheritance SimpleFacetHandler. The getScoreDocComparator return to the null, said that with the use of lucene sort. Well basically the problem here has been resolved.
If you have any questions and what advice can give me a message.