You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Aidan Connolly <Ai...@xcom.de> on 2004/08/25 12:51:57 UTC

Re: FW: Search component with Lucene [auf Viren geprueft]

Your Lucene functionality should be integrated  in a session bean and 
tapestry should then call your bean. 
- Aidan (Dublin)

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