Got it.

In more general terms then, are there any techniques to speed up searches
in general? Right now i am using a IndexSearcher's Hits() method to do a
search in a free form text query. I am mostly interested in reducing the
cost of the initial queries as .5 seconds is just too slow (some queries
took up to 3 seconds the first time. Admittedly I am not using a very fast
machine for these tests).

Thanks in advance.


Em qui, 9 de abr de 2015 às 11:33, Peter Karman <[email protected]> escreveu:

> On 4/9/15 9:13 AM, Bruno Albuquerque wrote:
> > I have this index with around 4.5 million documents. When i do some
> queries
> > on it, it takes a couple of hundred ms to complete... but only the first
> > time I do them. If I repeat the same search another time, it answers the
> > queries an order of magnitude faster. More interestingly, it continues
> > being faster even after I restart my client code, which leads me to
> believe
> > that some optimization happens when I do a query and is persisted into
> the
> > index.
> >
> > What is the mechanism that is making that happen? Is that just a cache
> > being written to the index itself or is it something fancier? if it is
> > something fancier, is there a way to "warm up" the index in a way that
> most
> > queries would be faster from the get go (even at the cost of space)?
> >
> > Thanks in advance.
> >
>
> You're experiencing the Lucy "the OS is our JVM"[0] philosophy of mmap[1].
>
> I don't think there's a way to pre-warm it, other than creating and
> exercising a Searcher.
>
> [0]
> http://lucene.472066.n3.nabble.com/Lucy-Wiki-Update-
> of-quot-LucyIncubatorProposal-quot-by-MarvinHumphrey-td934939.html
> [1] http://en.wikipedia.org/wiki/Mmap
>
>
> --
> Peter Karman  .  www.peknet.com  .  @peterkarman
>

Reply via email to