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

excludeLimit() has no effect on QueryBuilder.range().above() queries

Description

When executing the following code, the excludeLimit() call has no effect.

1 2 3 4 5 6 7 Query query = queryBuilder .range() .onField("letter") .ignoreFieldBridge() .ignoreAnalyzer() .above("b").excludeLimit() .createQuery();

It's caused by a minor bug in ConnectedMultiFieldsRangeQueryBuilder.excludeLimit():

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public RangeTerminationExcludable excludeLimit() { if ( rangeContext.getFrom() != null && rangeContext.getTo() != null ) { rangeContext.setExcludeTo( true ); } else if ( rangeContext.getFrom() != null ) { rangeContext.setExcludeTo( true ); <---- should be From, not To } else if ( rangeContext.getTo() != null ) { rangeContext.setExcludeTo( true ); } else { throw new AssertionFailure( "Both from and to clause of a range query are null" ); } return this; }

Environment

None

Status

Assignee

Hardy Ferentschik

Reporter

Marko Lukša

Labels

None

Suitable for new contributors

Yes, likely

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

4.0.0.CR1
3.4.1.Final

Priority

Trivial