Created
October 20, 2016 14:33
-
-
Save janakact/ee59fbe83b2b4403f6129e235ae427ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searcher = new IndexSearcher(DirectoryReader.open(writer)); | |
// DPoints within 30 km from colombo city | |
TopDocs docs = searcher.search(LatLonPoint.newDistanceQuery(LOCATION_TAG, COLOMBO_LAT,COLOMBO_LON, 30000), 5); | |
System.out.println("Within 30km"); | |
printRecords(docs); | |
// DPoints within 20 km from colombo city | |
docs = searcher.search(LatLonPoint.newDistanceQuery(LOCATION_TAG, COLOMBO_LAT,COLOMBO_LON, 20000), 5); | |
System.out.println("\nWithin 20km"); | |
printRecords(docs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment