Skip to content

Allow configuration of Solr spatial_field name for spatial queries #350

@minhajuddin2510

Description

@minhajuddin2510

Problem

Currently, the Solr spatial field name is hardcoded as spatial_geom when building queries with the ckanext.spatial.solr_query config in ckanext-spatial. This makes it impossible to use a different field name in the Solr schema without directly modifying the extension code, restricting schema flexibility for deployments with custom Solr setups.

Proposal

  • Introduce a configuration option (like ckanext.spatial.spatial_field_name) to allow users to specify the Solr spatial field name to use for spatial queries.
  • The value should default to spatial_geom to preserve current behavior.
  • Use this dynamic field name both when formatting the Solr query string and when indexing datasets (where applicable).

Example

ckanext.spatial.spatial_field_name = my_custom_geom_field

Query string example:

ckanext.spatial.solr_query = {{!field f={spatial_field}}}Intersects(ENVELOPE({minx}, {maxx}, {maxy}, {miny}))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions