-->
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: how to get a record having * as result for searching
PostPosted: Fri Feb 29, 2008 8:17 am 
Newbie

Joined: Tue Oct 10, 2006 2:38 pm
Posts: 17
Let's say I have indexed this info [field: value]
record 1: name: Bob
record 2: name: Boby
record 3: name: Bob*
record 4: name: *

when I query for "Boby" is it possible to get as results
record 2,3,4? Right now I get only record 2, using KeywordAnalyzer

thanks a lot
serj


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 11:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I am a little bit confused. When you say you have indexed:
Code:
name: Bob
name: Boby
name: Bob*
name: *


Do you mean you have literally indexed the asterix (*) symbol? What are you trying to achieve? In case you really indexed the asterix and you search for 'Boby' I expect only to get record2.

Do get record 2,3 and 4 you would have to execute a boolean query like:
Code:
\* OR Bob?*


The question mark would ensure that there is at least one character after Bob. Check this out for more information about Lucene's query syntax: http://lucene.apache.org/java/docs/queryparsersyntax.html#Boolean%20operators

I am not sure if this helps you at all. Maybe you could give a little bit more context to your problem.

--Hardy


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.