Let me back up.. for a second. I want to create price ranges. I was thinking that I would do a search with a sort on price and create ranges by getting the document price every (docCount / #ofpricerangesIwant). Basically create: < 10, 10 - 60, 60 - 100 etc.. If the initial search wasn't sorted by price then I would have to do the second search just to figure out the price ranges.
This was the only way I could think to do it. Maybe I'm going at this the wrong way? Thanks On 10/11/06, Chris Hostetter <[EMAIL PROTECTED]> wrote:
: I need to sort a query two ways. Should I do the search one way: : s.getDocListAndSet(query, restrictions, sort, req.getStart(), : req.getLimit(), flags); : then do the same search again with a different sort value or is there a : method available to just sort the DocSet (like sortDocSet but it's : protected) : : OR maybe it doesn't matter because caching will handle it anyway? check this out from the example solrconfig.xml... <!-- An optimization that attempts to use a filter to satisfy a search. If the requested sort does not include score, then the filterCache will be checked for a filter matching the query. If found, the filter will be used as the source of document ids, and then the sort will be applied to that. --> <useFilterForSortedQuery>true</useFilterForSortedQuery> ...in those conditions, you should be able to just call getDocList (or getDocListAndSet) with your various Sort options and the cache will take care of everything. if you *do* want scores to be included in one of the Sorts, then i would try doing that search first using getDocListAndSet -- you can ignore the DocSet, but the next call to getDocList should leverage the filterCache, and the initial getDocListANdSet call hsould be faster then two seperate getDocList calls with different sorts... ...i think. -Hoss