lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ching-Pei Hsing <cphs...@comergent.com>
Subject Need help in changing the search score
Date Tue, 11 Mar 2003 03:11:20 GMT
Hi,

Can somebody help us to figure out how to build queries (or tune Lucene) to
return the result in a specific order? When search against multiple fields,
It seems like Lucene will give partial matching in multiple fields higher
score than better matching in a single field. Take the following as an
example,

		Product1
		Name: "Comfort Inn Shampoo"
		Manufacture Model Number (MMNUM): "XXXX"
		Supplier Model Number (SMNUM): "YYYY"

		Product2
		Name: "Inn xxxx yyyy"
		Manufacture Model Number (MMNUM): "Inn aaaa bbbb"
		Supplier Model Number (SMNUM): "Inn cccc dddd"

If we enter the search term "comfort inn shampoo" to search against all
three fields "Name", "Manufacture Model Number" and "Supplier Model Number",
Product2 will come back on top of Product1 because "Inn" is partially
matched in 3 fields in Product2, even though Name is a perfect match in
Product1. What we really want is to some how give Product1 higher score than
Product2.

The query issued is like the following (The queries are generated
programmatically and the booster is put by calling "setBoost" on the Query
object)

query = (NAME:inn NAME:comfort NAME:shampoo) (MMNUM:inn MMNUM:shampoo
MMNUM:comfort) (SMNUM:shampoo SMNUM:comfort SMNUM:inn)

Even if we boost the Name by 10 like the following query, It's still the
same. 

query = (NAME:inn NAME:comfort NAME:shampoo)^10 (MMNUM:inn MMNUM:shampoo
MMNUM:comfort) (SMNUM:shampoo SMNUM:comfort SMNUM:inn)

Is there any thing we can do to make better matching in a single fields earn
higher score than partial matching in several fields?

Any help would be greatly appreciated.

Ching-pei


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


Mime
View raw message