-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Multi criterias search
PostPosted: Wed Mar 10, 2010 10:51 am 
Newbie

Joined: Wed Mar 10, 2010 10:38 am
Posts: 9
Hi there,

I need to write a multi-criterias search engine including full text search.

For example : show me every message containing "A" or "B" between date "X" and date "Y".

I just want to index the messages content, but no other data.
Is it possible to use hibernate search in this case ? Or do I have to implement Lucene Filters and index everything ?

Thanks for any clue.


Top
 Profile  
 
 Post subject: Re: Multi criterias search
PostPosted: Wed Mar 10, 2010 11:22 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

Hibernate Search seem to be a good fit for your problem. Using the annotations @Field and @IndexedEmbedded you can control what gets indexed and how. Whether or not you will need filters depends on your use case. When using date range searches filters are often a good solution. This has nothing to do with "indexing everything" though. Implementing and using Filters is very easy in Hibernate Search.

I recommend you start with the online documentation and read through the examples there.

--Hardy


Top
 Profile  
 
 Post subject: Re: Multi criterias search
PostPosted: Wed Mar 10, 2010 11:33 am 
Newbie

Joined: Wed Mar 10, 2010 10:38 am
Posts: 9
Hi Hardy, thank you for responding.

I've read the online documentation, but I didn't see any example mixing filters/criterias and full text search.
The Filter chapter is about implementing Lucene filters.

So I may misunderstand, but for me Lucene must have metadata to apply these filters, so data is indexed.
Am I wrong ?

Furthermore, do you know if it's possible to use OR clauses ?


Top
 Profile  
 
 Post subject: Re: Multi criterias search
PostPosted: Wed Mar 10, 2010 11:48 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
In case you are planning to mix Hibernate Criteria queries and Lucene queries - that is not supported and would in fact be very inefficient. We recommend you are indexing all the data you need for performing your searches against the Lucene index.
And yes, you can have boolean operators in Lucene queries (AND, OR, NOT). Make sure to check the Lucene query syntax.

--Hardy


Top
 Profile  
 
 Post subject: Re: Multi criterias search
PostPosted: Wed Mar 10, 2010 11:53 am 
Newbie

Joined: Wed Mar 10, 2010 10:38 am
Posts: 9
Ok thanks :)


Top
 Profile  
 
 Post subject: Re: Multi criterias search
PostPosted: Fri Mar 12, 2010 6:55 am 
Newbie

Joined: Fri Mar 12, 2010 6:47 am
Posts: 2
okay this is nice...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.