lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <jpou...@gmail.com>
Subject Re: Mapping doc values back to doc ID (in decent time)
Date Fri, 07 Aug 2015 07:34:44 GMT
On Fri, Aug 7, 2015 at 8:30 AM, Trejkaz <trejkaz@trypticon.org> wrote:
>     for (int ourId = 0; ourId < count; ourId++)
>     {
>         builder.clear();
>         NumericUtils.longToPrefixCoded(ourId, 0, builder);
>         termsEnum.seekExact(builder.get());
>         postingsEnum = termsEnum.postings(null, postingsEnum);
>         int docId = postingsEnum.nextDoc(); // only ever one value
>     }

Does your application actually iterate in order over dense ids, or is
it just for benchmarking purposes? Because if it does, you probably
don't actually need seeking, you could just see what the current ID in
the terms enum is. If you actually need seeking, then you should try
to avoid MultiFields, it will call seedExact on each segment, while
given what I see you could just stop after you found one segment with
the value.

-- 
Adrien

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message