SimpleSearch

SimpleSearch offers a one-step solution for geodata querying, powered by Solr for example. Giving only one input field which can be directly embedded into the toolbar, it will send the entered search term to a configurable URL where it expects to receive a JSON-formatted data back which inclucdes a label and a geometry attribute for each entry.

Geometry data can be encoded as WKT or in GeoJSON format.

Configuration

../../../../../_images/simplesearch_configuration1.png

YAML-Definition:

query_url: http://example.com/solr/core/0/select?wt=json&indent=true&rows=8   # Example Solr URL
query_key: q                                                                  # The query parameter key to append
collection_path: response.docs                                                # Can be a dotted attribute path to extract from the query result.
label_attribute: label                                                        # Name of the attribute to use for entry labeling
geom_attribute: geom                                                          # Name of the geometry data attribute
geom_format: WKT                                                              # geometry data format, can be WKT or GeoJSON
delay: 300                                                                    # Autocomplete delay. Use 0 to disable autocomplete.

Class, Widget & Style

  • Class: Mapbender\PrintBundle\Element\SimpleSearch
  • Widget: mapbender.element.simplesearch.js

HTTP Callbacks

  • /search: Widget proxy which then queries configured URL. In dev mode the final query URL will be returned as a x-mapbender-simplesearch-url header for easier debugging.

JavaScript API

None.

JavaScript Signals

None.

Table Of Contents

Previous topic

Search Router

Next topic

Sketch

This Page