To make the distance filter faster you should use LatLonPoint.

And, if you really just need the N nearest points, you could try
LatLonPoint.nearest(...) ... that might be faster than filtering + sorting
separately.

Mike McCandless

http://blog.mikemccandless.com

On Thu, Jun 29, 2017 at 12:06 PM, sc <scattaman...@4info.com> wrote:

> Hi,
>
>    I have similar requirement of searching points within a radius of 50m.
> Loaded 100M latlon, indexed/searching with LatLonDocValuesField. Currently,
> I am testing it on my macbook pro.
>
> I have tested with all Directory(RAM/FS/MMap) types, but it takes  > 3-4
> secs to do search/sort to return of 5 points with in radius of 50m.
>
> I am looking to reduce search/sort time < 10ms. I have allocated 4g of RAM
> for the java process which is more than sufficient.
>
> Code: Indexing
>
>                 doc.add(new LatLonDocValuesField("loc", latitude,
> longitude));
>
>
>
> Searching:
>                 searcher = new IndexSearcher(indexReader);
>                 Sort sortField = new
> Sort(LatLonDocValuesField.newDistanceSort("loc", minLat, minLng));
>                 Query latlonQuery =
> LatLonDocValuesField.newDistanceQuery("loc", minLat, minLng, 50);
>
>                 TopDocs docs = searcher.search(latlonQuery, 5, sortField);
>
>
> Any suggestions greatly appreciated.
>
> Thanks,
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Lucene-GeoNear-Search-and-Sort-Performance-tp4343468.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
>
>

Reply via email to