-->
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.  [ 2 posts ] 
Author Message
 Post subject: Search in multiple fields
PostPosted: Mon Jul 18, 2011 5:44 am 
Newbie

Joined: Mon Jul 18, 2011 5:16 am
Posts: 1
Hi to everybody,
I have a problem with search results into different fields.
I have an entity "Author" with different fields "name, surname, pseudonym".
I want to insert text, for example into a TextBox, and search it into all fields.

For example:
looking for "Leona Da Vinci".
In my entity I have 'Leonardo' into 'name' field and 'Da Vinci' into 'pseudonym' field.
It doesn't have to search into separated fields but in a new field composed by all three fields(name, surname, pseudonym).

How can I do this???
Thanks for help


Top
 Profile  
 
 Post subject: Re: Search in multiple fields
PostPosted: Mon Jul 18, 2011 6:27 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
you should use a boolean query, read about "Combining queries" in the documentation:
make a different query for each of the target fields and use the SHOULD operation to combine them all.

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


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