-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Hibernate Seach] Show relevance
PostPosted: Wed Jun 27, 2007 9:27 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Hello,

It's me again.

Is it possible to show the relevance of a result ?

For example, I want to display :
First result, 90%
First result, 40%
First result, 5%

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 10:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
First of all, I kind of thing it's a bad idea.
But definitively the application should have access to it.
John is working on it: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-74

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 11:02 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Ok thank you, and thank you John.

I want this value because I made a demo application, not for final users.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 09, 2007 11:44 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
John is already on it ?


Top
 Profile  
 
 Post subject: ...
PostPosted: Tue Jul 10, 2007 11:15 am 
Newbie

Joined: Fri Jul 06, 2007 5:45 pm
Posts: 5
yeah, this would really be great to have ...

to push things even further: how about an API to push things into the ranking algorithm that add custom weighs at query-time? something like

Code:
public interface QueryScoreCallback {
      public float rate(Document document or Object o or whatever);
}


but that's just a weird idea I wanted to post.

cheers, friedrich


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 1:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
For which use case?

_________________
Emmanuel


Top
 Profile  
 
 Post subject: distance
PostPosted: Wed Jul 11, 2007 2:13 pm 
Newbie

Joined: Fri Jul 06, 2007 5:45 pm
Posts: 5
a really obscure one, admittedly:

in my current project the physical distance between the user executing the query and a property of the retrieved document is a part of the hits relevance. also, certain other relationships between the user and the object can affect the score.

this is a pretty unusual requirement though, I guess, so I'll just go ahead and use the score projections once they become available.

cheers, friedrich


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 2:29 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Lucene has something for that that we could expose potentially, but I need to look at their API

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 7:17 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
I see a getScore is now possible, but how ?

Only like that ? :

Code:
fullTextQuery.setIndexProjection(FullTextQuery.SCORE,FullTextQuery.THIS);
List results = fullTextQuery.list();
Object[] firstResult = (Object[]) results.get(0);
Float score = (Float) firstResult[0];       
System.out.println("score : "+firstResult[0]);


Moreover, if we want to normalize the score (in percent for example), is it possible to the get max Score ?
(http://jsourcery.com/api/apache/lucene/ ... pDocs.html)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 3:00 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
yes that's how you can query it.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 3:17 pm 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Ok, thank you very much ;).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 23, 2007 9:33 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Is there a possibilité to get max score now ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 28, 2007 2:58 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No I did some research, and it turns out that max score is not especially relevent, Hibernate returns a score between ]0 and 1], but the top score is not guaranteed to tbe 1.
Check here for more info discussions, http://opensource.atlassian.com/project ... SEARCH-101

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 3:30 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Hum, I don't understand everything. Is there any possiblity to have the result scores sum equal to 1 ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 30, 2007 5:13 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
yes the formula used by Lucene to build score allows 1 (but not 0 which means that the object is irrelevant, hence excluded from the results :) )
So your results are included in ]0, 1]

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.