This really looks like re-inventing Streaming Aggregation/Streaming Expressions. Admittedly, the processing will probably be faster if done internally, but if response time isn't super-critical you might want consider. If the Streaming stuff (including ParallelSQL) works you will need to upgrade, 6.4.2 is the latest release.
But to answer your question, "no". Sorting is a post-match operation. I.e. once the doc is selected for _possible_ inclusion in the result set, it's matched against the current top N then put in the list or discarded so your collectors don't see docs in sorted order. Best, Erick On Sun, Mar 12, 2017 at 5:54 AM, alexpusch <a...@getjaco.com> wrote: > I hope this is the right place to ask about custom search components. > > I'm writing a custom search component. My aim is iterate over the entire > result set and do some aggregate computation. In order to implement my > algorithm I require to iterate over the result set in the order declared in > the search query. > > I've taken statsComponent as a relevant example. It iterates over the > results using rb.getResults().docSet and searcher.getIndexReader().leaves() > but it seems that these methods does not respect the query sort order. > > I've tried creating a new TopCollector and requesting it to collect all the > data. It works but takes too long. > > Is there a way to iterate over the sorted result set in an efficient way? > I'm working on solr 4.11, but upgrading to a newer version is acceptable if > necessary. > > Thanks! > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Iterating-sorted-result-docs-in-a-custom-search-component-tp4324497.html > Sent from the Solr - User mailing list archive at Nabble.com.