Attached is the first draft.
The Solr support for the new Lucene spatial module is a set of field types which are effectively adapters into the real logic in Lucene. Even all the configuration option initialization from the fieldType attributes are done in Lucene. A map of these is passed with a utility wrapper to detect which attributes were seen so that they can be removed afterwards. And so if you typo a parameter then you'll get an error like you would for any other field type.
The Lucene spatial module supports sorting indirectly by having a spatial Query's score be the distance. Of course you don't always need the score/distance and so there is a local-param attribute needScore which can be set to false, such as in a filter query (see
I'll say the tests here are so-so; I welcome input on how they can be structured to be more effective. Since the real logic is all in the Lucene spatial module, ideally the tests on the Solr side would be fairly minimal in this regard... just instantiate the various field types exercising a few features and a few options.
- Document how to use it in the wiki
- At least some basic tests for the SpatialTwoDoublesFieldType and SpatialTermQueryPrefixTreeFieldtype.
At least for now, I don't envision the capabilities here replacing the Solr spatial introduced in 3x; it is a new alternative.