Git Product home page Git Product logo

elasticsearch-scripts's Introduction

Readme

Installation

You will need Python 3 (recommended version : 3.7) and a computer under Windows.

To install the libraries, just cd in elasticsearch-scripts/ and launch configure.bat

Backup.py

The script backup.py is useful in order to create backups of the whole database, under folders named backup-date-time/INDEX_NAME.

No arguments are required to start this script.

Importing/Exporting data from/to Elasticsearch

The command is : py -m elasticsearch-scripts MODE ARGUMENTS

MODE is either import or export

ARGUMENTS changes regarding the MODE

Documentation of each mode below.

Importing

C:\Users\plateau\Desktop\stuff\git>py -m elasticsearch-scripts export --help
usage: py -m elasticsearch-scripts export [-h] [--batch-size BATCH_SIZE]
                                          [--directory DIRECTORY]
                                          [--filename FILENAME] [-q]
                                          [--index INDEX | --dump-indexes]
                                          [-v]

optional arguments:
  -h, --help            show this help message and exit
  --batch-size BATCH_SIZE
                        Number of documents per files
  --directory DIRECTORY
                        Folder where the indexes will be saved. Default value
                        is current directory
  --filename FILENAME   Filename for the indexes. Default value is 'index'
  -q, --quiet           Silently answers 'yes' to any question
  --index INDEX         Index to export
  --dump-indexes        Dump all the indexes available
  -v, --verbosity       Enable verbose logging

Examples

> py -m elasticsearch-scripts export --batch-size 400 --directory bunch_of_folders/created/automatically --filename a_nice_filename --index zbibale --quiet
> py -m elasticsearch-scripts export --index zbibale --verbosity
> py -m elasticsearch-scripts export --dump-indexes

Exporting

C:\Users\plateau\Desktop\stuff\git>py -m elasticsearch-scripts import --help
usage: py -m elasticsearch-scripts import [-h] [--directory DIRECTORY] [-q]
                                          [-v]
                                          filename index

positional arguments:
  filename              Specify the pattern of filename
  index                 Which index should be created based on the given files

optional arguments:
  -h, --help            show this help message and exit
  --directory DIRECTORY
                        Folder where the indexes will be saved. Default value
                        is current directory
  -q, --quiet           Silently answers 'yes' to any question
  -v, --verbosity       Enable verbose logging

Examples

> py -m elasticsearch-scripts import --verbosity --directory test\first\second zbibale test_index
> py -m elasticsearch-scripts import zbibale test_index

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.