You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by easydoor <ch...@valdoise.fr> on 2008/09/30 17:41:37 UTC

Advanced Search Engine

Hi,

I'd like to add an advanced search engine in a web Click application by 
combining at least 15 criterias from my data model, excluding certain criteria 
and combining several searchs.

If i try to do this with the hibernate Criterias it seems very fastidious ! 

So is it possible to integrate a search engine like Lucene or Compass or 
another one ? Do you have examples to show or return of experience ?

Thank you in advance


Re: Advanced Search Engine

Posted by Bob Schellink <sa...@gmail.com>.
Hi Christophe,

easydoor wrote:
> I'd like to add an advanced search engine in a web Click application by 
> combining at least 15 criterias from my data model, excluding certain criteria 
> and combining several searchs.
> If i try to do this with the hibernate Criterias it seems very fastidious ! 
>   
So you want a fulltext search over your domain model? I would imagine 
Hibernate Search should be the most transparent as it will create
and maintain the Lucene index automatically. If you make changes to your 
model you probably don't have to make any changes to your
Lucene index, because Hibernate should take care of it. Note that I 
don't know anything about Hibernate Search, just drawing logical 
conclusions ;-).

You could also look at using Hibernate Interceptor to intercept changes 
to your model. From there you could maintain a Lucene index.

Another option to look at is your native database fulltext engine. Most 
DB's ship with one for example MySQL and Postgres.

> So is it possible to integrate a search engine like Lucene or Compass or 
> another one ? 

The integration point between Click and Lucene is really when you need 
to display the results. For example if Lucene returns a
bunch of Hits you could use Velocity to display it in a table layout. Or 
you can use Click's Table component to display the results
(although you will need to adapt the Lucene Hits to either a Map or 
JavaBean for Table to read it).

> Do you have examples to show or return of experience ?
>   

My experience with Lucene is mostly with indexing fulltext documents not 
entity models, so I'm probably not of much help here.

regards

bob