Skip to content
Nicolas Colomer edited this page May 23, 2013 · 6 revisions

1. Prerequisites

This plugin is built using elasticsearch 0.90.x and Osmosis 0.43 frameworks. It is not guaranteed to work with older version.

2. Plugin usage

To enable the plugin, append the following to your Osmosis command:

--write-elasticsearch (--wes)

Available options are:

Name Type Default value Description
cluster.hosts String localhost Comma-separated list of nodes to join (one is enough as the cluster will be discovered automatically). Valid syntax for a single node is host1 or host2:port
cluster.name String elasticsearch Name of the elasticsearch cluster to join
index.name String osm Name of the index that will be filled with data
index.create Boolean true (Re)create the main index (delete if exists!) and its mapping prior inserting data
index.settings.shards Integer 5 Set the number_of_shards elasticsearch setting of the entity index
index.settings.replicas Integer 1 Set the number_of_replicas elasticsearch setting of the entity index
index.mapping.node String (JSON) [see here] The mappings used to create the node entity indice
index.mapping.way String (JSON) [see here] The mappings used to create the way entity indice
index.bulk.size Integer 5000 The size of the entities batch sent to elasticsearch while creating the entity index
index.builders String [empty] Comma-separated list of specialized index builder id (see below)
config.queue.size Integer 100 Size of the buffer queue between reader thread and worker threads
config.node.bulk.size Integer 5000 Size of the node bulk sent to elasticsearch for indexing
config.way.bulk.size Integer 500 Size of the way bulk sent to elasticsearch for indexing
config.worker.pool.size Integer 5 Size of the worker pool
properties.file String [empty] The absolute path of a properties file containing a (sub)set of valid parameters

The default plugin configuration can be overridden through command-line parameters above and/or by providing a properties file (see the properties.file parameter).

3. Examples

Connect to cluster elasticsearch using default configuration:

osmosis \
	--read-pbf ~/osm/extract/guyane-latest.osm.pbf \
	--write-elasticsearch

Connect to cluster named openstreetmap via Node 10.0.0.1:9310 and (re)create index osm prior to insert data:

osmosis \
	--read-pbf ~/osm/extract/guyane-latest.osm.pbf \
	--wes hosts="10.0.0.1:9310" clustername="openstreetmap" createIndex="true"

4. Specialized index builders

Specialized indexes are custom and optimized representations of OpenStreetMap data. They allow you to execute queries that were not possible (or too complicated) using the main index - the one that contains raw OpenStreetMap entities.

Each built specialized index is accessible via its compound name {indexName}-{indexBuilderId}.

Available builders are:

Id Description
None yet