Re: IndexSearcher in Servlet

2006-06-28 Thread Aleksander M. Stensby
You have to re-init the searcher / reader object. You can re-init the reader object that the searcher uses, without re-initing the searcher object itself, as stated earlier here On Wed, 28 Jun 2006 14:23:21 +0200, heritrix.lucene <[EMAIL PROTECTED]> wrote: o o no I mean the searching wou

Re: IndexSearcher in Servlet

2006-06-28 Thread heritrix . lucene
o o no I mean the searching would be fast or not... But now i have tested. The result that i found reveals that there would be no difference in terms of searching speed. But there is another thing that i want to ask. What if the index is changed in between. Will the indexReader give the results w

Re: IndexSearcher in Servlet

2006-06-28 Thread Erik Hatcher
On Jun 28, 2006, at 6:53 AM, heritrix.lucene wrote: Is there any difference in terms of speed between IndexReader and IndexSearcher?? I'm assuming you mean is there any difference in speed in how you construct an IndexSearcher no. Erik On 6/27/06, Erik Hatcher <[EMAIL PRO

Re: IndexSearcher in Servlet

2006-06-28 Thread Aleksander M. Stensby
As far as i know, an IndexSearcher use an IndexReader.. Hence you can do searcher.getIndexReader().. even tho you instanciated the searcher with a string path or a directory. So, i would guess that by creating a searcher with an indexreader as parameter, the constructor will be faster. But,

Re: IndexSearcher in Servlet

2006-06-28 Thread heritrix . lucene
Is there any difference in terms of speed between IndexReader and IndexSearcher?? On 6/27/06, Erik Hatcher <[EMAIL PROTECTED]> wrote: On Jun 27, 2006, at 10:32 AM, Fabrice Robini wrote: > That's also my case... > I create a new IndexSearcher at each query, but with a static and > instanciate

Re: IndexSearcher in Servlet

2006-06-27 Thread Erik Hatcher
ent. --Renaud - Original Message - From: "Erik Hatcher" <[EMAIL PROTECTED]> To: Sent: Tuesday, June 27, 2006 3:49 AM Subject: Re: IndexSearcher in Servlet On Jun 27, 2006, at 5:47 AM, Fabrice Robini wrote: What is your advice for webApplication ? It all depends

Re: IndexSearcher in Servlet

2006-06-27 Thread Renaud Waldura
uot;Erik Hatcher" <[EMAIL PROTECTED]> To: Sent: Tuesday, June 27, 2006 3:49 AM Subject: Re: IndexSearcher in Servlet On Jun 27, 2006, at 5:47 AM, Fabrice Robini wrote: What is your advice for webApplication ? It all depends :) - IndexSearcher pool ? No point in that. A single Index

Re: IndexSearcher in Servlet

2006-06-27 Thread Erik Hatcher
On Jun 27, 2006, at 10:32 AM, Fabrice Robini wrote: That's also my case... I create a new IndexSearcher at each query, but with a static and instanciated Directory. New IndexSearcher(myDirectory) It seems to be OK... am I wrong ? You may be "ok" given your query patterns, but you won't benef

Re: IndexSearcher in Servlet

2006-06-27 Thread Erik Hatcher
static searcher. Of course you still have to manage the static reader. Am I wrong in my thinking here? Thanks, Michael Crump -Original Message- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 6:49 AM To: java-user@lucene.apache.org Subject: Re: IndexSear

RE: IndexSearcher in Servlet

2006-06-27 Thread Fabrice Robini
java-user@lucene.apache.org Subject: RE: IndexSearcher in Servlet Hello, I have another question along this line. One of the points made in this thread was to never create a new IndexSearcher for each query. Is this true even in the case that an IndexSearcher is being created with a static or c

Re: IndexSearcher in Servlet

2006-06-27 Thread Karel Tejnora
Singleton pattern is better. Than you can extend it to proxy pattern. existing IndexReader really isn't that expensive and does get around - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: IndexSearcher in Servlet

2006-06-27 Thread Crump, Michael
e the static reader. Am I wrong in my thinking here? Thanks, Michael Crump -Original Message- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 6:49 AM To: java-user@lucene.apache.org Subject: Re: IndexSearcher in Servlet On Jun 27, 2006, at 5:47 AM, Fabrice Robini

RE: IndexSearcher in Servlet

