-->
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.  [ 5 posts ] 
Author Message
 Post subject: localize AND operator
PostPosted: Fri May 08, 2009 1:38 pm 
Newbie

Joined: Wed May 06, 2009 4:38 pm
Posts: 12
Hi,

Is there a way (a predefined way) to localize operators of a full text query ?

For example replace "AND" operator by its french counterpart "ET" or german "UND" so that "hibernate ET search" query is interpreted as "hibernate AND search".

Best regards,
Eric


Top
 Profile  
 
 Post subject: Re: localize AND operator
PostPosted: Fri May 08, 2009 3:26 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
the "predefined" answer is that QueryParser is just an example, for best flexibility you should implement your own or extend it.
Personally I would just use a regex to do some replacements in the string.

There are lots of questions like this, do you think we should embed some helper in Search?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: localize AND operator
PostPosted: Wed Oct 28, 2009 11:12 am 
Newbie

Joined: Wed May 06, 2009 4:38 pm
Posts: 12
You are right, it is not complicated to do string replacement with a regular expression before the query is processed by search engine.

Any way, it could be nice to have a set of translations available for search keywords. The search keyword language could be paramerized along with other hibernate search config parameters.

I asked this, since it is one of our customer requirement.

Best regards,
Eric


Top
 Profile  
 
 Post subject: Re: localize AND operator
PostPosted: Wed Oct 28, 2009 6:57 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
that's a lot of time for an answer :-)

Do you have a proposal about how this should work?
Would you be willing to provide some languages as a starter/concept idea to implement it?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: localize AND operator
PostPosted: Wed Mar 17, 2010 12:57 pm 
Newbie

Joined: Wed May 06, 2009 4:38 pm
Posts: 12
For example in hibernateProperties :

<prop key="hibernate.search.keywords.lang">fr</prop>

For french language.

And then a LocalizedQueryParser which would extend QueryParser and performs replacement of keywords in an overriden parse() method. The AND and OR operators would be overriden as well in the localized query parser depending on the hibernate.search.keywords.lang property value.

Best regards,
Eric


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