A geocodr configuration for Mecklenburg-Vorpommern
scripts/geocodr-pg2csv.sh: script to dump PostgreSQL tables as CSV for import withgeocodr-postscripts/geocodr-reindex.sh: script to callgeocodr-pg2csv.shand to import the data withgeocodr-postconf/geocodr_mapping.py: geocodr mapping with multiple customized classes and collectionsserver/INSTALL.rst: installation documentation for a two server setup based on SLES 15server/: configuration and installation filessolr/: Apache Solr configuration and schemas for all collections forgeocodr-zktests/: acceptance tests for this geocodr configuration
The following steps are required to add a new collection. We use the collection sport for gyms, swimming pools, pitches etc. as an example:
- Edit
geocodr-pg2csv.shto create a newsport.csv. Create aSELECTthat queries all data you want to import into that collection. You can useUNIONto query from multiple tables. Complex joins are also possible. Make sure the selected columns have the same name as thefieldin your Apache Solr schema (useASif that is not the case). - Create a
sport-schema.xmlfile. Add a field for each property that should be indexed. Create an additional_ngramfield for fuzzy search and make sure this field is filled as well (copyField). Seeaddress-schema.xmlfor a documented Apache Solr schema with special field types for street names, etc. - Upload schema:
geocodr-zk --zk-hosts localhost:9983 --config-dir solr/ --push sport - Create CSV dump:
CSV_OUTDIR=/tmp/csv-files CSV_INDIR=/tmp/csv-files PGDATABASE=geocodr PGUSER=geocodr scripts/geocodr-pg2csv.sh - Index data:
geocodr-post --url http://localhost:8983/solr --csv /tmp/csv-files/sport.csv --collection sport - Add
sporttogeocodr-reindex.shfor automatic updates. - Create a
Sportclass for your collection inconf/geocodr-mapping.py. - Reload Geocodr