[hibernate-dev] Search DSL expectations for "keyword()" clause

Hardy Ferentschik hardy at hibernate.org
Thu Aug 27 05:27:28 EDT 2015


On Wed, Aug 26, 2015 at 09:58:39PM +0100, Sanne Grinovero wrote:
> Assuming you build a Lucene Query the following way:
> 
>     queryBuilder.keyword().onField( "age" ).matching( 5 ).createQuery();
> 
> What is your expectation, if the "age" field is being indexed as a NumericField?

I would say that this throws an exception. At least atm. Numeric encoded
fields needs to be targeted by a range query. One could imagine to transparently
create a range query in this case. I guess by the metadata we could tell that we have
a numeric field. However, that's a a lot of magic then, in particular since we
always that that a keyword query maps to a TermQuery.

--Hardy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 496 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20150827/2e472b93/attachment-0001.bin 


More information about the hibernate-dev mailing list