-->
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.  [ 4 posts ] 
Author Message
 Post subject: newbie question on querying on multiple attributes
PostPosted: Tue Dec 16, 2008 11:14 am 
Beginner
Beginner

Joined: Mon Aug 22, 2005 1:22 am
Posts: 36
This question is probably best for the Lucene user community but I thought I would try here first.

I have been using hibernate core for a long time. Now I am need of Full Text Search and am very excited about Hibernate Search.

However, I am little confused on exactly how it works in my situation.

I have a Business object that has lots of different attributes that need to be searched upon (products, services, categories, associations, etc)

I have created the index for Businesses and followed the example programs. Now I am trying to get FTS to work. However, what I am confused on is how to create the query to search against all of these attributes.

Do I need to list in the lucene query something like:

services='value' or products='value' or associations='value' or name='value'

or is there a way to send in 'value' that automatically looks at all the available indexed attributes?


Thanks in advance,

- Doug


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2008 2:19 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
It is currently not possible "automatically", you have to list which fields should be enabled for you search.
Lucene's MultiFieldQueryParser is a good helper for this situations, the book is full of examples about it.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2008 5:20 pm 
Beginner
Beginner

Joined: Mon Aug 22, 2005 1:22 am
Posts: 36
which book are you referring to?

Thanks for the quick reply!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2008 5:25 pm 
Beginner
Beginner

Joined: Mon Aug 22, 2005 1:22 am
Posts: 36
never mind...I see above that you were talking about HSiA

I will take a look at it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.