[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-325) FullTextQuery.iterate() skips last result.

Sanne Grinovero (JIRA) noreply at atlassian.com
Sat Feb 14 19:33:43 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32417#action_32417 ] 

Sanne Grinovero commented on HSEARCH-325:
-----------------------------------------

it looks like to me the first element is 0, not 1?

> FullTextQuery.iterate() skips 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
>            Assignee: Sanne Grinovero
>            Priority: Blocker
>             Fix For: 3.1.1
>
>
> 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