lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <>
Subject Re: Question regarding using Lucene or not
Date Sat, 02 Oct 2004 13:36:59 GMT
On Saturday 02 October 2004 02:06, wrote:

> The parameters are both string and numeric. For example, the model
> should be Cargo and its HP value should be 55,000 or near it . If we
> specify tolerance value of 5000 then it should search for all the data
> files where model node is Cargo (definitive match) and HP value is
> between 50,000 to 60,000 with the one having 55,000 coming as the 100%
> match.

That's possible with Lucene, you'll need to parse the XML files and put the 
required data into the Lucene index. Then you can search with a query like 

+model:cargo^0 +hp:[50000 TO 60000] hp:55000^10

This will match all document which contain "cargo" in the model field and a 
value of 50000 to 60000 in the hp field. Matches with hp 55000 will be 
boosted so they appear on top. However, matches 50000 to 54999 and 50001 
to 60000 will have the same ranking. To change that you will need to 
implement your own variation of Lucene's Similarity class.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message