lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mindaugas Žakšauskas (JIRA) <>
Subject [jira] Commented: (LUCENE-1203) [PATCH] Allow setting IndexReader to IndexSearcher
Date Mon, 14 Jul 2008 15:00:32 GMT


Mindaugas Žakšauskas commented on LUCENE-1203:

Correct me if I'm wrong, but I thought the ??reopen()?? returns new instance of the refreshed
reader (in a case if the index was modified), but the current instance remains unchanged.
If this is true, how would I set the refreshed instance of ??IndexReader?? to existing ??IndexSearcher???

Would be nice if you could confirm this is actually the case (and possibly add a small bit
of clarification to the IndexReader Javadoc if my assumptions were wrong).

Thanks a lot!

> [PATCH] Allow setting IndexReader to IndexSearcher
> --------------------------------------------------
>                 Key: LUCENE-1203
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 2.3.1
>         Environment: Linux/2.6
>            Reporter: Mindaugas Žakšauskas
>         Attachments: IndexReaderSetter4IndexSearcher.patch
> As I've received no counter-arguments for my Lucene Java-User mailing list (see,
I would like to propose adding a setter to set new instance of IndexReader to IndexSearcher.

> Why is this needed?
> The FAQ (
> bq. ??"Make sure you only open one IndexSearcher, and share it among all of the threads
that are doing searches -- this is safe, and it will minimize the number of files that are
open concurently."??
> So does the JavaDoc (
> In my application, I don't want to expose anything about IndexReader; all they need to
know is Searcher - see my post to the mailing list how would I do this. However, if the index
is updated, reopened reader cannot be set back to IndexSearcher, a new instance of IndexSearcher
needs to be created (*which contradicts FAQ and Javadoc*).
> At the moment, the only way to go around this is to create a surrogate subclass of IndexSearcher
and set new instance of IndexReader. A simple setter would just do the job.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message