lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chun Wei Ho" <cwho.w...@gmail.com>
Subject Giving weight to partial matches
Date Wed, 21 Jun 2006 14:48:45 GMT
I am performing searches on an index that includes a title field and a
content field, and return results only if either title or content
matches ALL the words searched. So searching for "miracle cure for
cancer" might yield:

(+title:miracle +title:cure +title:for +title:cancer)^5.0
(+content:miracle +content:cure +content:for +content:cancer)

What I like to do now is to give additional weight to a result if the
title field contains some of the words being search, for example the
document:

Title: Miracle Cure
Content: A miracle cure for cancer has been found!

would have higher weight/score because the title contains words that
were searched for (although not fully matched), even tho the content
field is the one that results in the match.

I've seen a few discussions on weighting on the list but they all seem
to revolve around FunctionQuery from Solr. My current application does
not use Solr and is based on Lucene 1.9.

Any suggestions would be great :)

---------------------------------------------------------------------
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