On Monday 04 October 2004 22:22, you wrote:

> 1. How difficult it is to implement our own Similarity class that can do
> the things we want ?

It should be very easy. The API is described here: 
http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/Similarity.html
I think in your case all methods (except one) that return a float can just 
return 1.0f. The one that doesn't return 1 then returns a value that 
represents the difference to the "perfect" value (well, more like 
1/difference).

> 2. If there are more than one field that are percentage match like HP,
> can we also specify which field gets the preference while search.

If you implement the method mentioned above so that it always ranks some 
field higher than another, that should be possible.

But it you've only got 1000 documents (and that number won't increase) you 
could also just search for HP:cargo, put all matches in your own "Match" 
objects and then sort these via your own implementation of Java's 
compareTo().

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to