We're updating the issue view to help you get more done. 

DSL range/below on a string field creates a TermRangeQuery with lower bound equal to the null token

Description

range().onField( "theField" ).below( "XX" ) should generate the query theField:[* TO XX] but instead we get theField:[_null_TO XX].

This happens when theField has a

1 '_null_'

null token specified

1 (indexNullAs = "_null_")

.

The problem seems to be in ConnectedMultiFieldsRangeQueryBuilder which swaps the null value with the null token. While this is normal for term queries I do not believe it makes any sense for range queries because they support null bounds out of the box.

I have prepared here a branch with a UT and a fix: https://github.com/anistor/hibernate-search/tree/t_below_bug_m

Environment

None

Status

Assignee

Adrian Nistor

Reporter

Adrian Nistor

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.5.0.Final

Priority

Major