lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: will lucene traverse all segments to search a 'primary key'term or will it stop as soon as it get one?
Date Fri, 21 Apr 2017 18:55:30 GMT
: Lucene by default will search all segments, because it does not know that
: your field is a primary key.
: Trejkaz's suggestion to early-terminate should work well.  You could also
: write custom code that uses TermsEnum on each segment.

Before you go too far down the rabit hole of writting any custom code, 
make sure to do some experiements and actaully measure the performance of 
a uniqueKey lookup using a simple needScores=false search ... the way 
TermQuery works across each segments is very low cost for the segments 
where the Term doesn't exist in any docs at all.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message