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 Matthias Bräuer <ne...@matrix-web.de> on 2005/09/20 21:24:02 UTC
Re: "Best-practice" in a web application AND live update of index
used by Tomcat
Hello,
I have a question regarding your answers to two previous posts:
>For best performance, use a single IndexSearcher instance across your
entire application.
>DelayCloseIndexSearcher overrides the close() method so it does not
>close immediately: it only decrements the usage counter. [...]
I have implemented a Client-Server application where a desktop program
on a file server regularly updates an index while a web application
running on Tomcat on the same server answers queries against this index.
Currently the index is not built incrementally.
Now, the problem is that if I have an open IndexReader (or Searcher or
Luke Toolbox, respectively), it is impossible to update the index
because I get IOExceptions ala "Cannot delete _7.cfs". This even happens
if the conflicting IndexReader isn't doing anything but just sitting
still inside a Searcher to wait for the next query. So, does that mean I
have to close the searcher after each request to let the indexer do its
work? Or is there a way to tell Lucene that the IndexReader is only
reading and not writing anything.
Thanks for your help,
Matthias
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: "Best-practice" in a web application AND live update of index
used by Tomcat
Posted by Ramanathan Krishnan <kr...@ibsglobalweb.com>.
Hi,
I am a newbie to lucene but I guess the IOException will occur only in
windows as window os doesn't close the files properly. It shud work
fine in Linux.
I had a similar problem when recreating the same index. The approach I
took was to delete all documents and start adding new ones, instead of
overwriting the index.
Krishnan
Matthias Bräuer wrote:
> Hello,
>
> I have a question regarding your answers to two previous posts:
>
>
> >For best performance, use a single IndexSearcher instance across
> your entire application.
>
> >DelayCloseIndexSearcher overrides the close() method so it does not
> >close immediately: it only decrements the usage counter. [...]
>
>
> I have implemented a Client-Server application where a desktop program
> on a file server regularly updates an index while a web application
> running on Tomcat on the same server answers queries against this
> index. Currently the index is not built incrementally.
>
> Now, the problem is that if I have an open IndexReader (or Searcher or
> Luke Toolbox, respectively), it is impossible to update the index
> because I get IOExceptions ala "Cannot delete _7.cfs". This even
> happens if the conflicting IndexReader isn't doing anything but just
> sitting still inside a Searcher to wait for the next query. So, does
> that mean I have to close the searcher after each request to let the
> indexer do its work? Or is there a way to tell Lucene that the
> IndexReader is only reading and not writing anything.
>
> Thanks for your help,
> Matthias
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org