Separate to this discussion:
We should fix the JavaDocs of IndexSearcher, that it should explain, that only 
the instances using Directory are costly. Creating a new IndexSearcher around 
an IndexReader is a neglectible cost, the important info is: "Do not recreate 
the IR for each search". Wrapping an IndexSearcher around an IndexReader is 
simply creating a new Java instance, nothing more.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: jchang [mailto:jchangkihat...@gmail.com]
> Sent: Wednesday, January 20, 2010 2:05 AM
> To: java-dev@lucene.apache.org
> Subject: NRT and IndexSearcher performance
> 
> 
> The javadocs for IndexSearcher in Lucene 3.0.0 read:  "For performance
> reasons it is recommended to open only one IndexSearcher and use it for
> all
> of your searches."
> 
> However, to use NRT, it seems I have to do this for every search, which
> contradicts the advice above:
>     IndexSearcher myIndexSearcher = new
> IndexSearcher(myIndexWriter.getReader());
> 
> Is there any way to take advantage of NRT and not run into these
> performance
> problems under heavy load?
> 
> Is the advice from the javadoc above aimed more at
> IndexSearcher(org.apache.lucene.store.Directory directory)?  Or is it
> also
> aimed at  IndexSearcher(org.apache.lucene.index.IndexReader
> indexReader),
> which I believe I have to use to get NRT (correct me if I am wrong)?
> --
> View this message in context: http://old.nabble.com/NRT-and-
> IndexSearcher-performance-tp27235434p27235434.html
> Sent from the Lucene - Java Developer mailing list archive at
> Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-dev-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to