Correctly indexing latitude and longitude values in Lucene
Am working on a "US based nearest city search within a given radius" functionality using Lucene API. Am indexing city's lat and long values in Lucene as follows: doc.Add(new Field("latitude", paddedLatitude, Field.Store.YES, Field.Index.UN_TOKENIZED)); doc.Add(new Field("longitude", paddedLongitude, Field.Store.YES, Field.Index.UN_TOKENIZED)); Since Lucene only understands strings and not numbers, am padding lat and long values. For example, if original lat and long are 41.811846 and -87.820628 respectively, after padding,values look like: paddedLatitude -->"0041.811846" and paddedLongitude-->