lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ganesh - yahoo" <emailg...@yahoo.co.in>
Subject when to refresh IndexSearcher and IndexWriter
Date Thu, 28 Aug 2008 10:35:50 GMT
Hello all,

My index will get update very frequently.

1) When shall i need to optimize IndexWriter? I have planned to optimize 
every day. Is that fine.

2) When shall i need to re-open IndexReader and IndexSearcher? I have 
planned to do it every 10 minutes.

3) IndexSearcher could be used across threads. If i have to re-open the 
IndexReader and IndexSearcher, then it should be synchronized. If i try to 
do this then i am ending up in doing complete search functionality in 
synchronization. Is there any better way to do that.

synchronized void search() {

if 10 mins is elapsed reopen the reader else use the original..

IndexSearcher.search().....

collect the hits
}
Is there any better way to do it.

Regards
Ganesh
 

Send instant messages to your online friends http://in.messenger.yahoo.com 

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


Mime
View raw message