lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hao yan <hyan2...@gmail.com>
Subject Re: Under what circumtances, termsEnum's next(), or seekExact(), o seekCeli() is more efficient?
Date Fri, 07 Mar 2014 19:07:30 GMT
Hey, Michael

thanks!

it is close to what I think.

hao


On Fri, Mar 7, 2014 at 9:55 AM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> On Wed, Mar 5, 2014 at 4:34 PM, hao yan <hyan2008@gmail.com> wrote:
> > Hi, Michael
> >
> > 1.We find actually both are costly. I am not sure what is the difference
> btw
> > "
> > first next only once + seekExact from then on" and "always seekExact".  I
> > mean, the first call of "next" and the first call of seekExact, they are
> > different? If what next() does is to load a block of data and position to
> > the beginning of th block and seekExact() is to load a block and
> position to
> > the target, then next() should be more efficient, right?
>
> The first next() call is not that different from seekExact: it must
> load the block containing the first term and read bytes from it.
>
> After that, next() should be cheaper than seekExact.
>
> > 2. Is multiFields/multiTerms/multiTermsEnum efficient ? We have a fixed
> > number ( three) segments always. We want to search on the three segments
> for
> > each query. Therefore we borrowed most of the code of multixxx.  Is there
> > anyway to optimize this?
>
> They are relatively efficient?  I mean, they must merge-sort the
> terms, and manage N segments that might have a term under the hood,
> but it's the best we can do (unless you can forceMerge).
>
> But it's better to operate per-segment if you care about performance.
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Mime
View raw message