[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-542) Search results not sorted properly

Florin Haizea (JIRA) noreply at atlassian.com
Tue Jun 8 20:48:10 EDT 2010


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

Florin Haizea commented on HSEARCH-542:
---------------------------------------

After looking more into this issue and testing it more thoroughly I've found out the following:
1) The document contains each person name twice because I've annotated a class field and a class method using the same @Field name. So this was a bug in my code and had nothing to do with hibernate search.
2) The strange order of the results is given by a boost that I'm using for the field that is being searched: @Field(name = "full", boost = @Boost(2.0f)). If I remove the boost the results are ordered correctly. Apparently the boost is applied to all the names of a person, not only to the matching name as I thought. This caused the people with more names to have a higher score than people with one or two names which fully matched the search terms.


> Search results not sorted properly
> ----------------------------------
>
>                 Key: HSEARCH-542
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-542
>             Project: Hibernate Search
>          Issue Type: Bug
>    Affects Versions: 3.2.0.Final
>         Environment: Hibernate 3.5.1-Final, MySQL 5.1.6
>            Reporter: Florin Haizea
>            Priority: Critical
>         Attachments: ScoreIssue.zip
>
>
> Trying to index a simple relationship between a Person and a collection of Names. There are 2 issues:
> 1) The document containing the Person fields contains each name of that person TWICE. I think this may be affecting the score that the document receives. 
> 2) The search results are not ordered correctly. If I have one person with only one name: "Sly Stallone" and other people with multiple names, out of which one contains only "Sly" or only "Stallone", the people with multiple names have a higher score than the person with only one name that matches the search perfectly.
> Here's the original thread that started this issue: 
> https://forum.hibernate.org/viewtopic.php?f=9&t=1005019&sid=6f1870a4b18a0f2fbcc8c55e6c34671b
> I've attached a maven project which contains a test that fails. 

-- 
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