-->
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.  [ 2 posts ] 
Author Message
 Post subject: Percentage score
PostPosted: Thu Oct 01, 2009 1:51 pm 
Newbie

Joined: Mon Dec 17, 2007 10:27 am
Posts: 3
Is it possible to get a matching percentage from a full text query. I.e.

A boolean query made up of termqueries for a keyword (joined with a SHOULD) and I need a projection that returns (keyword matches in index/keywords in boolean query). If all keywords are found, it will return 1, if 2 out of 5 keywords were found, it would return 0.4, etc.

Is this currently possible?


Top
 Profile  
 
 Post subject: Re: Percentage score
PostPosted: Fri Oct 02, 2009 6:12 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi, you can have something similar using projections:
Code:
ProjectionConstants.SCORE


But this score is not only about the number of matched keywords, look for scoring in Lucene's documentation: it's a pretty complex science and fully customizable.
You might consider the score got from Lucene a better value than 1..5, or you normalize it someway, or you implement your own scoring formula as it can be overriden.
See @Similarity to implement this.

_________________
Sanne
http://in.relation.to/


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

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.