If you are using the 2.9.1 you can use the IndexWriter.GetReader() method
which does everything for you: this way you need to keep only the
indexwriter around.

I use this approach with the application I'm using
Simone

On Mon, Jan 18, 2010 at 12:32 AM, Grant Ingersoll <[email protected]>wrote:

>
> On Jan 13, 2010, at 5:08 PM, Artem Chereisky wrote:
>
> > Hi,
> >
> > according to the documentation, IndexSearcher is thread and process safe
> so
> > it's ok to use the same searcher in a multi-threaded application (in my
> case
> > it's a windows service executing multiple requests at the same time).
> But,
> > what are the pros and cons for re-using the searcher? What do you guys
> > usually do in your apps and why?
>
> It should be reused.  Well, the underlying IndexReader is the thing that
> matters for reuse.  Creating a searcher is pretty lightweight given a
> IndexReader.  Opening an IndexReader can be fairly expensive.
>
> -Grant




-- 
Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

Reply via email to