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


                Document doc = new Document();
doc.add(new StoredField("id", id));

Point pt = ctx.makePoint(longitude, latitude);
for (IndexableField f : strategy.createIndexableFields(pt)) {

doc.add(new StoredField(strategy.getFieldName(), pt.getX() + " " +

return doc;
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

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.

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB