Hello Lucene community, while looking into how to efficiently sort on a field 
value, I came across a couple of things that I don't quite understand. My 
assumption was that if I execute a search and sort on a SortedDocValues field, 
lucene would only iterate over the docs in the order of the field values or at 
least collect only competitive docs (docs that made it into the topN queue). 
Neither of those things seems to be happening. Instead, the iteration is 
happening in index order and all matched docs are collected. Looking at the 
code, I see that the optimizations are only possible if the index is sorted in 
the field order to begin with, which is not possible for our use case. We may 
have dozens of such fields in our index, thus there isn't any one field that 
can be used to sort the index. So I guess my question if what I am trying to 
achieve is possible? I tried to look though Solr codebase, but so far couldn't 
come up with anything. Code example is here https://pastebin.com/i05E2wZy  . I 
am using 9.4.1. Thanks in advance.

Andrei

This e-mail is for the sole use of the intended recipient and contains 
information that may be privileged and/or confidential. If you are not an 
intended recipient, please notify the sender by return e-mail and delete this 
e-mail and any attachments. Certain required legal entity disclosures can be 
accessed on our website: 
https://www.thomsonreuters.com/en/resources/disclosures.html

Reply via email to