You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by cyang2010 <ys...@hotmail.com> on 2011/04/27 00:15:56 UTC

Reader per query request

Hi,

I was wondering if solr open a new lucene IndexReader for every query
request?  

>From performance point of view, is there any problem of opening a lot of
IndexReaders concurrently, or application shall have some logic to reuse the
same IndexReader?


Thanks,


cy




--
View this message in context: http://lucene.472066.n3.nabble.com/Reader-per-query-request-tp2867778p2867778.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Reader per query request

Posted by cyang2010 <ys...@hotmail.com>.
Thanks a lot.  That makes sense.  -- CY

--
View this message in context: http://lucene.472066.n3.nabble.com/Reader-per-query-request-tp2867778p2867995.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Reader per query request

Posted by Erick Erickson <er...@gmail.com>.
See below

On Tue, Apr 26, 2011 at 6:15 PM, cyang2010 <ys...@hotmail.com> wrote:
> Hi,
>
> I was wondering if solr open a new lucene IndexReader for every query
> request?
>
no, absolutely not. Solr only opens a reader when the underlying index
has changed, say a commit or a replication happens.

> From performance point of view, is there any problem of opening a lot of
> IndexReaders concurrently, or application shall have some logic to reuse the
> same IndexReader?

Every time you open a reader, a whole new set of caches are initiated.
I have a hard
time imagining a situation in which opening a new searcher for each
request would
be a good idea. Opening a new reader, especially for a large index is
a very expensive
operation and should be done as rarely as possible. But Solr will do
this automatically
for you, by and large you don't have to think about it.

Best
Erick

>
>
> Thanks,
>
>
> cy
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Reader-per-query-request-tp2867778p2867778.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>