Skip to content

Commit

Permalink
Allow necessary query parsers when using Solr backends
Browse files Browse the repository at this point in the history
This is needed after ckan/ckan#8053
  • Loading branch information
amercader committed Jun 26, 2024
1 parent e810277 commit 20b6828
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ckanext/spatial/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,18 @@ def _get_search_backend(self):

def update_config(self, config):

self._get_search_backend()
search_backend = self._get_search_backend()

qp = None
if tk.check_ckan_version(min_version="2.11.0a0"):
if search_backend == "solr-bbox":
qp = "frange"
elif search_backend == "solr-field":
qp = "field"
if qp:
if not config.get("ckan.search.solr_allowed_query_parsers"):
config["ckan.search.solr_allowed_query_parsers"] = []
config["ckan.search.solr_allowed_query_parsers"].append(qp)

# IPackageController

Expand Down

0 comments on commit 20b6828

Please sign in to comment.