-->
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: [Hibernate Search] Full text search for numbering properties
PostPosted: Mon Jul 09, 2007 9:28 pm 
Regular
Regular

Joined: Tue Nov 04, 2003 12:37 pm
Posts: 57
Hello,

How can I use Lucene Search to define a query that can search entities with some "text" and "number" ?

For example:

Code:
class User {
      private String name;
      private int age;
}


How can I search all the users whose names include "John" and their ages between 15 and 20?

How can I define a query for this condition and what's the Lucene Search Annotation for "name" and "age" in the class User?

Please help!

Best regards,
Eric


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
In Lucene the way to do AND queries is to use 'AND' between each term.
As for the other questions, did you read the reference documentation? http://www.hibernate.org/hib_docs/searc ... ml_single/
Did it help?

_________________
Emmanuel


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.