You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Kurt Mackey <ku...@mubble.net> on 2006/11/06 00:56:26 UTC
A little confused about how to use IndexSearcher in a web environment
So I have an ASP.NET app which makes use of Lucene.net for a number
of things, and I'm not quite sure what the "correct" way to use the
IndexSearcher is. At first, I was treating it like I would database
connections (ie: opening and closing a new one each time I needed to
do something), but given that there's no Lucene.net threadpool that
doesn't seem like the best way to do it.
Should I have a single IndexSearcher that's setup in my Global.asax
file, and then use that on any page that needs to search the index
instead? I'd need to close and reopen it when the index is updated,
wouldn't I?
Any kind of guidance would be good, I'm not finding much written
about this sort of thing. :)
Thanks,
Kurt
RE: A little confused about how to use IndexSearcher in a web environment
Posted by George Aroush <ge...@aroush.net>.
Hi Kurt,
Yes, you got it right. Opening/closing of the index per search is an
expansive thing to do. I am not as experience with ASP.NET as others maybe
here, but if by placing the IndexSearcher in Global.asax will give you a
single, open instance of IndexSearcher, then yes this will work. To handle
index updating, can you have another application which sends a http request
to your ASP.NET application signaling it to close and re-open the
IndexSearcher? If not, then you will need a way to re-init the
IndexSearcher when the index changes.
Regards,
-- George Aroush
-----Original Message-----
From: Kurt Mackey [mailto:kurt@mubble.net]
Sent: Sunday, November 05, 2006 6:56 PM
To: lucene-net-user@incubator.apache.org
Subject: A little confused about how to use IndexSearcher in a web
environment
So I have an ASP.NET app which makes use of Lucene.net for a number of
things, and I'm not quite sure what the "correct" way to use the
IndexSearcher is. At first, I was treating it like I would database
connections (ie: opening and closing a new one each time I needed to do
something), but given that there's no Lucene.net threadpool that doesn't
seem like the best way to do it.
Should I have a single IndexSearcher that's setup in my Global.asax file,
and then use that on any page that needs to search the index instead? I'd
need to close and reopen it when the index is updated, wouldn't I?
Any kind of guidance would be good, I'm not finding much written about this
sort of thing. :)
Thanks,
Kurt