-->
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: best way to execute querys
PostPosted: Tue Nov 29, 2011 10:07 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi all,

I need to create a search for my Lucene index in Hibernate Search. Right now I have a three layer application (Web services, EJB and DAO). In DAO layer I have a method to search for several fields with MultiFieldQueryParser.

Now, I want to offer Phrase querys to insert q query string like "Batman and robin", searching for this title not tokenized. I am going to force the user to insert the query string with quotation marks. That way i will know that i have to use PhraseQuery and not MultiFieldQueryParser...

I will check in my search EJB if the query string has quotations (") and execute one or another searching.

Anybody has done something similar? is this the best way to do it?

Thanks in advance,

Hibernator.


Top
 Profile  
 
 Post subject: Re: best way to execute querys
PostPosted: Tue Nov 29, 2011 12:29 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
sounds good. The QueryParser should be able to apply some clever logic to """ as well.. I'd suggest to write some test to validate your expectations.

_________________
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.