-->
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: Do I need a QueryParser for a Fieldbridge in H. Search?
PostPosted: Sat Jan 19, 2008 10:38 am 
Newbie

Joined: Sat Jan 19, 2008 10:16 am
Posts: 2
Hi,

Is it possible to search on number ranges with only adding a @FieldBridge annotation to the field? I use the PaddedIntegerBridge from the manual and it indexes the data correctly, but I still have to pad my query wit zeroes.

As far as I understand I also have to create a custom QueryParser to pad the zeroes of my Query (http://wiki.apache.org/lucene-java/Sear ... icalFields). This parser basicly does the same thing as the PaddedIntegerBridge.
Is there something like a FieldBridgeQueryParser?


Thanks for your help!


Top
 Profile  
 
 Post subject: Re: Do I need a QueryParser for a Fieldbridge in H. Search?
PostPosted: Mon Jan 21, 2008 6:14 am 
Hibernate Team
Hibernate Team

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

Is it possible to search on number ranges with only adding a @FieldBridge annotation to the field? I use the PaddedIntegerBridge from the manual and it indexes the data correctly, but I still have to pad my query wit zeroes.

That is correct. If you want to use range queries you will have to make sure that you numbers get padded at indexing time (that's what the PaddedIntegerBridge does) and at query time.
jvwilge wrote:
As far as I understand I also have to create a custom QueryParser to pad the zeroes of my Query (http://wiki.apache.org/lucene-java/Sear ... icalFields). This parser basicly does the same thing as the PaddedIntegerBridge.
Is there something like a FieldBridgeQueryParser?

Yes, this is the right approach. There is is some example code in the "Lucene in Action" book as well.
And no, there is no FieldBridgeQueryParser :) When it comes to querying the Lucene index you have to write native Lucene queries. There is no special support from Hibernate Search for that.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 31, 2008 11:47 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
There is no particular support for building queries on purpose. But I always had in mind to play with the idea of a query parser that could reuse the field bridge data and introduce the notion of parameters to a Lucene query. If someone wants to prototype that...

_________________
Emmanuel


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.