Saw it already, the problem is that the coord function gets 2 arguments: overlap - the number of query terms matched in the document maxOverlap - the total number of terms in the query
I need to divide overlap by number of terms in the document (rather than number of terms in query). Any idea how to do this? Grant Ingersoll-6 wrote: > > See the coord function in Similarity: > http://lucene.apache.org/java/2_4_1/api/core/org/apache/lucene/search/Similarity.html > > -Grant > > On Mar 22, 2009, at 9:49 PM, john atsh wrote: > >> >> I want to change slightly the similarity function, in the following >> way: >> >> Use same cosine similarity as defined by DefaultSimilarity, but >> multiply the >> result score by f, where f is defined as following >> f = (# of terms in query that appear also in document) / (# of terms >> in >> document) >> >> (this boosts documents that contain RELATIVELY more query terms) >> >> What's the best way to do it, and how? >> >> Thanks >> John >> -- >> View this message in context: >> http://www.nabble.com/Similarity-tp22650429p22650429.html >> Sent from the Lucene - Java Developer mailing list archive at >> Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-dev-h...@lucene.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-dev-h...@lucene.apache.org > > > -- View this message in context: http://www.nabble.com/Similarity-tp22650429p22705452.html Sent from the Lucene - Java Developer mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org