lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Itamar Syn-Hershko" <ita...@divrei-tora.com>
Subject RE: Retrieving documents that match atleast n query terms
Date Mon, 04 Feb 2008 10:56:24 GMT
I'm not 100% sure, but I think you could use Lucene's scoring for this. So
if you ran your query and received N results, loop through them and check
the scoring explanation (which I'm not quite sure how to acquire). This
should tell you how many terms out of the query were found. This approach
should work fine if all terms have the same frequency throughout the docs.
If there is one term which is highly frequent in one of the docs, this might
fail.

But again, I'm no Lucene pro. I would love to hear an answer myself from one
of the Lucene wiz-es.

Itamar.

-----Original Message-----
From: Dipsy Kapoor [mailto:dipsykapoor@gmail.com] 
Sent: Wednesday, January 30, 2008 8:43 PM
To: java-user@lucene.apache.org
Subject: Retrieving documents that match atleast n query terms

Hi,

I am using a BooleanQuery of the form:
   T1 OR T2 OR T3 OR ...... Tn
to search on a  field in Lucene.

Is there a way to force the search to return documents that match at least
say 5 of the query Terms?

Thanks,
Dipsy Kapoor

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





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


Mime
View raw message