CKAN pull request https://github.com/ckan/ckan/pull/8053 introduces a new configuration option ckan.search.solr_allowed_query_parsers which allows to specify whitelisted local parameters. If the search parameters are not included, this will cause some problems in ckanext-spatial like {!frange}:
Updated the doc to add params to the ckan.search.solr_allowed_query_parsers list in the ckan.ini configuration file when setting up spatial search.
Setup
-----
To enable the spatial search you need to add the ``spatial_query`` plugin to
your ini file. This plugin in turn requires the ``spatial_metadata`` plugin, eg::
ckan.plugins = ... spatial_metadata spatial_query
To define which backend to use for the spatial search use the following
configuration option (see `Choosing a backend for the spatial search`_)::
ckanext.spatial.search_backend = solr-bbox
For CKAN >2.10.4 and >2.9.11 to avoid errors in the spatial search, use the following configuration elements. For `solr-bbox` use `frange`, for `solr-spatial-field` use `field`::
ckan.search.solr_allowed_query_parsers = ... frange | field
Environment
ckan-docker
)ckan-solr
with spatial config forsolr-bbox
andsolr-spatial-field
backends.ckanext-spatial
Problem:
solr-bbox
andsolr-bbox
using the{!frange}
local parameter.ckan-2.9.11
due to security restrictions disallowing local parameters.solr-bbox log:
solr-spatial-field log:
Reference the solution:
CKAN pull request https://github.com/ckan/ckan/pull/8053 introduces a new configuration option
ckan.search.solr_allowed_query_parsers
which allows to specify whitelisted local parameters. If the search parameters are not included, this will cause some problems inckanext-spatial
like{!frange}
:https://github.com/ckan/ckanext-spatial/blob/938308469892e4bcf7389cb4adee5ccdd5a0ccca/ckanext/spatial/search/__init__.py#L123-L124
or
{!field}
:https://github.com/ckan/ckanext-spatial/blob/938308469892e4bcf7389cb4adee5ccdd5a0ccca/ckanext/spatial/search/__init__.py#L202-L211
Proposed fix:
Updated the doc to add params to the
ckan.search.solr_allowed_query_parsers
list in theckan.ini
configuration file when setting up spatial search.