lucene-lucene-net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush" <>
Subject RE: Numeric Comparison
Date Wed, 28 Mar 2007 03:06:34 GMT
In addition (I'm presuming you want to this numeric data so you can do range
searching) be careful as you will hit the infamous, but rightfully designed,
TooManyClauses exception.

1a6af9f37aa831 for details on how to address it.

-- George Aroush

-----Original Message-----
From: Kainth, Sachin [] 
Sent: Friday, March 23, 2007 6:22 AM
Subject: RE: Numeric Comparison

We've implemented numerical comparison here by using Lucene's string
comparison facility as there does not seem to be any way that numbers can be
compared in Lucene.  However, you need to store the numbers in a specific
way.  In essence what we have done is store all numbers in left zero padded
form.  So for instance if we have two numbers 477 and 34345 in the index
then we would store them as:


Then we would compare them against other values thus:

Fieldname:{00000000100 TO 00000000500}

The first of the two numbers in the index would pass the test but the second
will not.  It's a work around but it does the trick.  There is also a way we
have devised to support negative numbers as well but I can tell you that if
you need it.


-----Original Message-----
From: rzr rzr []
Sent: 22 March 2007 17:36
Subject: Numeric Comparison


I've got a couple of questions. I'm posting them in two seperate mails to
keep the subject headers relevant.

Relatively large databases that contain many records.
Each database consists of a large file which may contain as much as 2M
Each record consists of several fields, though exaclty what fields and how
many of them may vary.
The records are seperated by a NewLine/Cr/CrLf combination.

 The database contains GPS ranges. These ranges describe a small,
rectengular slice of the earth. The numeric ranges are in a fixed field.

Using lucene .net, would it be possible to do a numeric comparison to test
whether a %QueryValue% is smaller than, equal to or larger than the value in
a all/any indexed GPS fields?

This message has been scanned for viruses by MailControl - (see

This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.
Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley
Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really
need to. 

View raw message