2006-06-27 Thread Omar Didi
Tuesday, June 27, 2006 8:01 AM > To: java-user@lucene.apache.org > Subject: RE: IndexSearcher in Servlet > > > Erik, > > Thank you for your reply. > I'm goingto use the static IndexSearcher in my Servlet (my > index is static). > > Thanks :-) > &g

RE: IndexSearcher in Servlet

2006-06-27 Thread Fabrice Robini
Erik, Thank you for your reply. I'm goingto use the static IndexSearcher in my Servlet (my index is static). Thanks :-) -Original Message- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: mardi 27 juin 2006 12:49 To: java-user@lucene.apache.org Subject: Re: IndexSearcher in Se

Re: IndexSearcher in Servlet

2006-06-27 Thread heritrix . lucene
[EMAIL PROTECTED] Sent: mardi 27 juin 2006 11:41 To: java-user@lucene.apache.org Subject: Re: IndexSearcher in Servlet On Jun 27, 2006, at 5:11 AM, heritrix.lucene wrote: > Hi, > I also had the same confusion. But today when i did the testing i > found that > it will merge your results. T

Re: IndexSearcher in Servlet

2006-06-27 Thread Erik Hatcher
makes sense in my current project. Erik Thanks a lot, Fab -Original Message- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: mardi 27 juin 2006 11:41 To: java-user@lucene.apache.org Subject: Re: IndexSearcher in Servlet On Jun 27, 2006, at 5:11 AM, heritrix.lucene wrote:

RE: IndexSearcher in Servlet

2006-06-27 Thread Fabrice Robini
: Re: IndexSearcher in Servlet On Jun 27, 2006, at 5:11 AM, heritrix.lucene wrote: > Hi, > I also had the same confusion. But today when i did the testing i > found that > it will merge your results. Therefore i believe that indexSearcher > is not > thread safe. I tried this

Re: IndexSearcher in Servlet

2006-06-27 Thread Erik Hatcher
ead safe. Jelda > -Original Message- > From: heritrix.lucene [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 27, 2006 10:58 AM > To: java-user@lucene.apache.org > Subject: Re: IndexSearcher in Servlet > > Hi, > The same question i asked yesterday. :-) And now i know the

Re: IndexSearcher in Servlet

2006-06-27 Thread heritrix . lucene
.org > Subject: Re: IndexSearcher in Servlet > > Hi, > The same question i asked yesterday. :-) And now i know the answer :0 > > Creating a new searcher for each query will make your > application very very slow... (leave this idea) U can not > have a static indexsearcher object

RE: IndexSearcher in Servlet

2006-06-27 Thread Ramana Jelda
e.apache.org > Subject: Re: IndexSearcher in Servlet > > Hi, > The same question i asked yesterday. :-) And now i know the answer :0 > > Creating a new searcher for each query will make your > application very very slow... (leave this idea) U can not > have a static ind

RE: IndexSearcher in Servlet

2006-06-27 Thread Fabrice Robini
ROTECTED] Sent: mardi 27 juin 2006 10:58 To: java-user@lucene.apache.org Subject: Re: IndexSearcher in Servlet Hi, The same question i asked yesterday. :-) And now i know the answer :0 Creating a new searcher for each query will make your application very very slow... (leave this idea) U can no

Re: IndexSearcher in Servlet

2006-06-27 Thread heritrix . lucene
Hi, The same question i asked yesterday. :-) And now i know the answer :0 Creating a new searcher for each query will make your application very very slow... (leave this idea) U can not have a static indexsearcher object. It will merge all results and the user will get the result of their que

Re: IndexSearcher in servlet containers

2005-10-06 Thread Cyril Barlow
> > There really is no need to close an IndexSearcher until you need to > instantiate another one, and even then you can let the old instance > go without closing and all will still be well. If you construct > IndexSearcher with a String directory name, there is no need to close > anything other

Re: IndexSearcher in servlet containers

2005-10-06 Thread Erik Hatcher
On Oct 5, 2005, at 9:32 PM, Cyril Barlow wrote: Creating an IndexSearcher for every request goes against how to use Lucene best. A _single_ IndexSearcher for all searches is optimum. You really ought to look into using a single instance. Erik ---

Re: IndexSearcher in servlet containers

2005-10-05 Thread Cyril Barlow
- Original Message - From: "Erik Hatcher" <[EMAIL PROTECTED]> To: Sent: Thursday, October 06, 2005 2:10 AM Subject: Re: IndexSearcher in servlet containers > > On Oct 5, 2005, at 9:03 PM, Cyril Barlow wrote: > > > > > > >>> I'm get

