SimpleSearch offers a one-step solution for geo-data 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 includes a label and a geometry attribute for each entry.
Geometry data can be encoded as WKT or in GeoJSON format.
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
query_ws_replace: # Pattern for replacing white spaces.
query_format: '%s' # Simple search format.
token_regex: [^a-zA-Z0-9äöüÄÖÜß] # Tokenizer split regexp.
token_regex_in: ([a-zA-ZäöüÄÖÜß]{3,}) # Tokenizer search regexp.
token_regex_out: '$1*' # Tokenizer replace regexp.
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.
result_buffer: 50 # buffer result geometry with this (map units) before zooming
result_minscale: 1000 # scale restrictions for zooming, ~ for none
result_maxscale: 5000
result_icon_url: http://demo.mapbender3.org/bundles/mapbendercore/image/pin_red.png # icon to display as result marker
result_icon_offset: -6,-38 # Offset x and y for the icon
None.
None.
Download Apache Solr and extract it to any folder. After successfully extracting the file Solr can be installed as a service in a Linux system by calling solr/bin/install_solr_service.sh.
Installing Apache Solr via the terminal f.e. in the data directory:
cd /data
wget http://apache.lauf-forum.at/lucene/solr/5.4.1/solr-5.4.1.tgz
tar -zxvf solr-5.4.1.tgz
cd solr-5.4.1/
Apache Solr runs of Java 7 or greater, Java 8 is verified to be compatible and may bring some performance improvements. When using Oracle Java 7 or OpenJDK 7, be sure to not use the GA build 147 or update versions u40, u45 and u51! We recommend using u55 or later.
You can start and stop Solr via the terminal by the following commands:
Start Solr:
/data/solr-5.4.1/bin/solr start -s /data/solr-5.4.1/server/solr
Stop Solr:
/data/solr-5.4.1/bin/solr stop -all
The Solr home folder is the area in which the various Solr-Cores for the search are located.
Der Solr-Home Ordner ist der Bereich, in dem sich die verschiedenen Solr-Kerne für die Suche befinden. The configuration is performed in the following file:
File: solr-5.4.1/server/solr/solr.xml
Enter the following XML-block in the file:
<?xml version="1.0" encoding="UTF-8" ?>
<solr></solr>
For the cores create a folder under data/solr_data. Each core consists of the three configuration files:
By core.properties the core of Solr is recognized as a core. The solrconfig.xml describes the features of the core. The schema.xml describes the construction of the index.
Adaptation of configuration files under /data/solr-5.4.1/server/solr/configsets/basic_configs/conf:
The directiory /solr-5.4.1/example contains Solr examples. Each example is contained in a separate directory. To run a specific example, do:
bin/solr -e <EXAMPLE> where <EXAMPLE> is one of:
cloud : SolrCloud example
dih : Data Import Handler (rdbms, mail, rss, tika)
schemaless : Schema-less example (schema is inferred from data during indexing)
techproducts : Kitchen sink example providing comprehensive examples of Solr features
To test this function run the following command in the terminal:
/data/solr-5.4.1/bin/solr start -e techproducts
and go to http://localhost:8983/solr.
/data/solr-5.4.1/server/solr:
/data/solr-5.4.1/server/solr/configsets:
Use the example data in /solr-5.4.1./example/exampledocs/*.xml to index the example Solr XML files.
Import records from a PostgreSQL-database using the Data Import Handler.
Adaptation of the Data Connection in the configutation files under data/solr_data/places/config:
cd /data/solr_data/places/
wget https://jdbc.postgresql.org/download/postgresql-9.1-903.jdbc4.jar
The Solr-scheme consists of the following parts:
Release of certain IP addresses to access the Jetti. Configuration under solr/etc/jetty.xml:
<Set name="host"><SystemProperty name="jetty.host" /></Set>
<Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>