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 Patricio Galeas <ga...@informatik.uni-siegen.de> on 2005/09/21 19:21:13 UTC

Example ....Lucene with Java Server Pages?

Hello,
I search for a JSP examples of a simple search application with Lucene.
I try to execute the lucene search as a .jsp file but it doesn't work.
Do you know where can I found information about this topic

Thank You


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Example ....Lucene with Java Server Pages?

Posted by James Huang <me...@yahoo.com>.
That's exactly why I don't feel mine is the best
solution. Many people have been asking about the right
pattern for Lucene in webapps, and I'm paying close
attention to those.

To open an IndexSearcher is easy; the hard part for me
is when to close it (to be ready for a potentially new
index.) Perhaps a special HTTP command to trigger
that? I don't know.

-James

--- Otis Gospodnetic <ot...@yahoo.com>
wrote:

> James,
> 
> Well, if you want to do things right, then you
> should probably also get
> that IndexSearcher (or any other Java code) out of
> your JSP. :)
> 
> You are right, IndexSearchers are meant to be
> reused.  When the index
> changes, you need to open a new one, if you want to
> see the changes.
> 
> Otis
> 
> --- James Huang <me...@yahoo.com> wrote:
> 
> > That demo (results.jsp) opens a IndexSearcher per
> each
> > request, which I deem not really the right way of
> > using Lucene in a web app.
> > 
> > I used jspInit() to initiate a servlet-wide
> instance:
> > 
> > <%!
> >    IndexSearcher searcher = null;
> > 
> >    public void jspInit() {
> >       searcher = ...;
> >    }
> > %>
> > 
> > Still not complete sure if this is the best way,
> but
> > at least not every new IndexSearcher per request.
> > 
> > -James
> > 
> > --- Daniel Naber <lu...@danielnaber.de>
> wrote:
> > 
> > > On Wednesday 21 September 2005 19:21, Patricio
> > > Galeas wrote:
> > > 
> > > > I search for a JSP examples of a simple search
> > > application with Lucene.
> > > 
> > > lucene-1.4.3.tar.gz contains src/jsp. Also try
> "ant
> > > war-demo" in Lucene's 
> > > source package.
> > > 
> > > -- 
> > > http://www.danielnaber.de
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail:
> > > java-user-help@lucene.apache.org
> > > 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > 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
> 
> 



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Example ....Lucene with Java Server Pages?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
James,

Well, if you want to do things right, then you should probably also get
that IndexSearcher (or any other Java code) out of your JSP. :)

You are right, IndexSearchers are meant to be reused.  When the index
changes, you need to open a new one, if you want to see the changes.

Otis

--- James Huang <me...@yahoo.com> wrote:

> That demo (results.jsp) opens a IndexSearcher per each
> request, which I deem not really the right way of
> using Lucene in a web app.
> 
> I used jspInit() to initiate a servlet-wide instance:
> 
> <%!
>    IndexSearcher searcher = null;
> 
>    public void jspInit() {
>       searcher = ...;
>    }
> %>
> 
> Still not complete sure if this is the best way, but
> at least not every new IndexSearcher per request.
> 
> -James
> 
> --- Daniel Naber <lu...@danielnaber.de> wrote:
> 
> > On Wednesday 21 September 2005 19:21, Patricio
> > Galeas wrote:
> > 
> > > I search for a JSP examples of a simple search
> > application with Lucene.
> > 
> > lucene-1.4.3.tar.gz contains src/jsp. Also try "ant
> > war-demo" in Lucene's 
> > source package.
> > 
> > -- 
> > http://www.danielnaber.de
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail:
> > java-user-help@lucene.apache.org
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> 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


Re: Example ....Lucene with Java Server Pages?

Posted by James Huang <me...@yahoo.com>.
That demo (results.jsp) opens a IndexSearcher per each
request, which I deem not really the right way of
using Lucene in a web app.

I used jspInit() to initiate a servlet-wide instance:

<%!
   IndexSearcher searcher = null;

   public void jspInit() {
      searcher = ...;
   }
%>

Still not complete sure if this is the best way, but
at least not every new IndexSearcher per request.

-James

--- Daniel Naber <lu...@danielnaber.de> wrote:

> On Wednesday 21 September 2005 19:21, Patricio
> Galeas wrote:
> 
> > I search for a JSP examples of a simple search
> application with Lucene.
> 
> lucene-1.4.3.tar.gz contains src/jsp. Also try "ant
> war-demo" in Lucene's 
> source package.
> 
> -- 
> http://www.danielnaber.de
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail:
> java-user-help@lucene.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Example ....Lucene with Java Server Pages?

Posted by Daniel Naber <lu...@danielnaber.de>.
On Wednesday 21 September 2005 19:21, Patricio Galeas wrote:

> I search for a JSP examples of a simple search application with Lucene.

lucene-1.4.3.tar.gz contains src/jsp. Also try "ant war-demo" in Lucene's 
source package.

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org