Git Product home page Git Product logo

schema's Introduction

Installation

$ npm install pelias-schema

NPM

Usage

create index

node scripts/create_index.js;               # quick start

drop index

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

reset a single type

This is useful when you want to reset a single type without wiping the rest of your index.

node scripts/reset_type.js mytype;          # reset a single type

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 whole schema file or a single mapping to stdout.

node scripts/output_mapping.js mytype;          # single type mapping
node scripts/output_mapping.js;                 # whole schema file

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;

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 --name elastic-test -p 9200:9200 elasticsearch:2

Once the service has started you will need to ensure the plugins are installed, in a new window:

$ node scripts/check_plugins.js

--------------------------------
 checking elasticsearch plugins
--------------------------------

node 'Nebulon' [x5sGjG6lSc2lWMf_hd6NwA]
 checking plugin 'analysis-icu': โœ–

1 required plugin(s) are not installed on the node(s) shown above.
you must install the plugins before continuing with the installation.

you can install the missing packages on 'Nebulon' [172.17.0.2] with the following command(s):

 sudo /usr/share/elasticsearch/bin/plugin install analysis-icu

note: some plugins may require you to restart elasticsearch.

While the docker container is still running, execute this in another window:

$ docker exec -it elastic-test /usr/share/elasticsearch/bin/plugin install analysis-icu
-> Installing analysis-icu...
Trying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/analysis-icu/2.4.5/analysis-icu-2.4.5.zip ...
Downloading .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE
Verifying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/analysis-icu/2.4.5/analysis-icu-2.4.5.zip checksums if available ...
Downloading .DONE
Installed analysis-icu into /usr/share/elasticsearch/plugins/analysis-icu

The plugin has been installed, you will now need to restart the elasticsearch service:

# use ctrl+c to exit and then:

$ docker start elastic-test

The restarted server should now pass the node scripts/check_plugins.js check, you are good to go.

Continuous Integration

Travis tests every release against Node.js versions 4and6`.

Build Status

schema's People

Contributors

avulfson17 avatar bradh avatar dianashk avatar fdansv avatar greenkeeperio-bot avatar heffergm avatar hkrishna avatar missinglink avatar orangejulius avatar sevko avatar tigerlily-he avatar trescube avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.