Background: i need to implement a document indexing and search for POIs(point of interest) under LBS scene. A POI has name, address, and location(LatLonPoint), and i want to combine a text query with a geo-spatial 2d range filter.
The problem is, when i first build a native in-memory index which use a simple BitSet as DocIDSet type and STRTree class from the famous JTS lib, i get 20ms/1000qps perf metrics with 1w8 POIs on my laptop(Windows 7 x64, use mmap codec). But when i use Lucene-8.3 to implement the same functionality(which use LatLonPoint.newDistanceQuery which seems use the default BKD tree index), i only get 150ms/130qps which is a very bad degrade? So my idea is, can i do a custom filter query, which builds a fully in-memory R-tree index to boost the spatial2d range filter performance? I need to access Lucene's internal DocIDSet class so i can do a fast merge with no scoring needed. Hope this will improve the query performance. Any suggestions?