[ https://issues.apache.org/jira/browse/LUCENE-10120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17436737#comment-17436737 ]
Lu Xugang edited comment on LUCENE-10120 at 11/1/21, 10:31 AM: --------------------------------------------------------------- Hi, [~jpountz] , In the case of large numbers of document matched, During the collection process, if the doc id is sequential and ordered from small to large. We only need to record the smallest and largest doc id, and use the method *DocIdSetIterator#range(int minDoc, int maxDoc)* currently provided in the source code to get a *DocIdSetIterator*. During the collection process, if the doc id is not sequential or ordered found , then using old way to create a new big size *FixedBitSet*, and initialize it with a range(*FixedBitSet#**set(int startIndex, int endIndex)**)* by smallest and largest doc id currently collected . was (Author: chrislu): Hi, [~jpountz] , In the case of large numbers of document matched, During the collection process, if the doc id is sequential and ordered from small to large. We only need to record the smallest and largest doc id, and use the method *DocIdSetIterator#range(int minDoc, int maxDoc)* currently provided in the source code to get a DocIdSetIterator. During the collection process, if the doc id is not sequential or ordered found , then using old way to create a new big size FixedBitSet, and initialize it with a range(*FixedBitSet#**set(int startIndex, int endIndex)**)* by smallest and largest doc id currently collected . > Lazy initialize FixedBitSet in LRUQueryCache > -------------------------------------------- > > Key: LUCENE-10120 > URL: https://issues.apache.org/jira/browse/LUCENE-10120 > Project: Lucene - Core > Issue Type: Improvement > Components: core/search > Affects Versions: main (9.0) > Reporter: Lu Xugang > Priority: Major > Attachments: 1.png > > > Basing on the implement of collecting docIds in DocsWithFieldSet, may be we > could do similar way to cache docIdSet in > *LRUQueryCache#cacheIntoBitSet(BulkScorer scorer, int maxDoc)* when docIdSet > is density. > In this way , we do not always init a huge FixedBitSet which sometime is not > necessary when maxDoc is large > > > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org