Correctly indexing latitude and longitude values in Lucene

后端 未结 2 612
名媛妹妹
名媛妹妹 2021-02-10 05:26

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:

<         


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-10 06:03

    Here's the bleeding edge about Searching Numerical Fields in Lucene by Uwe Schindler, the expert on the subject. You may need to use the older (and slower) ConstantScoreRangeQuery because Lucene.net is a bit behind Lucene, and the class NumericRangeQuery described in the link was not yet released in Java Lucene.

提交回复
热议问题