You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by spinergywmy <sp...@gmail.com> on 2007/01/15 04:11:06 UTC

Perform indexing and searching concurrently

Hi,

   I'm wondering what will happened if I performance indexing and have 10
peoples do searching at the same time? Can I retrieve the results while I do
index, and the other way around?

   Thanks.


regards,
Wooi Meng
-- 
View this message in context: http://www.nabble.com/Perform-indexing-and-searching-concurrently-tf3012374.html#a8365907
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Perform indexing and searching concurrently

Posted by spinergywmy <sp...@gmail.com>.
Hi,

   What I have done is I declare a reader = IndexReader.open(dir); then
mSearcher = new IndexSearcher(reader); after the above I close the searcher
but I didn't close the reader. And I'm wondering is it ok if I did not close
the reader, and what will happened if I did not close it?

   Thanks


regards,
Wooi Meng 
-- 
View this message in context: http://www.nabble.com/Perform-indexing-and-searching-concurrently-tf3012374.html#a8372827
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Perform indexing and searching concurrently

Posted by Chris Hostetter <ho...@fucit.org>.
:    I'm wondering what will happened if I performance indexing and have 10
: peoples do searching at the same time? Can I retrieve the results while I do
: index, and the other way around?

>From the FAQ....

http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-6c56b0449d114826586940dcc6fe51582676a36e

Does Lucene allow searching and indexing simultaneously?

Yes. However, an IndexReader only searches the index as of the "point in
time" that it was opened. Any updates to the index, either added or
deleted documents, will not be visible until the IndexReader is re-opened.
So your application must periodically re-open its IndexReaders to see the
latest updates. The [WWW] IndexReader.isCurrent() method allows you to
test whether any updates have occurred to the index since your IndexReader
was opened.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org