lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc <>
Subject Re: Lucene GeoNear Search and Sort Performance
Date Fri, 14 Jul 2017 22:19:46 GMT

 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 =, 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:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message