Re: Using IndexReader in the web environment

2010-05-05 Thread Ian Lea
You could tell the searching part of your app, via some notification or messaging call. Or call IndexReader.isCurrent() from time to time, or even on every search, and reopen() if necessary. See the javadocs and don't forget to close the old reader when you do call reopen. -- Ian. On Wed,

Re: Using IndexReader in the web environment

2010-05-05 Thread Ivan Liu
You may look this: private static IndexSearcher indexSearcher = null; public synchronized IndexSearcher newIndexSearcher() { try { if (null == indexSearcher) { Directory directory = FSDirectory.open(new File(Config.DB_DIR+/rssindex)); indexSearcher = new

Re: Using IndexReader in the web environment

2010-05-04 Thread Vijay Veeraraghavan
Hi, Thanks for the reply. So I will have a dedicated servlet to search the index, but does it mean that the indexsearcher does not close the index, keep it open? Is it not possible to keep it in the application scope? Vijay On 5/3/10, Vijay Veeraraghavan vijay.raghava...@gmail.com wrote: Hi

Re: Using IndexReader in the web environment

2010-05-04 Thread Vijay Veeraraghavan
hey Ian, thanks for the reply. I find it very useful. My report generating scheduler will run periodically, once done it will invoke the indexer and exit. In this case I do not know if the index has changed or not. How do i keep track of the changes in the index? As the two entities,