[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-325) org.hibernate.search.query.FullTextQueryImpl.iterate() ommit the last result.

Ivan Latysh (JIRA) noreply at atlassian.com
Fri Dec 12 17:10:38 EST 2008


org.hibernate.search.query.FullTextQueryImpl.iterate() ommit the last result.
-----------------------------------------------------------------------------

                 Key: HSEARCH-325
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-325
             Project: Hibernate Search
          Issue Type: Bug
          Components: query
    Affects Versions: 3.1.0.GA
            Reporter: Ivan Latysh
            Priority: Blocker


line 152 : int size = max - first + 1 < 0 ? 0 : max - first + 1;

will produce wrong size, because max( first, queryHits.totalHits ) returns not the size of the selection but the max element index so for 3 hits max=2.
And since first element is 1 and not 0 we have to account for it.

Correct size calculation:
line 152 : int size = max - first + 2 < 0 ? 0 : max - first + 2;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list