Skip to main content

Posts

Showing posts from June, 2013

Implementing GeoSpatial Search Using Lucene 4.X

In this blog post, i am going to explain how to implement GeoSpatial Search using Lucene 4.x. Problem I am trying to Implement : Finding Nearest Places Within Certain Radius Given the Location of User. Sample Input Places Data : id  name             latitude   longitude 1   Bangalore        12.9558    77.620979         2   Cubbon Park      12.974045  77.591995               3   Tipu Palace      12.959365  77.573792         4   Bangalore Palace 12.998095  77.592041         5   Monkey Bar       12.97018   77.61219         6   Cafe Cofee Day   12.992189  80.2348618 Code : import java.io.File; import java.io.IOException; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.IntField; import org.apache.lucene.document.Sto