You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nanda Firdausi <en...@spymac.com> on 2004/08/21 05:06:53 UTC
FW: Search component with Lucene
Hello,
How can I combine Lucene and Tapestry in my web project?
I see several example in google, but no source code at all.
Anybody can help?
TIA
Nanda Firdausi
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Search component with Lucene
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Aug 21, 2004, at 12:52 AM, Shawn Church wrote:
> Using Lucene with Tapestry is really no different than using Lucene
> without
> Tapestry.
Or using Tapestry with a database. There is no single best answer for
how to tie Tapestry to external resources - it really depends on your
preferences and architecture.
> -----Original Message-----
> From: Nanda Firdausi [mailto:enefem@spymac.com]
> Sent: Friday, August 20, 2004 10:07 PM
> To: tapestry-user@jakarta.apache.org
> Subject: FW: Search component with Lucene
>
>
> Hello,
>
> How can I combine Lucene and Tapestry in my web project?
> I see several example in google, but no source code at all.
> Anybody can help?
Could you explain a bit more? I will be packaging a WordNet synonym
search engine using Tapestry in the source code released with Lucene in
Action:
http://www.manning.com/hatcher2
I should have the code available for download by the end of September
and the book will hopefully be available in October sometime I suspect.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Search component with Lucene
Posted by Shawn Church <sh...@boxity.com>.
Are you new to Lucene, Tapestry, or both? I can give you a general
overview, but it may not be that helpful. I can provide more details if I
know more about what you are needing.
Using Lucene with Tapestry is really no different than using Lucene without
Tapestry. The type of data I normally need to index tends to change often,
so I prefer to start a singleton indexing thread from within my web
application which reindexes my data on a periodic basis. In the case of
Tapestry, I start this thread within the Engine initialization. If your
data does not change often or you prefer to not mess with the thread
management, a standalone indexing application works just as well.
You will need to decide the type of indexing algorithm (analyzer) and
filters Lucene should apply, depending on the nature of your data. You will
also need to identify what key information you are ultimately trying to
locate. For example, if you are doing a keyword search for a customer
(based on customer name, address, phone number, etc.), then the key which
Lucene should associate with your indexed data would be a customer number.
Selecting the correct analyzer is sometimes tricky (again depending on your
data and search requirements), but is very important for generating
meaningful search results.
To perform a search on your index will normally require only a simple
Tapestry page where the search criteria is entered and the search is
performed. Displaying the search results is also not too difficult, but you
will want to handle paging through the results. Lucene is very easy to work
with in this way.
http://jakarta.apache.org/lucene/docs/index.html
http://lucene.sourceforge.net/cgi-bin/faq/faqmanager.cgi
Shawn
-----Original Message-----
From: Nanda Firdausi [mailto:enefem@spymac.com]
Sent: Friday, August 20, 2004 10:07 PM
To: tapestry-user@jakarta.apache.org
Subject: FW: Search component with Lucene
Hello,
How can I combine Lucene and Tapestry in my web project?
I see several example in google, but no source code at all.
Anybody can help?
TIA
Nanda Firdausi
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Search component with Lucene [auf Viren geprueft]
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Aug 25, 2004, at 5:51 AM, Aidan Connolly wrote:
> Your Lucene functionality should be integrated in a session bean and
> tapestry should then call your bean.
What makes you recommend this approach?
For the record, I completely disagree. Lucene's search results come
back through Hits. Hiding Hits under a session bean* adds a level of
indirection that is unnecessary and also problematic when paging
through them and working with them as Lucene intended you to work with.
It works ok if you want to limit your options at the presentation
tier, but is not a recommended solution.
it's not wrong, per se, to do this, it just severely limits your
options - you cannot pass Hits directly back through an EJB interface
(easily) so you would likely be accessing every Document in Hits (or
more wisely limiting it to a max) and potentially consuming quite a lot
of resources in order to pass every Document back over the wire. More
often than not users only want the first few documents, and do not care
about the 537th hit. And accessing Documents from Hits is not a cheap
operation and should be avoided if unnecessary.
To lend some credibility to what I'm saying, I know a little about
Lucene :) http://www.manning.com/hatcher2 - we're putting the final
touches on this book as we speak.
Erik
* And before anyone blasts me for violating my own advice - yes, I did
publicize an _example_ that does do this very thing:
http://www.ehatchersolutions.com/JavaDevWithAnt. [The download is not
currently navigable - go to
http://www.ehatchersolutions.com/downloads/JavaDevWithAnt-1.0.zip
directly to download]
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: FW: Search component with Lucene [auf Viren geprueft]
Posted by Aidan Connolly <Ai...@xcom.de>.
Your Lucene functionality should be integrated in a session bean and
tapestry should then call your bean.
- Aidan (Dublin)