You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Am...@Freightliner.com on 2004/10/02 02:06:14 UTC

Question regarding using Lucene or not

Hello
I have a stand-alone java application. We have a new requirement where there
will be around 1000 data files in XML format. Each of them have the same
format. Nodes will have value and attributes. In the application, the user
will search for a particular spec (the data file) by defining parameters.
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. 
Do you think Lucene can meet this requirement or do I need to look into any
other product ?

Please let me know.

Thanks.




Re: Question regarding using Lucene or not

Posted by Daniel Naber <da...@t-online.de>.
On Saturday 02 October 2004 02:06, AmitShukla@Freightliner.com 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 
this:

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

Regards
 Daniel

-- 
http://www.danielnaber.de

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