-->
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: Wildcard Queries
PostPosted: Fri Jul 26, 2013 7:18 am 
Newbie

Joined: Tue Dec 23, 2003 5:53 am
Posts: 7
Location: India
I know that wildquery has some performance hit but I need to use it for one of the usecase

Following code does not return any result but changing the search term to exact match returning the results

org.apache.lucene.search.Query query = qb.keyword()
.wildcard()
.onField("firstName")
.matching("queryString" + "*")
.createQuery();


I have tried with followig input string

Query String------> Results
1. San* ---> No Result
2. Santosh ----> 5 Results

Is there anything missing in my code. Following links talks about the wild card query
http://docs.jboss.org/hibernate/search/3.3/reference/en-US/html/search-query.html
refer the secion - 5.1.2.3. Wildcard queries

-Santosh


Top
 Profile  
 
 Post subject: Re: Wildcard Queries
PostPosted: Fri Jul 26, 2013 7:33 am 
Newbie

Joined: Tue Dec 23, 2003 5:53 am
Posts: 7
Location: India
Found It :)

fullTextSession.createFullTextQuery(new WildcardQuery(new Term("firstName", queryString + "*")), User.class);


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.