I can tell JtsGeoStrategy's filter is so slow just by looking at it. It's testing all indexed documents and returning a bitset. Talk about brute-force! Instead, it should return a DocIdSet that returns a Bits that in turn will test the given document to see if it matches. If that isn't work, then a superior approach is one that returns a DocIdSetIterator that implements advance(). In this way, the expensive logic will only occur for documents that match other aspects of the query (e.g. keyword, other filter queries). In Solr, this would be used as a post-filter with a cost >= 100.
I can tell JtsGeoStrategy's filter is so slow just by looking at it. It's testing all indexed documents and returning a bitset. Talk about brute-force! Instead, it should return a DocIdSet that returns a Bits that in turn will test the given document to see if it matches. If that isn't work, then a superior approach is one that returns a DocIdSetIterator that implements advance(). In this way, the expensive logic will only occur for documents that match other aspects of the query (e.g. keyword, other filter queries). In Solr, this would be used as a post-filter with a cost >= 100.