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

Hardy Ferentschik hardy at hibernate.org
Thu Aug 27 08:20:08 EDT 2015


> > 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.
> 
> Hum, but that's already happening, no?
> 
> See DSLTest.testUseOfFieldBridge() where we do exactly that:
> 
>     monthQb.keyword().onField( "monthValue" ).matching( 2 ).createQuery();
> 
> Internally it's creating a NumericRangeQuery with start/end set to the
> same value.

Hmm, I am pretty sure we did not start of this way, but maybe this has changed 
in the meantime. I seem to vaguely remember that we did something in this area
after the first cut.

--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/9b4bc224/attachment.bin 


More information about the hibernate-dev mailing list