-->
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.  [ 3 posts ] 
Author Message
 Post subject: 'Starts With' searches in Hibernate Search
PostPosted: Tue Sep 17, 2013 7:21 am 
Newbie

Joined: Mon Dec 24, 2012 6:32 am
Posts: 17
Hi All,
Can we perform searches which results if the result starts with the search query ?
E.g Person class has indexed fields First name and last name .
Indexed Entries ->
# First_Name Last_Name
1. Mary Jane
2. Jane Mary
3. Mary Jane Watson
4. Jackson Mary

Search String -> Mary
Results ->
1. Mary Jane
2. Mary Jane Watson

Entries 2 and 4 are omitted as they contain mary but don't start with Mary.

_________________
Sourabh Ghorpade


Last edited by sourabh.ghorpade on Wed Sep 18, 2013 3:56 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: 'Starts With' searches in Hibernate Search
PostPosted: Tue Sep 17, 2013 1:05 pm 
Newbie

Joined: Tue Sep 17, 2013 12:46 pm
Posts: 5
Yes.

http://docs.jboss.org/hibernate/search/4.3/reference/en-US/html_single/#section-building-lucene-queries

scroll down to section:
5.1.2.3. Wildcard queries


Top
 Profile  
 
 Post subject: Re: 'Starts With' searches in Hibernate Search
PostPosted: Wed Sep 18, 2013 3:53 pm 
Newbie

Joined: Mon Dec 24, 2012 6:32 am
Posts: 17
Hi NameNotTaken ,
Thanks for your reply.Perhaps you misunderstood my question. I have edited the question to highlight my requirement.
For a normal search, entry 2 & 4 will show up as they have mary in their last name. However what I want is that they shouldn't be considered as they don't start with Mary.
Is this possible in Hibernate Search without needing to specify the specific field on which to apply the query ?

_________________
Sourabh Ghorpade


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