7.0.0 • Published 2 months ago

pelias-schema v7.0.0

Weekly downloads
12
License
MIT
Repository
github
Last release
2 months ago

Pelias Elasticsearch Schema Definition

This package defines the Elasticsearch schema used by Pelias. Pelias requires quite a few settings for performance and accuracy. This repository contains those settings as well as useful tools to ensure they are applied correctly.

Requirements

See Pelias Software requirements for general Pelias requirements.

Installation

$ npm install pelias-schema

Usage

create index

./bin/create_index                          # quick start

drop index

node scripts/drop_index.js                 # drop everything
node scripts/drop_index.js --force-yes     # skip warning prompt

update settings on an existing index

This is useful when you want to add a new analyser or filter to an existing index.

note: it is impossible to change the number_of_shards for an existing index, this will require a full re-index.

node scripts/update_settings.js          # update index settings

output schema file

Use this script to pretty-print the schema's mappings to stdout.

node scripts/output_mapping.js

check all mandatory elasticsearch plugins are correctly installed

Print a list of which plugins are installed and how to install any that are missing.

node scripts/check_plugins.js

Configuration

Settings from pelias.json

Like the rest of Pelias, the Pelias schema can be configured through a pelias.json file read by pelias-config.

schema.indexName

This allows configuring the name of the index created in Elasticsearch. The default is pelias.

Note: All Pelias importers also use this configuration value to determine what index to write to. Additionally, the Pelias API uses the related api.indexName parameter to determine where to read from.

user customizable synonyms files

You may provide your own custom synonyms by editing files in the ./synonyms/ directory.

$ ls -1 synonyms/custom_*
synonyms/custom_admin.txt
synonyms/custom_name.txt
synonyms/custom_street.txt

You must edit the files before running create_index.js, any changes made to the files will require you to drop and recreate the index before those synonyms are available.

Synonyms are only used at index-time. The filename contains the name of the elasticsearch field which the synonyms will apply. ie. custom_name will apply to the name.* fields, custom_street will apply to the address_parts.name field and custom_admin will apply to the parent.* fields.

see: https://github.com/pelias/schema/pull/273 for more info.

With great power comes great responsibility. Synonyms files are often used as a hammer when a scalpel is required. Please take care with their use and make maintainers aware that you are using custom synonyms when you open support tickets.

NPM Module

The pelias-schema npm module can be found here:

https://npmjs.org/package/pelias-schema

You can pull down a versioned copy of the pelias schema from npm:

var schema = require('pelias-schema');

console.log( JSON.stringify( schema, null, 2 ) );

Contributing

Please fork and pull request against upstream master on a feature branch.

Pretty please; provide unit tests and script fixtures in the test directory.

Running Unit Tests

$ npm test

Running Integration Tests

Requires a running elasticsearch server (no other setup required)

$ npm run integration

Running elasticsearch in Docker (for testing purposes)

Download the image and start an elasticsearch docker container:

$ docker run --rm --name elastic-test -p 9200:9200 pelias/elasticsearch:7.5.1

Continuous Integration

CI tests every release against all supported Node.js versions.

7.0.0

2 months ago

6.8.0

2 months ago

6.7.0

5 months ago

6.5.0

10 months ago

6.6.0

10 months ago

6.4.1

2 years ago

6.4.0

3 years ago

6.3.1

3 years ago

6.3.0

3 years ago

6.2.0

4 years ago

6.1.1

4 years ago

6.1.0

4 years ago

6.0.0

4 years ago

5.6.1

4 years ago

5.6.0

4 years ago

5.5.1

4 years ago

5.5.0

4 years ago

5.4.1

4 years ago

5.4.0

4 years ago

5.3.0

4 years ago

5.2.0

4 years ago

5.1.0

4 years ago

5.0.0

4 years ago

4.0.0

4 years ago

3.40.0

4 years ago

3.39.0

4 years ago

3.38.1

4 years ago

3.38.0

4 years ago

3.37.0

4 years ago

3.36.0

4 years ago

3.35.0

4 years ago

3.34.2

4 years ago

3.34.1

4 years ago

3.34.0

4 years ago

3.33.0

4 years ago

3.32.1

4 years ago

3.32.0

5 years ago

3.31.0

5 years ago

3.30.0

5 years ago

3.29.1

5 years ago

3.29.0

5 years ago

3.28.1

5 years ago

3.28.0

5 years ago

3.27.0

5 years ago

3.26.0

5 years ago

3.25.0

5 years ago

3.24.0

5 years ago

3.23.2

5 years ago

3.23.1

5 years ago

3.23.0

5 years ago

3.22.0

5 years ago

3.21.0

5 years ago

3.20.1

5 years ago

3.20.0

5 years ago

3.19.0

5 years ago

3.18.0

5 years ago

3.17.0

5 years ago

3.16.3

5 years ago

3.16.2

5 years ago

3.16.1

6 years ago

3.16.0

6 years ago

3.15.0

6 years ago

3.14.0

6 years ago

3.13.0

6 years ago

3.12.0

6 years ago

3.11.4

6 years ago

3.11.3

6 years ago

3.11.2

6 years ago

3.11.1

6 years ago

3.11.0

6 years ago

3.10.0

6 years ago

3.9.6

7 years ago

3.9.5

7 years ago

3.9.4

7 years ago

3.9.3

7 years ago

3.9.2

7 years ago

3.9.1

7 years ago

3.9.0

7 years ago

3.8.0

7 years ago

3.7.0

7 years ago

3.6.0

7 years ago

3.5.0

8 years ago

3.4.0

8 years ago

3.3.0

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.0.0

9 years ago

1.0.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago