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 Ruslan Sivak <rs...@istandfor.com> on 2007/03/21 05:44:07 UTC
retrieving matched slop
I have an app that searches a single document against many queries.
Lets say the document was
The quick brown fox jumped over the lazy dog.
and my queries are
SpanNearQuery("quick","brown",50)
SpanNearQuery("quick","fox",50)
I would like to retrieve the slop or some sort of score that was matched
when I'm searching. Since the first one requires no slop, it would
return 0 or the highest score and the second query would return 1 for
slop as fox is one word away from quick. Is there any way to retrieve
these values?
Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: retrieving matched slop
Posted by Chris Hostetter <ho...@fucit.org>.
there's a few options...
you can define a custom SImilarity that makes the score based entirely on
the sloppyFreq ... it's not trivial, but it's certainly possible.
the other option is to call SpanQuery.getSpans directly, and then iterate
over it and compare end() - start() for each span.
: Date: Wed, 21 Mar 2007 00:44:07 -0400
: From: Ruslan Sivak <rs...@istandfor.com>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: retrieving matched slop
:
: I have an app that searches a single document against many queries.
: Lets say the document was
:
: The quick brown fox jumped over the lazy dog.
:
: and my queries are
:
: SpanNearQuery("quick","brown",50)
: SpanNearQuery("quick","fox",50)
:
: I would like to retrieve the slop or some sort of score that was matched
: when I'm searching. Since the first one requires no slop, it would
: return 0 or the highest score and the second query would return 1 for
: slop as fox is one word away from quick. Is there any way to retrieve
: these values?
:
: Russ
:
:
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
: For additional commands, e-mail: java-user-help@lucene.apache.org
:
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org