You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Alexy Khrabrov <de...@gmail.com> on 2009/09/12 08:25:14 UTC

applying cosine similarity directly

Given that I have a field for which term vector was computed and stored, and
that field is the text of a document, I'd like to rank a subset of such
documents by similarity to a given held-out document, or query, directly
using the cosine measure.  How can that be done without going through
creating a usual query?
Cheers,
Alexy

Re: applying cosine similarity directly

Posted by Anthony Urso <an...@gmail.com>.
There is a MoreLikeThis similarity search class in Lucene, it should
do what you're looking for.

http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/search/similar/MoreLikeThis.html

Cheers,
Anthony

On Fri, Sep 11, 2009 at 11:25 PM, Alexy Khrabrov <de...@gmail.com> wrote:
> Given that I have a field for which term vector was computed and stored, and
> that field is the text of a document, I'd like to rank a subset of such
> documents by similarity to a given held-out document, or query, directly
> using the cosine measure.  How can that be done without going through
> creating a usual query?
> Cheers,
> Alexy
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org