lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sheng <sheng...@gmail.com>
Subject Re: IndexSearcher creation policy question
Date Fri, 22 Aug 2014 23:10:18 GMT
Your best bet is to use a searcher manager to manage the searcher instance,
and only refresh the manager if writes are committed. This way the same
searcher instances can be shared by multiple threads.

For the paging, if you want to have a guaranteed consistent view, you have
to keep around the searcher instance provided by the manager, and only
release it once all the search/paging is done. But do remember to release
it afterwards, otherwise you will quickly accumulate lots of unclosed old
searcher instances.

On Friday, August 22, 2014, Rolf Veen <rolf.veen@gmail.com> wrote:

> I've this scenario in a web application:
>
> 1. many users query a Lucene index concurrently (obvious)
> 2. one user can make several queries (she may have different browser
> windows open)
> 3. all those queries need to have a consistent paging behavior (next,
> previous buttons)
> 4. The index can be updated at any time by users.
>
> What I understand is that:
>
> - I need a fresh IndexSearcher for each initial query (DirectoryReader.open
> -> reader -> searcher) and cannot use Search(Lifetime)Manager's.
> - I cannot share IndexSearchers in the depicted scenario; even for the
> same user, a different IndexSearcher is needed for each window.
>
> Is my understanding true ? What would be the best approach to handle this
> scenario ?
>
> Kind regards,
> Rolf.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> <javascript:;>
> For additional commands, e-mail: java-user-help@lucene.apache.org
> <javascript:;>
>
>

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