Document Collector implementation
alldroll opened this issue · 0 comments
alldroll commented
The current implementation of merge documents is not performance efficient:
- We collect all documents (even when do not have to do it)
- We are performing scoring on each document
- We return all matching documents (memory inefficient at all)
As solutions, we can use Lucene approach:
- https://github.com/apache/lucene-solr/blob/1d85cd783863f75cea133fb9c452302214165a4d/lucene/core/src/java/org/apache/lucene/search/LeafCollector.java
- https://github.com/apache/lucene-solr/blob/1d85cd783863f75cea133fb9c452302214165a4d/lucene/core/src/java/org/apache/lucene/search/CollectionTerminatedException.java