-->
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 query on a @NumericField
PostPosted: Fri Oct 05, 2012 11:08 am 
Newbie

Joined: Fri Dec 17, 2010 11:14 am
Posts: 11
We have a field defined like:

Code:
@Fields({
            @Field(name = "foo", index = Index.TOKENIZED, store = Store.YES),
            @Field(name = "foo_forSort", index = Index.UN_TOKENIZED, store = Store.YES) })
   @NumericFields({
               @NumericField(forField = "foo"),
               @NumericField(forField = "foo_forSort", precisionStep = Integer.MAX_VALUE) })
   private Integer foo;


Ranged queries work correctly for this (i.e. [1230 TO 1239]), however wildcard queries do not (i.e. 123?). Is wildcard querying on Trie structures not supported or is this expected to normaly work.

Using
Hibernate 3.6.10.FINAL
Hibernate Search 3.4.FINAL


Top
 Profile  
 
 Post subject: Re: Wildcard query on a @NumericField
PostPosted: Fri Oct 05, 2012 3:26 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
wildcard queries are specific for text fields, to NumericField they don't make sense. What you can do is encode the foo value both as a NumericField and as a string fields. Note that you'll need padding when in the string form.

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