Hi, Thanks for your suggestions that worked perfectly.
But unfortunately our current application is still using JDK 1.7 and it would take a while to move to JDK 1.8. So I started using older version of Lucene 5.5.4 which supports 1.7, but its not working smoothly. I must be doing something wrong while writing index. I am using the example from here https://github.com/apache/lucene-solr/blob/branch_5x/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java Indexing: Document doc = new Document(); doc.add(new StoredField("id", id)); Point pt = ctx.makePoint(longitude, latitude); for (IndexableField f : strategy.createIndexableFields(pt)) { doc.add(f); } doc.add(new StoredField(strategy.getFieldName(), pt.getX() + " " + pt.getY())); return doc; Searching: Point p = ctx.makePoint(lng, lat); Circle c = ctx.makeCircle(lng, lat, deg); SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, c); Query query = strategy.makeQuery(args); ValueSource valueSource = strategy.makeDistanceValueSource(p); Sort distSort = new Sort(valueSource.getSortField(false)).rewrite(searcher); int limit = 10; TopDocs topDocs = searcher.search(query, limit, distSort); When running on loading index, its throwing OutOfMemory Exception. I increased the memory to 4G and its failed. Any Suggestions, Thanks Much. -- View this message in context: http://lucene.472066.n3.nabble.com/Lucene-GeoNear-Search-and-Sort-Performance-tp4343468p4346178.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org