Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
New
Description
Robert made a good point on LUCENE-5312 that the API currently feels half baked since it exposes Sorter as a central point of the API while all the useful impls are based on a comparator.
Initially, I wanted a Sorter to be the central class because it would allow to compute a DocMap eg. to revert the order of the documents in the index without having to actually sort the documents. If you look at Sorter.REVERSE_DOCS, it returns the DocMap that reverts index order in constant time.
However, this Sorter-based API doesn't allow for composability although a comparator-based API could. For example, we would like to be able to compose a sorter for block joins based on a sorter for parents and another for children.
So maybe the use-cases that are not based on an actual sort are not really important and we could enforce sorting so that sorters could be composable?
Attachments
Issue Links
- is superceded by
-
LUCENE-5493 Rename Sorter, NumericDocValuesSorter, and fix javadocs
- Closed