lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mindaugas Žakšauskas (JIRA) <j...@apache.org>
Subject [jira] Commented: (LUCENE-1203) [PATCH] Allow setting IndexReader to IndexSearcher
Date Thu, 06 Mar 2008 16:24:57 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-1203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575757#action_12575757
] 

Mindaugas Žakšauskas commented on LUCENE-1203:
----------------------------------------------

In this case FAQ and IndexSearcher Javadoc needs updating as they're clearly misleading on
this case.

What would be your recommendation for minimizing the number of file descriptors used? We experience
this problem and it's a real show stopper for us (see my post to the users mailing list).

Also, could you elaborate why is it harmful to add the setter? I was taught to avoid object
creation if I can to save performance on garbage collection (regardless if the object is lightweight
or not). Say, if I add 1000 new objects to the index, I potentially need to create 1000 object
instances. Can't think of any reason of why can it be good.

Thanks!


> [PATCH] Allow setting IndexReader to IndexSearcher
> --------------------------------------------------
>
>                 Key: LUCENE-1203
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1203
>             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 http://mail-archives.apache.org/mod_mbox/lucene-java-user/200803.mbox/%3Ca4d7dcf50803050918h68defe83v66e657debb76d3f3@mail.gmail.com%3E),
I would like to propose adding a setter to set new instance of IndexReader to IndexSearcher.

> Why is this needed?
> The FAQ (http://wiki.apache.org/lucene-java/LuceneFAQ#head-48921635adf2c968f7936dc07d51dfb40d638b82)
says:
> 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 (http://lucene.apache.org/java/2_3_1/api/core/org/apache/lucene/search/IndexSearcher.html).
> 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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message