lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gustavo Comba" <gco...@emagister.com>
Subject RE: Giving weight to partial matches
Date Wed, 21 Jun 2006 14:59:22 GMT
Hi,

	You can use something like:

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

	Should do the work.

	Regards,

		Gustavo

-----Mensaje original-----
De: Chun Wei Ho [mailto:cwho.work@gmail.com] 
Enviado el: miƩrcoles, 21 de junio de 2006 16:49
Para: java-user@lucene.apache.org
Asunto: Giving weight to partial matches

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


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