Re: IndexSearcher in servlet containers

2005-10-05 Thread Erik Hatcher
On Oct 5, 2005, at 9:03 PM, Cyril Barlow wrote: I'm getting : java.io.IOException: The handle is invalid at java.io.RandomAccessFile.seek(Native Method) at Did you perhaps close the IndexSearcher somewhere along the way? Erik No, but I'm now creating new IndexSearchers every s

Re: IndexSearcher in servlet containers

2005-10-05 Thread Cyril Barlow
> > I'm getting : > > > > java.io.IOException: The handle is invalid at > > java.io.RandomAccessFile.seek(Native Method) at > > Did you perhaps close the IndexSearcher somewhere along the way? > > Erik No, but I'm now creating new IndexSearchers every servlet doPost method and not closing

Re: IndexSearcher in servlet containers

2005-10-05 Thread Erik Hatcher
On Oct 5, 2005, at 8:15 PM, Cyril Barlow wrote: Using one IndexSearcher across the whole application doesn't seem to work. It works for lucenebook.com :) I'm getting : java.io.IOException: The handle is invalid at java.io.RandomAccessFile.seek(Native Method) at Did you perhaps close the

Re: IndexSearcher in servlet containers

2005-10-05 Thread Cyril Barlow
- Original Message - From: "Erik Hatcher" <[EMAIL PROTECTED]> To: Sent: Wednesday, October 05, 2005 8:20 PM Subject: Re: IndexSearcher in servlet containers > > On Oct 5, 2005, at 2:09 PM, Cyril Barlow wrote: > >> I'm really confused on the dile

Re: IndexSearcher in servlet containers

2005-10-05 Thread Erik Hatcher
On Oct 5, 2005, at 2:09 PM, Cyril Barlow wrote: I'm really confused on the dilemma here. You can create a startup hook using one of the Servlet specification listeners, create an IndexSearcher there, stuff it into application scope (context.setAttribute()). There is no digging into Jetty's gut

Re: IndexSearcher in servlet containers

2005-10-05 Thread Cyril Barlow
- Original Message - From: "Erik Hatcher" <[EMAIL PROTECTED]> To: Sent: Wednesday, October 05, 2005 6:34 PM Subject: Re: IndexSearcher in servlet containers > > On Oct 5, 2005, at 9:54 AM, Cyril Barlow wrote: > > Thanks all for your feedback. I&#

Re: IndexSearcher in servlet containers

2005-10-05 Thread Erik Hatcher
On Oct 5, 2005, at 9:54 AM, Cyril Barlow wrote: Thanks all for your feedback. I'm going to look at building a dedicated server that keeps one IndexSearcher open and each servlet would use that. Either that or look deeper into the Jetty framework to see if I can simply invoke a global IndexS

Re: IndexSearcher in servlet containers

2005-10-05 Thread Cyril Barlow
Thanks all for your feedback. I'm going to look at building a dedicated server that keeps one IndexSearcher open and each servlet would use that. Either that or look deeper into the Jetty framework to see if I can simply invoke a global IndexSearcher when the server starts and use that. Not quite s

RE: IndexSearcher in servlet containers

2005-10-05 Thread Vanlerberghe, Luc
Take a look at the DelayCloseIndexSearcher I contributed yesterday. http://issues.apache.org/jira/browse/LUCENE-445 You should set up a SearcherFactory in an object that implements ServletContextListener that receives webapp startup/shutdown events and your servlets should get an IndexSearcher fr

Re: IndexSearcher in servlet containers

2005-10-05 Thread Erik Hatcher
Cache IndexSearcher and only use *one* instance for all requests. Application scope works well for this in a servlet environment. Erik On Oct 5, 2005, at 9:15 AM, Cyril Barlow wrote: Has anyone got experience of using the IndexSearcher in a servlet? I'm having caching problems when the

RE: IndexSearcher in servlet containers

2005-10-05 Thread Mordo, Aviran (EXP N-NANNATEK)
There where no problems for me. Do you use the same IndexReader for all your searchers ? Aviran http://www.aviransplace.com -Original Message- From: Cyril Barlow [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 05, 2005 9:15 AM To: java-user@lucene.apache.org Subject: IndexSearcher in