[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-951) excludeLimit() has no effect on QueryBuilder.range().above() queries
Marko Lukša (JIRA)
noreply at atlassian.com
Sun Oct 16 10:57:20 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44057#comment-44057 ]
Marko Lukša commented on HSEARCH-951:
-------------------------------------
Pull request: https://github.com/hibernate/hibernate-search/pull/181
> excludeLimit() has no effect on QueryBuilder.range().above() queries
> --------------------------------------------------------------------
>
> Key: HSEARCH-951
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-951
> Project: Hibernate Search
> Issue Type: Bug
> Components: query
> Affects Versions: 3.4.1.Final, 4.0.0.CR1
> Reporter: Marko Lukša
> Priority: Trivial
>
> When executing the following code, the {{excludeLimit()}} call has no effect.
> {code}
> Query query = queryBuilder
> .range()
> .onField("letter")
> .ignoreFieldBridge()
> .ignoreAnalyzer()
> .above("b").excludeLimit()
> .createQuery();
> {code}
> It's caused by a minor bug in {{ConnectedMultiFieldsRangeQueryBuilder.excludeLimit()}}:
> {code}
> 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;
> }
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list