lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
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 10:50:05 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.

Mike McCandless

http://blog.mikemccandless.com

On Thu, Apr 20, 2017 at 11:09 PM, 马可阳 <makeyang@jd.com> wrote:

> Let’s say I have a user info index and user id is the ‘primary key’. So
> when I do a userid term search, will lucene traverse all segments to search
> a 'primary key'term or will it stop as soon as it get one?
>
> If it is the latter one, will any plan to make it the former way?
>
>
> 马可阳
>
> 京东 【基础平台|中间件|JSF】
> =====================================
> 服务构建 jsf.jd.com
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message