Coder Social home page Coder Social logo

elasticsearch-dump / elasticsearch-dump Goto Github PK

View Code? Open in Web Editor NEW
7.4K 7.4K 831.0 2.37 MB

Import and export tools for elasticsearch & opensearch

License: Apache License 2.0

JavaScript 99.53% Dockerfile 0.39% Shell 0.08%
backup docker elasticdump elasticsearch export import javascript opensearch

elasticsearch-dump's Introduction

elasticdump

Tools for moving and saving indices from Elasticsearch and OpenSearch

picture


Build Status npm version NPM Weekly stats NPM Monthly stats DockerHub Badge DockerHub Badge

Version Warnings!

  • Version 1.0.0 of Elasticdump changes the format of the files created by the dump. Files created with version 0.x.x of this tool are likely not to work with versions going forward. To learn more about the breaking changes, vist the release notes for version 1.0.0. If you recive an "out of memory" error, this is probably or most likely the cause.
  • Version 2.0.0 of Elasticdump removes the bulk options. These options were buggy, and differ between versions of Elasticsearch. If you need to export multiple indexes, look for the multielasticdump section of the tool.
  • Version 2.1.0 of Elasticdump moves from using scan/scroll (ES 1.x) to just scroll (ES 2.x). This is a backwards-compatible change within Elasticsearch, but performance may suffer on Elasticsearch versions prior to 2.x.
  • Version 3.0.0 of Elasticdump has the default queries updated to only work for ElasticSearch version 5+. The tool may be compatible with earlier versions of Elasticsearch, but our version detection method may not work for all ES cluster topologies
  • Version 5.0.0 of Elasticdump contains a breaking change for the s3 transport. s3Bucket and s3RecordKey params are no longer supported please use s3urls instead
  • Version 6.1.0 and higher of Elasticdump contains a change to the upload/dump process. This change allows for overlapping promise processing. The benefit of which is improved performance due increased parallel processing, but a side-effect exists where-by records (data-set) aren't processed in a sequential order (the ordering is no longer guaranteed)
  • Version 6.67.0 and higher of Elasticdump will quit if the node version does not match the minimum requirement needed (v10.0.0)
  • Version 6.76.0 and higher of Elasticdump added support for OpenSearch (forked from Elasticsearch 7.10.2)

Installing

(local)

npm install elasticdump
./bin/elasticdump

(global)

npm install elasticdump -g
elasticdump

Use

Standard Install

Elasticdump works by sending an input to an output. Both can be either an elasticsearch URL or a File.

Elasticsearch/OpenSearch:

  • format: {protocol}://{host}:{port}/{index}
  • example: http://127.0.0.1:9200/my_index

File:

  • format: {FilePath}
  • example: /Users/evantahler/Desktop/dump.json

Stdio:

  • format: stdin / stdout
  • format: $

You can then do things like:

# Copy an index from production to staging with analyzer and mapping:
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=analyzer
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=mapping
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=data

# Backup index data to a file:
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=/data/my_index_mapping.json \
  --type=mapping
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=/data/my_index.json \
  --type=data

# Backup and index to a gzip using stdout:
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=$ \
  | gzip > /data/my_index.json.gz

# Backup the results of a query to a file
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=query.json \
  --searchBody="{\"query\":{\"term\":{\"username\": \"admin\"}}}"
  
# Specify searchBody from a file
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=query.json \
  --searchBody=@/data/searchbody.json  

# Copy a single shard data:
elasticdump \
  --input=http://es.com:9200/api \
  --output=http://es.com:9200/api2 \
  --input-params="{\"preference\":\"_shards:0\"}"

# Backup aliases to a file
elasticdump \
  --input=http://es.com:9200/index-name/alias-filter \
  --output=alias.json \
  --type=alias

# Import aliases into ES
elasticdump \
  --input=./alias.json \
  --output=http://es.com:9200 \
  --type=alias

# Backup templates to a file
elasticdump \
  --input=http://es.com:9200/template-filter \
  --output=templates.json \
  --type=template

# Import templates into ES
elasticdump \
  --input=./templates.json \
  --output=http://es.com:9200 \
  --type=template

# Split files into multiple parts
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=/data/my_index.json \
  --fileSize=10mb

# Import data from S3 into ES (using s3urls)
elasticdump \
  --s3AccessKeyId "${access_key_id}" \
  --s3SecretAccessKey "${access_key_secret}" \
  --input "s3://${bucket_name}/${file_name}.json" \
  --output=http://production.es.com:9200/my_index

# Export ES data to S3 (using s3urls)
elasticdump \
  --s3AccessKeyId "${access_key_id}" \
  --s3SecretAccessKey "${access_key_secret}" \
  --input=http://production.es.com:9200/my_index \
  --output "s3://${bucket_name}/${file_name}.json"

# Import data from MINIO (s3 compatible) into ES (using s3urls)
elasticdump \
  --s3AccessKeyId "${access_key_id}" \
  --s3SecretAccessKey "${access_key_secret}" \
  --input "s3://${bucket_name}/${file_name}.json" \
  --output=http://production.es.com:9200/my_index
  --s3ForcePathStyle true
  --s3Endpoint https://production.minio.co

# Export ES data to MINIO (s3 compatible) (using s3urls)
elasticdump \
  --s3AccessKeyId "${access_key_id}" \
  --s3SecretAccessKey "${access_key_secret}" \
  --input=http://production.es.com:9200/my_index \
  --output "s3://${bucket_name}/${file_name}.json"
  --s3ForcePathStyle true
  --s3Endpoint https://production.minio.co

# Import data from CSV file into ES (using csvurls)
elasticdump \
  # csv:// prefix must be included to allow parsing of csv files
  # --input "csv://${file_path}.csv" \
  --input "csv:///data/cars.csv"
  --output=http://production.es.com:9200/my_index \
  --csvSkipRows 1    # used to skip parsed rows (this does not include the headers row)
  --csvDelimiter ";" # default csvDelimiter is ','

Non-Standard Install

If Elasticsearch/OpenSearch is not being served from the root directory the --input-index and --output-index are required. If they are not provided, the additional sub-directories will be parsed for index and type.

Elasticsearch/OpenSearch:

  • format: {protocol}://{host}:{port}/{sub}/{directory...}
  • example: http://127.0.0.1:9200/api/search
# Copy a single index from a elasticsearch:
elasticdump \
  --input=http://es.com:9200/api/search \
  --input-index=my_index \
  --output=http://es.com:9200/api/search \
  --output-index=my_index \
  --type=mapping

# Copy a single type:
elasticdump \
  --input=http://es.com:9200/api/search \
  --input-index=my_index/my_type \
  --output=http://es.com:9200/api/search \
  --output-index=my_index \
  --type=mapping

Docker install

If you prefer using docker to use elasticdump, you can download this project from docker hub:

docker pull elasticdump/elasticsearch-dump

Then you can use it just by :

  • using docker run --rm -ti elasticdump/elasticsearch-dump
  • you'll need to mount your file storage dir -v <your dumps dir>:<your mount point> to your docker container

Example:

# Copy an index from production to staging with mappings:
docker run --rm -ti elasticdump/elasticsearch-dump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=mapping
docker run --rm -ti elasticdump/elasticsearch-dump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=data

# Backup index data to a file:
docker run --rm -ti -v /data:/tmp elasticdump/elasticsearch-dump \
  --input=http://production.es.com:9200/my_index \
  --output=/tmp/my_index_mapping.json \
  --type=data

If you need to run using localhost as your ES host:

docker run --net=host --rm -ti elasticdump/elasticsearch-dump \
  --input=http://staging.es.com:9200/my_index \
  --output=http://localhost:9200/my_index \
  --type=data

Dump Format

The file format generated by this tool is line-delimited JSON files. The dump file itself is not valid JSON, but each line is. We do this so that dumpfiles can be streamed and appended without worrying about whole-file parser integrity.

For example, if you wanted to parse every line, you could do:

while read LINE; do jsonlint-py "${LINE}" ; done < dump.data.json

Options

elasticdump: Import and export tools for elasticsearch
version: %%version%%

Usage: elasticdump --input SOURCE --output DESTINATION [OPTIONS]

Core options
--------------------
--input
                    Source location (required)

--input-index
                    Source index and type
                    (default: all, example: index/type)

--output
                    Destination location (required)

--output-index
                    Destination index and type
                    (default: all, example: index/type)


Options
--------------------
--big-int-fields
                    Specifies a comma-seperated list of fields that should be checked for big-int support
                    (default '')

--bulkAction
                    Sets the operation type to be used when preparing the request body to be sent to elastic search.
                    For more info - https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
                    (default: index, options: [index, update, delete, create)

--ca, --input-ca, --output-ca
                    CA certificate. Use --ca if source and destination are identical.
                    Otherwise, use the one prefixed with --input or --output as needed.

--cert, --input-cert, --output-cert
                    Client certificate file. Use --cert if source and destination are identical.
                    Otherwise, use the one prefixed with --input or --output as needed.

--csvConfigs
                    Set all fast-csv configurations
                    A escaped JSON string or file can be supplied. File location must be prefixed with the @ symbol
                    (default: null)

--csvCustomHeaders  A comma-seperated listed of values that will be used as headers for your data. This param must
                    be used in conjunction with `csvRenameHeaders`
                    (default : null)

--csvDelimiter
                    The delimiter that will separate columns.
                    (default : ',')

--csvFirstRowAsHeaders
                    If set to true the first row will be treated as the headers.
                    (default : true)

--csvHandleNestedData
                    Set to true to handle nested JSON/CSV data.
                    NB : This is a very opinionated implementaton !
                    (default : false)

--csvIdColumn
                    Name of the column to extract the record identifier (id) from
                    When exporting to CSV this column can be used to override the default id (@id) column name
                    (default : null)

--csvIgnoreAutoColumns
                    Set to true to prevent the following columns @id, @index, @type from being written to the output file
                    (default : false)

--csvIgnoreEmpty
                    Set to true to ignore empty rows.
                    (default : false)

--csvIncludeEndRowDelimiter
                    Set to true to include a row delimiter at the end of the csv
                    (default : false)

--csvIndexColumn
                    Name of the column to extract the record index from
                    When exporting to CSV this column can be used to override the default index (@index) column name
                    (default : null)

--csvLTrim
                    Set to true to left trim all columns.
                    (default : false)

--csvMaxRows
                    If number is > 0 then only the specified number of rows will be parsed.(e.g. 100 would return the first 100 rows of data)
                    (default : 0)

--csvRTrim
                    Set to true to right trim all columns.
                    (default : false)

--csvRenameHeaders
                    If you want the first line of the file to be removed and replaced by the one provided in the `csvCustomHeaders` option
                    (default : true)

--csvSkipLines
                    If number is > 0 the specified number of lines will be skipped.
                    (default : 0)

--csvSkipRows
                    If number is > 0 then the specified number of parsed rows will be skipped
                    NB:  (If the first row is treated as headers, they aren't a part of the count)
                    (default : 0)

--csvTrim
                    Set to true to trim all white space from columns.
                    (default : false)

--csvTypeColumn
                    Name of the column to extract the record type from
                    When exporting to CSV this column can be used to override the default type (@type) column name
                    (default : null)

--csvWriteHeaders   Determines if headers should be written to the csv file.
                    (default : true)

--customBackoff
                    Activate custom customBackoff function. (s3)

--debug
                    Display the elasticsearch commands being used
                    (default: false)

--delete
                    Delete documents one-by-one from the input as they are
                    moved.  Will not delete the source index
                    (default: false)

--delete-with-routing
                    Passes the routing query-param to the delete function
                    used to route operations to a specific shard.
                    (default: false)

--esCompress
                    if true, add an Accept-Encoding header to request compressed content encodings from the server (if not already present)
                    and decode supported content encodings in the response.
                    Note: Automatic decoding of the response content is performed on the body data returned through request
                    (both through the request stream and passed to the callback function) but is not performed on the response stream
                    (available from the response event) which is the unmodified http.IncomingMessage object which may contain compressed data.
                    See example below.

--fileSize
                    supports file splitting.  This value must be a string supported by the **bytes** module.
                    The following abbreviations must be used to signify size in terms of units
                    b for bytes
                    kb for kilobytes
                    mb for megabytes
                    gb for gigabytes
                    tb for terabytes
                    e.g. 10mb / 1gb / 1tb
                    Partitioning helps to alleviate overflow/out of memory exceptions by efficiently segmenting files
                    into smaller chunks that then can be merged if needs be.

--filterSystemTemplates
                    Whether to remove metrics-*-* and logs-*-* system templates
                    (default: true])

--force-os-version
                    Forces the OpenSearch version used by elasticsearch-dump.
                    (default: 7.10.2)

--fsCompress
                    gzip data before sending output to file.
                    On import the command is used to inflate a gzipped file

--handleVersion
                    Tells elastisearch transport to handle the `_version` field if present in the dataset
                    (default : false)

--headers
                    Add custom headers to Elastisearch requests (helpful when
                    your Elasticsearch instance sits behind a proxy)
                    (default: '{"User-Agent": "elasticdump"}')
                    Type/direction based headers are supported .i.e. input-headers/output-headers
                    (these will only be added based on the current flow type input/output)

--help
                    This page

--ignore-errors
                    Will continue the read/write loop on write error
                    (default: false)

--ignore-es-write-errors
                    Will continue the read/write loop on a write error from elasticsearch
                    (default: true)

--inputSocksPort, --outputSocksPort
                    Socks5 host port

--inputSocksProxy, --outputSocksProxy
                    Socks5 host address

--inputTransport
                    Provide a custom js file to use as the input transport

--key, --input-key, --output-key
                    Private key file. Use --key if source and destination are identical.
                    Otherwise, use the one prefixed with --input or --output as needed.

--limit
                    How many objects to move in batch per operation
                    limit is approximate for file streams
                    (default: 100)

--maxRows
                    supports file splitting.  Files are split by the number of rows specified

--maxSockets
                    How many simultaneous HTTP requests can the process make?
                    (default:
                      5 [node <= v0.10.x] /
                      Infinity [node >= v0.11.x] )

--noRefresh
                    Disable input index refresh.
                    Positive:
                      1. Much increased index speed
                      2. Much less hardware requirements
                    Negative:
                      1. Recently added data may not be indexed
                    Recommended using with big data indexing,
                    where speed and system health is a higher priority
                    than recently added data.

--offset
                    Integer containing the number of rows you wish to skip
                    ahead from the input transport.  When importing a large
                    index, things can go wrong, be it connectivity, crashes,
                    someone forgets to `screen`, etc.  This allows you
                    to start the dump again from the last known line written
                    (as logged by the `offset` in the output).  Please be
                    advised that since no sorting is specified when the
                    dump is initially created, there's no real way to
                    guarantee that the skipped rows have already been
                    written/parsed.  This is more of an option for when
                    you want to get as much data as possible in the index
                    without concern for losing some rows in the process,
                    similar to the `timeout` option.
                    (default: 0)

--outputTransport
                    Provide a custom js file to use as the output transport

--overwrite
                    Overwrite output file if it exists
                    (default: false)

--params
                    Add custom parameters to Elastisearch requests uri. Helpful when you for example
                    want to use elasticsearch preference
                    --input-params is a specific params extension that can be used when fetching data with the scroll api
                    --output-params is a specific params extension that can be used when indexing data with the bulk index api
                    NB : These were added to avoid param pollution problems which occur when an input param is used in an output source
                    (default: null)

--parseExtraFields
                    Comma-separated list of meta-fields to be parsed

--pass, --input-pass, --output-pass
                    Pass phrase for the private key. Use --pass if source and destination are identical.
                    Otherwise, use the one prefixed with --input or --output as needed.

--quiet
                    Suppress all messages except for errors
                    (default: false)

--retryAttempts
                    Integer indicating the number of times a request should be automatically re-attempted before failing
                    when a connection fails with one of the following errors `ECONNRESET`, `ENOTFOUND`, `ESOCKETTIMEDOUT`,
                    ETIMEDOUT`, `ECONNREFUSED`, `EHOSTUNREACH`, `EPIPE`, `EAI_AGAIN`
                    (default: 0)

--retryDelay
                    Integer indicating the back-off/break period between retry attempts (milliseconds)
                    (default : 5000)

--retryDelayBase
                    The base number of milliseconds to use in the exponential backoff for operation retries. (s3)

--scroll-with-post
                    Use a HTTP POST method to perform scrolling instead of the default GET
                    (default: false)

--scrollId
                    The last scroll Id returned from elasticsearch.
                    This will allow dumps to be resumed used the last scroll Id &
                    `scrollTime` has not expired.

--scrollTime
                    Time the nodes will hold the requested search in order.
                    (default: 10m)

--searchBody
                    Preform a partial extract based on search results
                    when ES is the input, default values are
                      if ES > 5
                        `'{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'`
                      else
                        `'{"query": { "match_all": {} }, "fields": ["*"], "_source": true }'`
                    [As of 6.68.0] If the searchBody is preceded by a @ symbol, elasticdump will perform a file lookup
                    in the location specified. NB: File must contain valid JSON

--searchBodyTemplate
                    A method/function which can be called to the searchBody
                        doc.searchBody = { query: { match_all: {} }, stored_fields: [], _source: true };
                    May be used multiple times.
                    Additionally, searchBodyTemplate may be performed by a module. See [searchBody Template](#search-template) below.

--searchWithTemplate
                    Enable to use Search Template when using --searchBody
                    If using Search Template then searchBody has to consist of "id" field and "params" objects
                    If "size" field is defined within Search Template, it will be overridden by --size parameter
                    See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html for
                    further information
                    (default: false)

--size
                    How many objects to retrieve
                    (default: -1 -> no limit)

--skip-existing
                    Skips resource_already_exists_exception when enabled and exit with success
                    (default: false)

--sourceOnly
                    Output only the json contained within the document _source
                    Normal: {"_index":"","_type":"","_id":"", "_source":{SOURCE}}
                    sourceOnly: {SOURCE}
                    (default: false)

--support-big-int
                    Support big integer numbers

--templateRegex
                    Regex used to filter templates before passing to the output transport
                    (default: ((metrics|logs|\..+)(-.+)?)

--timeout
                    Integer containing the number of milliseconds to wait for
                    a request to respond before aborting the request. Passed
                    directly to the request library. Mostly used when you don't
                    care too much if you lose some data when importing
                    but would rather have speed.

--tlsAuth
                    Enable TLS X509 client authentication

--toLog
                    When using a custom outputTransport, should log lines
                    be appended to the output stream?
                    (default: true, except for `$`)

--transform
                    A method/function which can be called to modify documents
                    before writing to a destination. A global variable 'doc'
                    is available.
                    Example script for computing a new field 'f2' as doubled
                    value of field 'f1':
                        doc._source["f2"] = doc._source.f1 * 2;
                    May be used multiple times.
                    Additionally, transform may be performed by a module. See [Module Transform](#module-transform) below.

--type
                    What are we exporting?
                    (default: data, options: [index, settings, analyzer, data, mapping, policy, alias, template, component_template, index_template])

--versionType
                    Elasticsearch versioning types. Should be `internal`, `external`, `external_gte`, `force`.
                    NB : Type validation is handled by the bulk endpoint and not by elasticsearch-dump


AWS specific options
--------------------
--awsAccessKeyId and --awsSecretAccessKey
                    When using Amazon Elasticsearch Service protected by
                    AWS Identity and Access Management (IAM), provide
                    your Access Key ID and Secret Access Key.
                    --sessionToken can also be optionally provided if using temporary credentials

--awsChain
                    Use [standard](https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/)
                    location and ordering for resolving credentials including environment variables,
                    config files, EC2 and ECS metadata locations _Recommended option for use with AWS_

--awsIniFileName
                    Override the default aws ini file name when using --awsIniFileProfile
                    Filename is relative to ~/.aws/
                    (default: config)

--awsIniFileProfile
                    Alternative to --awsAccessKeyId and --awsSecretAccessKey,
                    loads credentials from a specified profile in aws ini file.
                    For greater flexibility, consider using --awsChain
                    and setting AWS_PROFILE and AWS_CONFIG_FILE
                    environment variables to override defaults if needed

--awsRegion
                    Sets the AWS region that the signature will be generated for
                    (default: calculated from hostname or host)

--awsService
                    Sets the AWS service that the signature will be generated for
                    (default: calculated from hostname or host)

--awsUrlRegex
                    Overrides the default regular expression that is used to validate AWS urls that should be signed
                    (default: ^https?:\/\/.*\.amazonaws\.com.*$)

--s3ACL
                    S3 ACL: private | public-read | public-read-write | authenticated-read | aws-exec-read |
                    bucket-owner-read | bucket-owner-full-control [default private]

--s3AccessKeyId
                    AWS access key ID

--s3Compress
                    gzip data before sending to s3

--s3Configs
                    Set all s3 constructor configurations
                    A escaped JSON string or file can be supplied. File location must be prefixed with the @ symbol
                    (default: null)

--s3Endpoint
                    AWS endpoint that can be used for AWS compatible backends such as
                    OpenStack Swift and OpenStack Ceph

--s3ForcePathStyle
                    Force path style URLs for S3 objects [default false]

--s3Options
                    Set all s3 parameters shown here https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#createMultipartUpload-property
                    A escaped JSON string or file can be supplied. File location must be prefixed with the @ symbol
                    (default: null)

--s3Region
                    AWS region

--s3SSEKMSKeyId
                    KMS Id to be used with aws:kms uploads

--s3SSLEnabled
                    Use SSL to connect to AWS [default true]

--s3SecretAccessKey
                    AWS secret access key

--s3ServerSideEncryption
                    Enables encrypted uploads

--s3StorageClass
                    Set the Storage Class used for s3
                    (default: STANDARD)

Elasticsearch's Scroll API

Elasticsearch provides a scroll API to fetch all documents of an index starting from (and keeping) a consistent snapshot in time, which we use under the hood. This method is safe to use for large exports since it will maintain the result set in cache for the given period of time.

NOTE: only works for --output

Bypassing self-sign certificate errors

Set the environment NODE_TLS_REJECT_UNAUTHORIZED=0 before running elasticdump

# An alternative method of passing environment variables before execution
# NB : This only works with linux shells
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump --input="https://localhost:9200" --output myfile

MultiElasticDump

This package also ships with a second binary, multielasticdump. This is a wrapper for the normal elasticdump binary, which provides a limited option set, but will run elasticdump in parallel across many indexes at once. It runs a process which forks into n (default your running host's # of CPUs) subprocesses running elasticdump.

The limited option set includes:

  • parallel: os.cpus(),
  • match: '^.*$',
  • matchType: alias,
  • order: 'asc',
  • input: null,
  • output: null,
  • scrollTime: '10m',
  • timeout: null,
  • limit: 100,
  • offset: 0,
  • size: -1,
  • direction: dump,
  • ignoreType: ``
  • includeType: ``
  • prefix: '''
  • suffix: ''
  • interval: 1000
  • searchBody: null
  • transform: null
  • support-big-int: false
  • big-int-fields: ``
  • ignoreChildError: false

If the --direction is dump, which is the default, --input MUST be a URL for the base location of an ElasticSearch server (i.e. http://localhost:9200) and --output MUST be a directory. Each index that does match will have a data, mapping, and analyzer file created.

For loading files that you have dumped from multi-elasticsearch, --direction should be set to load, --input MUST be a directory of a multielasticsearch dump and --output MUST be a Elasticsearch server URL.

--parallel is how many forks should be run simultaneously and --match is used to filter which indexes should be dumped/loaded (regex).

--ignoreType allows a type to be ignored from the dump/load. Six options are supported. data,mapping,analyzer,alias,settings,template. Multi-type support is available, when used each type must be comma(,)-separated and interval allows control over the interval for spawning a dump/load for a new index. For small indices this can be set to 0 to reduce delays and optimize performance i.e analyzer,alias types are ignored by default

--includeType allows a type to be included in the dump/load. Six options are supported - data,mapping,analyzer,alias,settings,template.

--ignoreChildError allows multi-elasticdump to continue if a child throws an error.

--matchType allows multi-elasticdump to fetch indices from the specified elasticsearch endpoint. Two options are supported - alias,datastream

New options, --suffix allows you to add a suffix to the index name being created e.g. es6-${index} and --prefix allows you to add a prefix to the index name e.g. ${index}-backup-2018-03-13. --order accepts asc or desc and allows the indexes/aliases to be sorted before processing is performed

Usage Examples

# backup ES indices & all their type to the es_backup folder
multielasticdump \
  --direction=dump \
  --match='^.*$' \
  --input=http://production.es.com:9200 \
  --output=/tmp/es_backup

# Only backup ES indices ending with a prefix of `-index` (match regex). 
# Only the indices data will be backed up. All other types are ignored.
# NB: analyzer & alias types are ignored by default
multielasticdump \
  --direction=dump \
  --match='^.*-index$'\
  --input=http://production.es.com:9200 \
  --ignoreType='mapping,settings,template' \
  --output=/tmp/es_backup

Module Transform

When specifying the transform option, prefix the value with @ (a curl convention) to load the top-level function which is called with the document and the parsed arguments to the module.

Uses a pseudo-URL format to specify arguments to the module as follows. Given:

elasticdump --transform='@./transforms/my-transform?param1=value&param2=another-value'

with a module at ./transforms/my-transform.js with the following:

module.exports = function(doc, options) {
  // do something to doc
};

will load module ./transforms/my-transform.js', and execute the function with docandoptions={"param1": "value", "param2": "another-value"}`.

An example transform for anonymizing data on-the-fly can be found in the transforms folder.

searchBody Template

When specifying the searchBodyTemplate option, prefix the value with @ (a curl convention) to load the top-level function which is called with the document and the parsed arguments to the module.

Uses a pseudo-URL format to specify arguments to the module as follows. Given:

elasticdump --searchBodyTemplate='@./templates/my-template?param1=value&param2=another-value'

with a module at ./transforms/my-transform.js with the following:

module.exports = function(doc, options) {
  // result must be added to doc.searchBody
  doc.searchBody = {}
};

will load module ./templates/my-template.js', and execute the function with docandoptions={"param1": "value", "param2": "another-value"}`.

An example template for modifying dates using a simple templating engine is available in the templates folder.

How Elasticdump handles Nested Data in CSV

Elasticdump is capable of reading/writing nested data, but in an _opinionated way. This is to reduce complexity while parsing/saving CSVs The format flattens all nesting to a single level (an example of this is shown below)

{
   "elasticdump":{
      "version":"6.51.0",
      "formats":[
         "json",
         "csv"
      ]
   },
   "contributors":[
      {
         "name":"ferron",
         "id":3
      }
   ],
   "year":112
}

Output format

{
  "elasticdump":"{\"version\":\"6.51.0\",\"formats\":[\"json\",\"csv\"]}",
  "contributors":"{\"contributors\":[{\"name\":\"ferron\",\"id\":3}]}",
  "year":2020
}

Notice that the data is flattened to 1 level. Object keys are used for headers and values as row data. This might not work with existing nested data formats, but that's the format that was chosen for elasticdump because of its simplicity. This detection is disabled by default, to enable use the --csvHandleNestedData flag

Notes

  • This tool is likely to require Elasticsearch version 1.0.0 or higher
  • Elasticdump (and Elasticsearch in general) will create indices if they don't exist upon import
  • When exporting from elasticsearch, you can export an entire index (--input="http://localhost:9200/index") or a type of object from that index (--input="http://localhost:9200/index/type"). This requires ElasticSearch 1.2.0 or higher
  • If the path to our elasticsearch installation is in a sub-directory, the index and type must be provided with a separate argument (--input="http://localhost:9200/sub/directory --input-index=index/type").Using --input-index=/ will include all indices and types.
  • We can use the put method to write objects. This means new objects will be created and old objects with the same ID be updated
  • The file transport will not overwrite any existing files by default, it will throw an exception if the file already exists. You can make use of --overwrite instead.
  • If you need basic http auth, you can use it like this: --input=http://name:[email protected]:9200/my_index
  • If you choose a stdio output (--output=$), you can also request a more human-readable output with --format=human
  • If you choose a stdio output (--output=$), all logging output will be suppressed
  • If you are using Elasticsearch version 6.0.0 or higher the offset parameter is no longer allowed in the scrollContext
  • ES 6.x.x & higher no longer support the template property for _template. All templates prior to ES 6.0 has to be upgraded to use index_patterns
  • ES 7.x.x & higher no longer supports type property. All templates prior to ES 6.0 has to be upgraded to remove the type property
  • ES 5.x.x ignores offset (from) parameter in the search body. All records will be returned
  • ES 6.x.x from parameter can no longer be used in the search request body when initiating a scroll
  • Index templates has been deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
  • Ensure JSON in the searchBody properly escaped to avoid parsing issues : https://www.freeformatter.com/json-escape.html
  • Dropped support for Node.JS 8 in Elasticdump v6.32.0. Node.JS 10+ is now required.
  • Elasticdump v6.42.0 added support for CSV import/export using the fast-csv library
  • Elasticdump v6.68.0 added support for specifying a file containing the searchBody
  • Elasticdump v6.85.0 added support for ignoring auto columns in CSV
  • Elasticdump v6.86.0 added support for searchBodyTemplate which allows the searchBody to be transformed

Articles on Elasticdump

Inspired by https://github.com/crate/elasticsearch-inout-plugin and https://github.com/jprante/elasticsearch-knapsack

elasticsearch-dump's People

Contributors

artyomsol avatar aviau avatar bigsan avatar bloublou2014 avatar brianreavis avatar calpicow avatar cggaurav avatar cpomerantz avatar darky avatar datashaman avatar davidjairala avatar ebuildy avatar evantahler avatar ferronrsmith avatar ginkel avatar greenkeeperio-bot avatar igelbox avatar isra17 avatar jakubneubauer avatar jimmyjones2 avatar jonseymour avatar josselinchevalay avatar khanhicetea avatar mgorsk1 avatar pctj101 avatar pderaaij avatar philipbjorge avatar prog8 avatar shaharmor avatar strivedi183 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elasticsearch-dump's Issues

Red index when dump completes

I understand this is probably not a bug on elasticdump's side, but maybe you can help.
I have a strange nehaviour on my one node test cluster running ES 1.3.2: whenever a large dump (~16GB) completes, the index ends up red:

elasticdump --input=http://0:9201/syslog-2014.10.08 --output=http://0:9200/syslog-2014.10.08 --bulk-use-output-index-name --type=data --bulk --limit 5000
Fri, 10 Oct 2014 00:37:40 GMT | got 0 objects from source elasticsearch (offset: 43646348)
Fri, 10 Oct 2014 00:37:40 GMT | sent 0 objects to destination elasticsearch, wrote 0
Fri, 10 Oct 2014 00:37:40 GMT | dump complete
โšก curl 0:9200/syslog-2014.10.08/_status\?pretty
{
  "_shards" : {
    "total" : 1,
    "successful" : 0,
    "failed" : 0
  },
  "indices" : { }
}
โšก curl 0:9200/_cat/indices/syslog-2014.10.08\?v
health index             pri rep docs.count docs.deleted store.size pri.store.size
red    syslog-2014.10.08   1   0

Wildcard queries are not working.

Hi,

I have been trying to run wildcard queries against .kibana indices on ES 1.4.4. I am querying on _id. While prefix query runs, wildcard queries don't.

Example

curl localhost:9200/,kibana/_search?pretty -d '{"query":{"prefix":{"_id":"TC"}}}'

Gives results, but

curl localhost:9200/,kibana/_search?pretty -d '{"query":{"wildcard":{"_id":"TC*"}}}'

Gives me an empty result.

Trouble installing with npm

npm install elasticdump returns:

npm WARN install Refusing to install elasticdump as a dependency of itself

Create index with mapping from JSON file

When importing data into an index that doesn't exist yet, I'd like to pass on a JSON file to elasticdump with which it should instantiate the index before importing the data. Preferably with an additional flag to trash the target index if it already exists (for testing mapping tweaks in development).

elasticdump crashes when the input is a large enough file

Can reproduce this bug on both Ubuntu and Mac OS, using latest master.

Test file is a 3.4GB JSON file dumped using elasticdump.

Error output is:

Thu, 22 May 2014 18:00:38 GMT | got 1000 objects from source file (offset: 121000)
FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory

It chugs along fine for quite a while, but then crashes.

Unable to handle FilePath in Windows

elasticdump --input=http://localhost:9200/ --output=D:\1.json

This command line cause error when writing.

Wed, 04 Feb 2015 07:29:10 GMT | starting dump
Wed, 04 Feb 2015 07:29:11 GMT | got 2700 objects from source elasticsearch (offset: 0)
Wed, 04 Feb 2015 07:29:11 GMT | Invalid URI "d:/1.json/api/514"
Wed, 04 Feb 2015 07:29:11 GMT | dump ended with error
......

Both D:\1.json or \\?\D:\1.json cannot work.

( Maybe just add a notice in README is enough. )

Filter data to export

I would like to "copy" my data from Server 1 to Server 2, But...

Not all the data. Just ones that match a query/filter.

Is that easy to do? Or is there a place I could add that in? I'll look deeper in a day or two, but in case it was already done, please let me know.

Values from _timestamp field are not dumped

_timestamp field (maybe other fields too?) is skipped by dumping

Example
input data:
{
"_index" : "my-index",
"_type" : "my-type",
"_id" : "AUu8jVhY4Lq59mfN-hXL",
"_score" : 1.0,
"_source":{"id":5218198,"userId":123},
"fields" : {
"_timestamp" : 1424797554751
}
is copied as:
{
"_index" : "my-index",
"_type" : "my-type",
"_id" : "AUu8jVhY4Lq59mfN-hXL",
"_score" : 1.0,
"_source":{"id":5218198,"userId":123}
}

Does not work with self-signed HTTPS certificates

I'm not sure if I am doing anything wrong, but it seems es-dump is not working with our setup, where ES is reachable via HTTPS through a self-signed certificate.

From the console:

--- ~ ยป curl -XGET https://our-internal-server/_cat/indices | tail 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5742  100  5742    0     0  10313      0 --:--:-- --:--:-- --:--:-- 10327
yellow logstash-2014.09.30 5 1    9645 0 337.2mb 337.2mb 
yellow logstash-2014.12.14 5 1   51324 0  33.1mb  33.1mb 
yellow logstash-2014.11.02 5 1   16900 0  56.6mb  56.6mb 
yellow logstash-2015.01.06 5 1   47712 0  58.6mb  58.6mb 
yellow logstash-2014.12.13 5 1   31839 0  35.8mb  35.8mb 
yellow logstash-2014.11.14 5 1   34022 0    79mb    79mb 
yellow logstash-2015.01.01 5 1   27092 0  32.8mb  32.8mb 
yellow logstash-2014.10.20 5 1   13366 0  40.7mb  40.7mb 
yellow logstash-2014.10.12 5 1   31878 0   1.3gb   1.3gb 
yellow logstash-2014.11.04 5 1   13078 0  22.8mb  22.8mb 

...which shows that the certificate works and indices are there. However:

--- ~ ยป .npm/elasticdump/0.7.7/package/bin/elasticdump --input='https://our-internal-server/kibana-int' --output=/tmp/my_index.json --type=data --debug
Wed, 07 Jan 2015 13:37:38 GMT | starting dump
Wed, 07 Jan 2015 13:37:38 GMT | SELF_SIGNED_CERT_IN_CHAIN
Wed, 07 Jan 2015 13:37:38 GMT | got 0 objects from source elasticsearch (offset: 0)
Wed, 07 Jan 2015 13:37:38 GMT | sent 0 objects to destination file, wrote 0
Wed, 07 Jan 2015 13:37:38 GMT | dump complete

I tried to explicitly specify the 443 port, to omit the --type and --debug parameters, to change the index, to specify --all, to set the output to stdout, and more...

...but to no avail. If I am doing something wrong, I'm missing what that is...

[As visible from the command line, I am using v0.7.7, and I am running it on my local machine, a Fedora 21 64 bit installation].

"Malformed scrollId" exception

Originally reported in elastic/elasticsearch#9469, they told me to report the issue here, so here goes:

One elasticdump invocation yields the following:

% elasticdump --input=http://localhost:9200/ --output=\$ 
Wed, 28 Jan 2015 18:07:28 GMT | {"error":"ElasticsearchIllegalArgumentException[Malformed scrollId []]","status":400}
[
]

What is a scrollId and why is it malformed? Google is of no help in understanding this error message.

This exception seems like a low-level one. It should be caught by higher level code and converted to a more meaningful error message, like, say, "index was not specified".

Update: this issue seems to happen only when I am trying to dump an elasticsearch instance which has no data. It further looks like elasticdump is sending an empty scrollid to elasticsearch in this case.

Export index with parent-child relationship

I've tried to copy an index with a parent-child relationship.

All data is dumped but does not have the relationship (no _parent field is found in the index), if I check the json I can't find the "_parent" field and it is necessary to maintain the relationship.

I've tried back up all indices and back up the mapping and data separated.

This is a known bug?

Thanks in advance

type=mapping does only create index, not mappings

Hi,

When exporting and importing my index mapping from von ES instance to another one, only the index itself created and no mappings.
The issue appear when both (1) directly copying the mapping or (2) indirectly via a json file.

(1)
elasticdump --input=https://myelasticsearchurl/myindex --output=https://myelasticsearchurl/myindex --type=mapping

(2)
elasticdump --input=https://myelasticsearchurl/myindex --output=mapping.json --type=mapping
elasticdump --input=mapping.json --output=https://myelasticsearchurl/myindex --type=mapping

Anybody else experiencing this problem? Or am I missing something.

Best regards,
Tobias

Syntax error: Unexpected token

Hi there,

I have problems dumping an index:

# ./elasticdump --input=http://127.0.0.1:9200/testindex/ --output=es_dump.json
Wed, 13 Aug 2014 13:44:49 GMT | starting dump

SyntaxError: Unexpected token '
    at Object.parse (native)
    at Request.requestResonse [as _callback] (/opt/elasticdump/lib/transports/elasticsearch.js:303:25)
    at Request.self.callback (/opt/elasticdump/node_modules/request/request.js:123:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (/opt/elasticdump/node_modules/request/request.js:1047:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/opt/elasticdump/node_modules/request/request.js:998:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

What I don't understand is that all my other indexes can be dumped without problems. Only this one does not work. It is the only index with ~1M entries. The other indices are quite smaller ~100-1000 entries.
Any idea what I can do?

Cheers, Marco

restore index with complex mapping not work

I had check with simple elastichsearch mapping it work ok, but in my real system it not work. The fact that I can dump data to file .json , but I can not restore this file into elastic index, it write nothing.
I had try to restore with no mapping (let it create default) it work, but with my mapping it not work.
Here is my index mapping that your elasticsearchdump not work:

{
  "product_filter" : {
    "mappings" : {
      "shop" : {
        "properties" : {
          "All_attribute" : {
            "properties" : {
              "address" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "business" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "city" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "confirm_sms" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "customer_id" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "description" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "district" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "external_id" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "free_return_shipping" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "free_shipping" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "is_certified" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "is_sendotp" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "is_verified" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "logo" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "name" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "notes_reason" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "open_step" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "otp" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "otp_attemps" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "payment_method" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "representative" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "shipping_method" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "shop_background" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "shop_support_city" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "shop_support_country" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "shop_top_cover" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "slogan" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "status" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "telephone" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "type_merchant" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "username" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "verification" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "ward" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "warehouse_address" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "warehouse_address2" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "warehouse_city" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "warehouse_city2" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "long"
                  }
                }
              },
              "warehouse_district" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "warehouse_district2" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "warehouse_ward" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "warehouse_ward2" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              },
              "website" : {
                "properties" : {
                  "attribute_code" : {
                    "type" : "string"
                  },
                  "attribute_id" : {
                    "type" : "long"
                  },
                  "value" : {
                    "type" : "string"
                  }
                }
              }
            }
          },
          "Attribute" : {
            "type" : "string"
          },
          "Banner" : {
            "type" : "string"
          },
          "Created_at" : {
            "type" : "long"
          },
          "Customer_fpt_id" : {
            "type" : "string"
          },
          "Customer_id" : {
            "type" : "integer"
          },
          "Description" : {
            "type" : "string"
          },
          "Event_mid_autumn_2014" : {
            "type" : "boolean"
          },
          "External_id" : {
            "type" : "long"
          },
          "Is_certified" : {
            "type" : "long"
          },
          "Is_loyalty" : {
            "type" : "long"
          },
          "Level_shop" : {
            "type" : "long"
          },
          "Logo" : {
            "type" : "string"
          },
          "Merchant_id" : {
            "type" : "integer"
          },
          "Name" : {
            "type" : "string",
            "store" : true,
            "term_vector" : "with_positions_offsets",
            "index_analyzer" : "translation_index_analyzer",
            "search_analyzer" : "translation_search_analyzer"
          },
          "Status" : {
            "type" : "integer"
          },
          "User_name" : {
            "type" : "string"
          },
          "Username" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Warehouse" : {
            "type" : "string"
          },
          "Warehouse_city" : {
            "type" : "long"
          },
          "external_id" : {
            "type" : "long"
          },
          "params" : {
            "properties" : {
              "Is_certified" : {
                "type" : "long"
              }
            }
          },
          "script" : {
            "type" : "string"
          }
        }
      },
      "attribute_replace" : {
        "properties" : {
          "attribute_id" : {
            "type" : "string"
          },
          "option_id" : {
            "type" : "string"
          },
          "option_id_need" : {
            "type" : "string"
          },
          "value_need" : {
            "type" : "string"
          }
        }
      },
      "product" : {
        "_parent" : {
          "type" : "shop"
        },
        "_routing" : {
          "required" : true
        },
        "properties" : {
          "Admin_id" : {
            "type" : "long"
          },
          "Approve_type" : {
            "type" : "long"
          },
          "Bao_hanh_elt" : {
            "type" : "string"
          },
          "Bao_hanh_elt_facet" : {
            "type" : "string"
          },
          "Bao_mat_router" : {
            "type" : "string"
          },
          "Bao_mat_router_facet" : {
            "type" : "string"
          },
          "Bd_mtb_chatlieu" : {
            "type" : "string"
          },
          "Bd_mtb_chatlieu_facet" : {
            "type" : "string"
          },
          "Bo_mon_vo" : {
            "type" : "string"
          },
          "Bo_xu_ly_facet" : {
            "type" : "string",
            "store" : true,
            "analyzer" : "wp_tag_analyzer"
          },
          "Brand_id" : {
            "type" : "long"
          },
          "Can_nang" : {
            "type" : "string"
          },
          "Can_nang_be" : {
            "type" : "string"
          },
          "Can_nang_be_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Can_nang_facet" : {
            "type" : "string"
          },
          "Cat_path" : {
            "type" : "string"
          },
          "Cate_suggest" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Category" : {
            "type" : "string"
          },
          "Category_id" : {
            "type" : "string"
          },
          "Category_id_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Category_name_suggest" : {
            "type" : "string",
            "store" : true,
            "term_vector" : "with_positions_offsets",
            "index_analyzer" : "translation_index_analyzer",
            "search_analyzer" : "translation_search_analyzer"
          },
          "Chat_Lieu_Binh" : {
            "type" : "string"
          },
          "Chat_Lieu_Boi_Lan" : {
            "type" : "string"
          },
          "Chat_Lieu_Do_The_Thao" : {
            "type" : "string"
          },
          "Chat_Lieu_Do_The_Thao_facet" : {
            "type" : "string"
          },
          "Chat_Lieu_Dung_Cu_Tap_Bung" : {
            "type" : "string"
          },
          "Chat_Lieu_Gang_Tay_Thu_Mon" : {
            "type" : "string"
          },
          "Chat_Lieu_Giay" : {
            "type" : "string"
          },
          "Chat_Lieu_Giay_Patin" : {
            "type" : "string"
          },
          "Chat_Lieu_Ho_Tro_An_Toan" : {
            "type" : "string"
          },
          "Chat_Lieu_Kinh_Boi" : {
            "type" : "string"
          },
          "Chat_Lieu_Leu" : {
            "type" : "string"
          },
          "Chat_Lieu_Mat_Vot_Bong_Ban" : {
            "type" : "string"
          },
          "Chat_Lieu_Phu_Tung_Xe_Dap" : {
            "type" : "string"
          },
          "Chat_Lieu_Qua_Bong_Da" : {
            "type" : "string"
          },
          "Chat_Lieu_Ta" : {
            "type" : "string"
          },
          "Chat_lieu" : {
            "type" : "string"
          },
          "Chat_lieu_ao_khoac" : {
            "type" : "string"
          },
          "Chat_lieu_ao_khoac_facet" : {
            "type" : "string"
          },
          "Chat_lieu_be" : {
            "type" : "string"
          },
          "Chat_lieu_be_1n" : {
            "type" : "string"
          },
          "Chat_lieu_be_1n_facet" : {
            "type" : "string"
          },
          "Chat_lieu_be_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Chat_lieu_bep_gas" : {
            "type" : "string"
          },
          "Chat_lieu_binh" : {
            "type" : "string"
          },
          "Chat_lieu_boi_lan" : {
            "type" : "string"
          },
          "Chat_lieu_do_the_thao" : {
            "type" : "string"
          },
          "Chat_lieu_do_the_thao_facet" : {
            "type" : "string"
          },
          "Chat_lieu_dung_cu_tap_bung" : {
            "type" : "string"
          },
          "Chat_lieu_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Chat_lieu_gang_tay_thu_mon" : {
            "type" : "string"
          },
          "Chat_lieu_gd1" : {
            "type" : "string"
          },
          "Chat_lieu_gd1_facet" : {
            "type" : "string"
          },
          "Chat_lieu_ghe" : {
            "type" : "string"
          },
          "Chat_lieu_ghe_facet" : {
            "type" : "string"
          },
          "Chat_lieu_giay" : {
            "type" : "string"
          },
          "Chat_lieu_giay_facet" : {
            "type" : "string"
          },
          "Chat_lieu_giay_patin" : {
            "type" : "string"
          },
          "Chat_lieu_gong" : {
            "type" : "string"
          },
          "Chat_lieu_ho_tro_an_toan" : {
            "type" : "string"
          },
          "Chat_lieu_kgs" : {
            "type" : "string"
          },
          "Chat_lieu_kgs_facet" : {
            "type" : "string"
          },
          "Chat_lieu_kinh_boi" : {
            "type" : "string"
          },
          "Chat_lieu_leu" : {
            "type" : "string"
          },
          "Chat_lieu_mat_vot_bong_ban" : {
            "type" : "string"
          },
          "Chat_lieu_noi_comdien" : {
            "type" : "string"
          },
          "Chat_lieu_phu_tung_xe_dap" : {
            "type" : "string"
          },
          "Chat_lieu_qua_bong_da" : {
            "type" : "string"
          },
          "Chat_lieu_ta" : {
            "type" : "string"
          },
          "Chat_lieu_trang_suc" : {
            "type" : "string"
          },
          "Chat_lieu_trang_suc_facet" : {
            "type" : "string"
          },
          "Chat_lieu_vo_phuc" : {
            "type" : "string"
          },
          "Chat_lieu_vot_tennis" : {
            "type" : "string"
          },
          "Chat_lieu_vu_khi" : {
            "type" : "string"
          },
          "Chieu_cao_de" : {
            "type" : "string"
          },
          "Chieu_cao_de_facet" : {
            "type" : "string"
          },
          "Chieu_dai_cap_elt" : {
            "type" : "string"
          },
          "Chieu_dai_cap_elt_facet" : {
            "type" : "string"
          },
          "Chieu_dai_vot_tennis" : {
            "type" : "string"
          },
          "Chuan_gtiep_router" : {
            "type" : "string"
          },
          "Chuan_gtiep_router_facet" : {
            "type" : "string"
          },
          "Chuan_gtiep_switch" : {
            "type" : "string"
          },
          "Chuan_kn_usb_3g" : {
            "type" : "string"
          },
          "Chuan_usb" : {
            "type" : "string"
          },
          "Chuan_usb_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Chuc_Nang_Den" : {
            "type" : "string"
          },
          "Chuc_nang_den" : {
            "type" : "string"
          },
          "Chudetranh_kgs" : {
            "type" : "string"
          },
          "Chudetranh_kgs_facet" : {
            "type" : "string"
          },
          "Clieu_balo_tui" : {
            "type" : "string"
          },
          "Clieu_balo_tui_facet" : {
            "type" : "string"
          },
          "Clieu_case_bd" : {
            "type" : "string"
          },
          "Clieu_case_bd_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Clieu_detannhiet" : {
            "type" : "string"
          },
          "Clieu_detannhiet_facet" : {
            "type" : "string"
          },
          "Co_ao" : {
            "type" : "string"
          },
          "Co_may_hop_elt" : {
            "type" : "string"
          },
          "Co_may_hop_elt_facet" : {
            "type" : "string"
          },
          "Cong_kn_1_mt" : {
            "type" : "string"
          },
          "Cong_kn_1_mt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Cong_kn_modem" : {
            "type" : "string"
          },
          "Cong_kn_modem_facet" : {
            "type" : "string"
          },
          "Cong_kn_router" : {
            "type" : "string"
          },
          "Cong_kn_router_facet" : {
            "type" : "string"
          },
          "Cong_kn_tainghe" : {
            "type" : "string"
          },
          "Cong_kn_tainghe_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Cong_suat_elt" : {
            "type" : "string"
          },
          "Congkn_hddbox" : {
            "type" : "string"
          },
          "Congkn_hddbox_facet" : {
            "type" : "string"
          },
          "Counter_view" : {
            "type" : "long"
          },
          "Created_at" : {
            "type" : "string"
          },
          "Cu_Ly_Chay" : {
            "type" : "string"
          },
          "Cu_ly_chay" : {
            "type" : "string"
          },
          "Description" : {
            "type" : "string"
          },
          "Dien_the_elt" : {
            "type" : "string"
          },
          "Dien_the_elt_facet" : {
            "type" : "string"
          },
          "Dien_the_pin_dtdd" : {
            "type" : "string"
          },
          "Dien_the_pin_dtdd_facet" : {
            "type" : "string"
          },
          "Dien_the_pin_laptop" : {
            "type" : "string"
          },
          "Dien_tich_tennis" : {
            "type" : "string"
          },
          "Dl_pin_dtdd" : {
            "type" : "string"
          },
          "Dl_pin_dtdd_facet" : {
            "type" : "string"
          },
          "Dl_sacpin_dp" : {
            "type" : "string"
          },
          "Dl_sacpin_dp_facet" : {
            "type" : "string"
          },
          "Do_Phong_Dai" : {
            "type" : "string"
          },
          "Do_dai_dam" : {
            "type" : "string"
          },
          "Do_dai_dam_facet" : {
            "type" : "string"
          },
          "Do_phan_giai_anh" : {
            "type" : "string"
          },
          "Do_phan_giai_anh_facet" : {
            "type" : "string"
          },
          "Do_phan_giai_quang_hoc" : {
            "type" : "string"
          },
          "Do_phan_giai_quang_hoc_facet" : {
            "type" : "string"
          },
          "Do_phong_dai" : {
            "type" : "string"
          },
          "Do_tuoi_be" : {
            "type" : "string"
          },
          "Do_tuoi_be_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Doc_loai_the" : {
            "type" : "string"
          },
          "Doc_loai_the_facet" : {
            "type" : "string"
          },
          "Doi_tuong" : {
            "type" : "string"
          },
          "Doi_tuong_be" : {
            "type" : "string"
          },
          "Doi_tuong_be_1" : {
            "type" : "string"
          },
          "Doi_tuong_be_facet" : {
            "type" : "string"
          },
          "Doi_tuong_facet" : {
            "type" : "string"
          },
          "Doi_tuong_nu" : {
            "type" : "string"
          },
          "Doi_tuong_nu_facet" : {
            "type" : "string"
          },
          "Doituong_kgs" : {
            "type" : "string"
          },
          "Doituong_kgs_facet" : {
            "type" : "string"
          },
          "Dung_Tich_Textfield" : {
            "type" : "string"
          },
          "Dung_cho" : {
            "type" : "string"
          },
          "Dung_cho_facet" : {
            "type" : "string"
          },
          "Dung_luong_nho_elt" : {
            "type" : "string"
          },
          "Dung_luong_nho_elt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Dung_luong_pin_elt" : {
            "type" : "string"
          },
          "Dung_luong_the_nho_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Dung_luong_thenho" : {
            "type" : "string"
          },
          "Dung_luong_thenho_facet" : {
            "type" : "string"
          },
          "Dung_m_balo_tui" : {
            "type" : "string"
          },
          "Dung_m_balo_tui_facet" : {
            "type" : "string"
          },
          "Dung_tich" : {
            "type" : "string"
          },
          "Dung_tich_be" : {
            "type" : "string"
          },
          "Dung_tich_be_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Dung_tich_facet" : {
            "type" : "string"
          },
          "Dung_tich_gd1" : {
            "type" : "string"
          },
          "Dung_tich_gd1_facet" : {
            "type" : "string"
          },
          "Dung_tich_textfield" : {
            "type" : "string"
          },
          "Dungtich_kgs" : {
            "type" : "string"
          },
          "Dungtich_kgs_facet" : {
            "type" : "string"
          },
          "Event_giang_sinh" : {
            "type" : "string"
          },
          "Event_giang_sinh_facet" : {
            "type" : "string"
          },
          "External_id" : {
            "type" : "long"
          },
          "Final_price" : {
            "type" : "long"
          },
          "Form_ao" : {
            "type" : "string"
          },
          "Form_ao_facet" : {
            "type" : "string"
          },
          "Gioi_tinh_su_dung" : {
            "type" : "string"
          },
          "Gthuc_kn_modem" : {
            "type" : "string"
          },
          "Gthuc_kn_modem_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Gthuc_kn_switch" : {
            "type" : "string"
          },
          "Hang_san_xuat" : {
            "type" : "string"
          },
          "Hang_san_xuat_dd1" : {
            "type" : "string"
          },
          "Hang_san_xuat_dd1_facet" : {
            "type" : "string"
          },
          "Hang_san_xuat_facet" : {
            "type" : "string"
          },
          "Hang_san_xuat_gd3" : {
            "type" : "string"
          },
          "Hang_san_xuat_gd3_facet" : {
            "type" : "string"
          },
          "Hang_sx_balo" : {
            "type" : "string"
          },
          "Hang_sx_balo_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_ban_phim" : {
            "type" : "string"
          },
          "Hang_sx_ban_phim_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_case" : {
            "type" : "string"
          },
          "Hang_sx_case_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_chuot" : {
            "type" : "string"
          },
          "Hang_sx_chuot_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_daudoc_nho" : {
            "type" : "string"
          },
          "Hang_sx_daudoc_nho_facet" : {
            "type" : "string"
          },
          "Hang_sx_loa" : {
            "type" : "string"
          },
          "Hang_sx_loa_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_loa_vitinh_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_loadanang" : {
            "type" : "string"
          },
          "Hang_sx_loadanang_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_md_bv_tt" : {
            "type" : "string"
          },
          "Hang_sx_md_bv_tt_facet" : {
            "type" : "string"
          },
          "Hang_sx_modem" : {
            "type" : "string"
          },
          "Hang_sx_modem_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_pin_dp" : {
            "type" : "string"
          },
          "Hang_sx_pin_dp_facet" : {
            "type" : "string"
          },
          "Hang_sx_pin_dtdd" : {
            "type" : "string"
          },
          "Hang_sx_pin_dtdd_facet" : {
            "type" : "string"
          },
          "Hang_sx_pin_laptop" : {
            "type" : "string"
          },
          "Hang_sx_pin_laptop_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_router" : {
            "type" : "string"
          },
          "Hang_sx_router_facet" : {
            "type" : "string"
          },
          "Hang_sx_sac_dt" : {
            "type" : "string"
          },
          "Hang_sx_sac_dt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_sac_laptop" : {
            "type" : "string"
          },
          "Hang_sx_sac_laptop_facet" : {
            "type" : "string"
          },
          "Hang_sx_switch" : {
            "type" : "string"
          },
          "Hang_sx_switch_facet" : {
            "type" : "string"
          },
          "Hang_sx_tai_nghe" : {
            "type" : "string"
          },
          "Hang_sx_tai_nghe_facet" : {
            "type" : "string"
          },
          "Hang_sx_tannhiet_lp" : {
            "type" : "string"
          },
          "Hang_sx_tannhiet_lp_facet" : {
            "type" : "string"
          },
          "Hang_sx_tblt" : {
            "type" : "string"
          },
          "Hang_sx_tblt_facet" : {
            "type" : "string"
          },
          "Hang_sx_the_nho" : {
            "type" : "string"
          },
          "Hang_sx_the_nho_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_usb" : {
            "type" : "string"
          },
          "Hang_sx_usb_3g" : {
            "type" : "string"
          },
          "Hang_sx_usb_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Hang_sx_webcam" : {
            "type" : "string"
          },
          "Hang_sx_webcam_facet" : {
            "type" : "string"
          },
          "Hangsx_dd_ban_ui" : {
            "type" : "string"
          },
          "Hangsx_dd_bepdientu" : {
            "type" : "string"
          },
          "Hangsx_dd_bepgas" : {
            "type" : "string"
          },
          "Hangsx_dd_binhdunnuoc" : {
            "type" : "string"
          },
          "Hangsx_dd_binhlocnuoc" : {
            "type" : "string"
          },
          "Hangsx_dd_chamsoc_canhan" : {
            "type" : "string"
          },
          "Hangsx_dd_den" : {
            "type" : "string"
          },
          "Hangsx_dd_dienco" : {
            "type" : "string"
          },
          "Hangsx_dd_laudien" : {
            "type" : "string"
          },
          "Hangsx_dd_maydanhtrung" : {
            "type" : "string"
          },
          "Hangsx_dd_mayduoicontrung" : {
            "type" : "string"
          },
          "Hangsx_dd_mayeptraicay" : {
            "type" : "string"
          },
          "Hangsx_dd_mayhutbui" : {
            "type" : "string"
          },
          "Hangsx_dd_maykhoan_cat" : {
            "type" : "string"
          },
          "Hangsx_dd_maylamsua" : {
            "type" : "string"
          },
          "Hangsx_dd_maylamsuachua" : {
            "type" : "string"
          },
          "Hangsx_dd_mayphacafe" : {
            "type" : "string"
          },
          "Hangsx_dd_mayvatcam" : {
            "type" : "string"
          },
          "Hangsx_dd_mayxaysinhto" : {
            "type" : "string"
          },
          "Hangsx_dd_noiapsuatdien" : {
            "type" : "string"
          },
          "Hangsx_dd_noicomdien" : {
            "type" : "string"
          },
          "Hangsx_dd_quat" : {
            "type" : "string"
          },
          "Hangsx_dd_thietbinuong" : {
            "type" : "string"
          },
          "Has_options" : {
            "type" : "boolean"
          },
          "He_dieu_hanh_facet" : {
            "type" : "string",
            "store" : true,
            "analyzer" : "wp_tag_analyzer"
          },
          "Hub_chatlieu" : {
            "type" : "string"
          },
          "Hub_chatlieu_facet" : {
            "type" : "string"
          },
          "Hub_hangsx" : {
            "type" : "string"
          },
          "Hub_hangsx_facet" : {
            "type" : "string"
          },
          "Hub_soluongdau" : {
            "type" : "string"
          },
          "Hub_soluongdau_facet" : {
            "type" : "string"
          },
          "Image" : {
            "type" : "string"
          },
          "Is_promotion" : {
            "type" : "long"
          },
          "Khonggian_kgs" : {
            "type" : "string"
          },
          "Khonggian_kgs_facet" : {
            "type" : "string"
          },
          "Kich_Thuoc" : {
            "type" : "string"
          },
          "Kich_Thuoc_Banh_Xe" : {
            "type" : "string"
          },
          "Kich_Thuoc_Textfield" : {
            "type" : "string"
          },
          "Kich_Thuoc_facet" : {
            "type" : "string"
          },
          "Kich_thuoc" : {
            "type" : "string"
          },
          "Kich_thuoc_banh_xe" : {
            "type" : "string"
          },
          "Kich_thuoc_be" : {
            "type" : "string"
          },
          "Kich_thuoc_be_1n" : {
            "type" : "string"
          },
          "Kich_thuoc_be_1n_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Kich_thuoc_be_facet" : {
            "type" : "string"
          },
          "Kich_thuoc_do_lot" : {
            "type" : "string"
          },
          "Kich_thuoc_do_lot_facet" : {
            "type" : "string"
          },
          "Kich_thuoc_elt" : {
            "type" : "string"
          },
          "Kich_thuoc_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Kich_thuoc_gd" : {
            "type" : "string"
          },
          "Kich_thuoc_gd_1" : {
            "type" : "string"
          },
          "Kich_thuoc_gd_2" : {
            "type" : "string"
          },
          "Kich_thuoc_gd_2_facet" : {
            "type" : "string"
          },
          "Kich_thuoc_gd_facet" : {
            "type" : "string"
          },
          "Kich_thuoc_textfield" : {
            "type" : "string"
          },
          "Kichthuoc_kgs" : {
            "type" : "string"
          },
          "Kichthuoc_kgs_facet" : {
            "type" : "string"
          },
          "Kichthuoc_man_hinh_facet" : {
            "type" : "string",
            "store" : true,
            "analyzer" : "wp_tag_analyzer"
          },
          "Kick_thuoc_be" : {
            "type" : "string"
          },
          "Kick_thuoc_be_facet" : {
            "type" : "string"
          },
          "Kieu_Co_Ao_2" : {
            "type" : "string"
          },
          "Kieu_Dang" : {
            "type" : "string"
          },
          "Kieu_Dang_Do_The_Thao" : {
            "type" : "string"
          },
          "Kieu_Dang_facet" : {
            "type" : "string"
          },
          "Kieu_Giay" : {
            "type" : "string"
          },
          "Kieu_Vanh" : {
            "type" : "string"
          },
          "Kieu_ao_thun" : {
            "type" : "string"
          },
          "Kieu_ao_thun_facet" : {
            "type" : "string"
          },
          "Kieu_co_ao" : {
            "type" : "string"
          },
          "Kieu_co_ao_2" : {
            "type" : "string"
          },
          "Kieu_co_ao_facet" : {
            "type" : "string"
          },
          "Kieu_dan_len" : {
            "type" : "string"
          },
          "Kieu_dan_len_facet" : {
            "type" : "string"
          },
          "Kieu_dang" : {
            "type" : "string"
          },
          "Kieu_dang_do_the_thao" : {
            "type" : "string"
          },
          "Kieu_dang_do_the_thao_facet" : {
            "type" : "string"
          },
          "Kieu_dang_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Kieu_dat_dt" : {
            "type" : "string"
          },
          "Kieu_dat_dt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Kieu_diu" : {
            "type" : "string"
          },
          "Kieu_diu_facet" : {
            "type" : "string"
          },
          "Kieu_giay" : {
            "type" : "string"
          },
          "Kieu_giay_bot" : {
            "type" : "string"
          },
          "Kieu_giay_bot_facet" : {
            "type" : "string"
          },
          "Kieu_giay_facet" : {
            "type" : "string"
          },
          "Kieu_loa" : {
            "type" : "string"
          },
          "Kieu_loa_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Kieu_man_loc" : {
            "type" : "string"
          },
          "Kieu_mui_giay" : {
            "type" : "string"
          },
          "Kieu_mui_giay_facet" : {
            "type" : "string"
          },
          "Kieu_quan" : {
            "type" : "string"
          },
          "Kieu_quan_facet" : {
            "type" : "string"
          },
          "Kieu_tai_nghe" : {
            "type" : "string"
          },
          "Kieu_tai_nghe_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Kieu_tay_ao" : {
            "type" : "string"
          },
          "Kieu_tay_ao_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Kieu_truyen_router" : {
            "type" : "string"
          },
          "Kieu_truyen_router_facet" : {
            "type" : "string"
          },
          "Kieu_vanh" : {
            "type" : "string"
          },
          "Loadn_congkn" : {
            "type" : "string"
          },
          "Loadn_congkn_facet" : {
            "type" : "string"
          },
          "Loadn_dungcho" : {
            "type" : "string"
          },
          "Loadn_dungcho_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Loadn_nguon" : {
            "type" : "string"
          },
          "Loadn_nguon_facet" : {
            "type" : "string"
          },
          "Loadn_tinhnang" : {
            "type" : "string"
          },
          "Loadn_tinhnang_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Loai_Ao_Phao" : {
            "type" : "string"
          },
          "Loai_Bom_Xe_Dap" : {
            "type" : "string"
          },
          "Loai_Den" : {
            "type" : "string"
          },
          "Loai_Giay_Patin" : {
            "type" : "string"
          },
          "Loai_Khoa" : {
            "type" : "string"
          },
          "Loai_Khung_Xe_Dap" : {
            "type" : "string"
          },
          "Loai_Leu" : {
            "type" : "string"
          },
          "Loai_Pin" : {
            "type" : "string"
          },
          "Loai_Pin_Xe_Dap" : {
            "type" : "string"
          },
          "Loai_Vanh_Xe_Dap" : {
            "type" : "string"
          },
          "Loai_Xe_Dap_Tre_Em" : {
            "type" : "string"
          },
          "Loai_ao_phao" : {
            "type" : "string"
          },
          "Loai_balo" : {
            "type" : "string"
          },
          "Loai_balo_facet" : {
            "type" : "string"
          },
          "Loai_balo_tui" : {
            "type" : "string"
          },
          "Loai_balo_tui_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Loai_bd_mtb" : {
            "type" : "string"
          },
          "Loai_bd_mtb_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Loai_bom_xe_dap" : {
            "type" : "string"
          },
          "Loai_ca_vat" : {
            "type" : "string"
          },
          "Loai_ca_vat_facet" : {
            "type" : "string"
          },
          "Loai_chuot" : {
            "type" : "string"
          },
          "Loai_chuot_facet" : {
            "type" : "string"
          },
          "Loai_co" : {
            "type" : "string"
          },
          "Loai_danh_lua" : {
            "type" : "string"
          },
          "Loai_den" : {
            "type" : "string"
          },
          "Loai_dep" : {
            "type" : "string"
          },
          "Loai_dep_facet" : {
            "type" : "string"
          },
          "Loai_dienthoai" : {
            "type" : "string"
          },
          "Loai_dienthoai_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Loai_dung_cu_tennis" : {
            "type" : "string"
          },
          "Loai_giay_patin" : {
            "type" : "string"
          },
          "Loai_giay_the_thao" : {
            "type" : "string"
          },
          "Loai_giay_the_thao_facet" : {
            "type" : "string"
          },
          "Loai_hddbox" : {
            "type" : "string"
          },
          "Loai_hddbox_facet" : {
            "type" : "string"
          },
          "Loai_khan" : {
            "type" : "string"
          },
          "Loai_khan_facet" : {
            "type" : "string"
          },
          "Loai_khan_nam" : {
            "type" : "string"
          },
          "Loai_khan_nam_facet" : {
            "type" : "string"
          },
          "Loai_khoa" : {
            "type" : "string"
          },
          "Loai_khung_xe_dap" : {
            "type" : "string"
          },
          "Loai_kn_elt" : {
            "type" : "string"
          },
          "Loai_kn_elt_facet" : {
            "type" : "string"
          },
          "Loai_laptop_facet" : {
            "type" : "string",
            "store" : true,
            "analyzer" : "wp_tag_analyzer"
          },
          "Loai_leu" : {
            "type" : "string"
          },
          "Loai_man_hinh" : {
            "type" : "string"
          },
          "Loai_man_hinh_facet" : {
            "type" : "string"
          },
          "Loai_mang_loc" : {
            "type" : "string"
          },
          "Loai_may" : {
            "type" : "string"
          },
          "Loai_may_facet" : {
            "type" : "string"
          },
          "Loai_may_hut_bui" : {
            "type" : "string"
          },
          "Loai_nang_luong" : {
            "type" : "string"
          },
          "Loai_phu_kien_giay" : {
            "type" : "string"
          },
          "Loai_pin" : {
            "type" : "string"
          },
          "Loai_pin_xe_dap" : {
            "type" : "string"
          },
          "Loai_sac" : {
            "type" : "string"
          },
          "Loai_sac_facet" : {
            "type" : "string"
          },
          "Loai_tai_nghe" : {
            "type" : "string"
          },
          "Loai_tai_nghe_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Loai_tat" : {
            "type" : "string"
          },
          "Loai_tat_facet" : {
            "type" : "string"
          },
          "Loai_the_nho" : {
            "type" : "string"
          },
          "Loai_the_nho_facet" : {
            "type" : "string"
          },
          "Loai_trang_suc" : {
            "type" : "string"
          },
          "Loai_trang_suc_facet" : {
            "type" : "string"
          },
          "Loai_vali" : {
            "type" : "string"
          },
          "Loai_vali_facet" : {
            "type" : "string"
          },
          "Loai_vanh_xe_dap" : {
            "type" : "string"
          },
          "Loai_vo_phuc" : {
            "type" : "string"
          },
          "Loai_vu_khi" : {
            "type" : "string"
          },
          "Loai_xe_dap_tre_em" : {
            "type" : "string"
          },
          "Mac_address_table" : {
            "type" : "string"
          },
          "Mac_address_table_facet" : {
            "type" : "string"
          },
          "Management_switch" : {
            "type" : "string"
          },
          "Mau_Sac" : {
            "type" : "string"
          },
          "Mau_Sac_facet" : {
            "type" : "string"
          },
          "Mau_sac" : {
            "type" : "string"
          },
          "Mau_sac_elt" : {
            "type" : "string"
          },
          "Mau_sac_elt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Mau_sac_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Meta_description" : {
            "type" : "string"
          },
          "Meta_keyword" : {
            "type" : "string"
          },
          "Model_elt" : {
            "type" : "string"
          },
          "Model_elt_facet" : {
            "type" : "string"
          },
          "Modem_kieu_dt" : {
            "type" : "string"
          },
          "Modem_nguon" : {
            "type" : "string"
          },
          "Modem_nguon_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Modem_thietbi" : {
            "type" : "string"
          },
          "Modem_thietbi_facet" : {
            "type" : "string"
          },
          "Modem_tocdotruyen" : {
            "type" : "string"
          },
          "Mua" : {
            "type" : "string"
          },
          "Mua_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Muc_Dich_Su_Dung_Tt" : {
            "type" : "string"
          },
          "Muc_dich_su_dung" : {
            "type" : "string"
          },
          "Muc_dich_su_dung_facet" : {
            "type" : "string"
          },
          "Muc_dich_su_dung_tt" : {
            "type" : "string"
          },
          "Muc_dich_su_dung_tt_facet" : {
            "type" : "string"
          },
          "Nam_sx_elt" : {
            "type" : "string"
          },
          "Nam_sx_elt_facet" : {
            "type" : "string"
          },
          "Name" : {
            "type" : "string",
            "store" : true,
            "term_vector" : "with_positions_offsets",
            "index_analyzer" : "translation_index_analyzer",
            "search_analyzer" : "translation_search_analyzer"
          },
          "Nang_luong_su_dung" : {
            "type" : "string"
          },
          "Nang_luong_su_dung_facet" : {
            "type" : "string"
          },
          "Ngayle_kgs" : {
            "type" : "string"
          },
          "Ngayle_kgs_facet" : {
            "type" : "string"
          },
          "Nguon_dien_ra_elt" : {
            "type" : "string"
          },
          "Nguon_dien_switch" : {
            "type" : "string"
          },
          "Nguon_dien_switch_facet" : {
            "type" : "string"
          },
          "Nguon_dien_vao_elt" : {
            "type" : "string"
          },
          "Nguon_goc_elt" : {
            "type" : "string"
          },
          "Nguon_goc_elt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Nhan_hieu" : {
            "type" : "string"
          },
          "Nhan_hieu_be" : {
            "type" : "string"
          },
          "Nhan_hieu_be_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Nhan_hieu_be_thuc_pham" : {
            "type" : "string"
          },
          "Nhan_hieu_be_thuc_pham_facet" : {
            "type" : "string"
          },
          "Nhan_hieu_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Nhan_hieu_thucpham1" : {
            "type" : "string"
          },
          "Nhan_hieu_thucpham3" : {
            "type" : "string"
          },
          "Nhan_hieu_thucpham4" : {
            "type" : "string"
          },
          "Nhan_hieu_thucpham5" : {
            "type" : "string"
          },
          "Norder" : {
            "type" : "long"
          },
          "Nut_cuon_elt" : {
            "type" : "string"
          },
          "Nut_cuon_elt_facet" : {
            "type" : "string"
          },
          "Order_count" : {
            "properties" : {
              "Dd_10" : {
                "type" : "long"
              },
              "Dd_1000" : {
                "type" : "long"
              },
              "Dd_1000_cod" : {
                "type" : "long"
              },
              "Dd_15_cod" : {
                "type" : "long"
              },
              "Dd_30" : {
                "type" : "long"
              },
              "Dd_30_cod" : {
                "type" : "long"
              },
              "Dd_7" : {
                "type" : "long"
              },
              "Dd_7_cod" : {
                "type" : "long"
              },
              "Rank" : {
                "type" : "long"
              },
              "dd_1000" : {
                "type" : "long"
              },
              "dd_14" : {
                "type" : "long"
              },
              "dd_3" : {
                "type" : "long"
              },
              "dd_7" : {
                "type" : "long"
              }
            }
          },
          "Order_count_dd_10" : {
            "type" : "long"
          },
          "Order_count_dd_1000" : {
            "type" : "long"
          },
          "Order_count_dd_1000_cod" : {
            "type" : "long"
          },
          "Order_count_dd_14" : {
            "type" : "long"
          },
          "Order_count_dd_14_cod" : {
            "type" : "long"
          },
          "Order_count_dd_15" : {
            "type" : "long"
          },
          "Order_count_dd_15_cod" : {
            "type" : "long"
          },
          "Order_count_dd_3" : {
            "type" : "long"
          },
          "Order_count_dd_30" : {
            "type" : "long"
          },
          "Order_count_dd_30_cod" : {
            "type" : "long"
          },
          "Order_count_dd_7" : {
            "type" : "long"
          },
          "Order_count_dd_7_cod" : {
            "type" : "long"
          },
          "Order_count_rank" : {
            "type" : "long"
          },
          "Phan_dan_md_bv_tt" : {
            "type" : "string"
          },
          "Phan_dan_md_bv_tt_facet" : {
            "type" : "string"
          },
          "Phan_loai" : {
            "type" : "string"
          },
          "Phan_loai_be" : {
            "type" : "string"
          },
          "Phan_loai_be_facet" : {
            "type" : "string"
          },
          "Phan_loai_dd1" : {
            "type" : "string"
          },
          "Phan_loai_dd1_facet" : {
            "type" : "string"
          },
          "Phan_loai_facet" : {
            "type" : "string"
          },
          "Phan_loai_gd" : {
            "type" : "string"
          },
          "Phan_loai_gd_1" : {
            "type" : "string"
          },
          "Phan_loai_gd_1_facet" : {
            "type" : "string"
          },
          "Phan_loai_gd_3" : {
            "type" : "string"
          },
          "Phan_loai_gd_facet" : {
            "type" : "string"
          },
          "Pin_dtdd_dungcho" : {
            "type" : "string"
          },
          "Price" : {
            "type" : "long"
          },
          "Price_sort" : {
            "type" : "long"
          },
          "Product_id" : {
            "type" : "long"
          },
          "Promotion_percent" : {
            "type" : "long"
          },
          "Promotion_start_date" : {
            "type" : "long"
          },
          "Promotion_version_no" : {
            "type" : "long"
          },
          "Quy_cach_dong_goi_be" : {
            "type" : "string"
          },
          "Quy_cach_dong_goi_be_1" : {
            "type" : "string"
          },
          "Quy_cach_dong_goi_be_4" : {
            "type" : "string"
          },
          "Quy_cach_dong_goi_be_5" : {
            "type" : "string"
          },
          "Quy_cach_dong_goi_be_facet" : {
            "type" : "string"
          },
          "Rank_search" : {
            "type" : "double"
          },
          "Rating" : {
            "type" : "long"
          },
          "Required_options" : {
            "type" : "string"
          },
          "Ring_size" : {
            "type" : "string"
          },
          "Ring_size_facet" : {
            "type" : "string"
          },
          "Sacdt_dung_may_dt" : {
            "type" : "string"
          },
          "Sacdt_dung_may_dt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Saclt_dung_cho" : {
            "type" : "string"
          },
          "Saclt_dung_cho_facet" : {
            "type" : "string"
          },
          "Shop_free_shipping" : {
            "type" : "long"
          },
          "Shop_info" : {
            "properties" : {
              "Shop_external" : {
                "type" : "long"
              },
              "Shop_id" : {
                "type" : "long"
              },
              "Shop_name" : {
                "type" : "string"
              },
              "Shop_username" : {
                "type" : "string"
              }
            }
          },
          "Sku" : {
            "type" : "string"
          },
          "So_Luong_Txt_Elt" : {
            "type" : "string"
          },
          "So_cong_kn_switch" : {
            "type" : "string"
          },
          "So_cong_kn_switch_facet" : {
            "type" : "string"
          },
          "So_diem_anh" : {
            "type" : "string"
          },
          "So_diem_anh_facet" : {
            "type" : "string"
          },
          "So_luong_txt_elt" : {
            "type" : "string"
          },
          "So_luong_txt_elt_facet" : {
            "type" : "string"
          },
          "So_nut_elt" : {
            "type" : "string"
          },
          "So_nut_elt_facet" : {
            "type" : "string"
          },
          "Special_price" : {
            "type" : "long"
          },
          "Status" : {
            "type" : "long"
          },
          "Status_new" : {
            "type" : "long"
          },
          "Stock_status" : {
            "type" : "long"
          },
          "Tac_dung_be" : {
            "type" : "string"
          },
          "Tac_dung_be_facet" : {
            "type" : "string"
          },
          "Tags_key" : {
            "type" : "string"
          },
          "Tai_nghe_su_dung_muti" : {
            "type" : "string"
          },
          "Tai_nghe_su_dung_muti_facet" : {
            "type" : "string"
          },
          "Tainghe_tinhnang" : {
            "type" : "string"
          },
          "Tainghe_tinhnang_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Tblt_card" : {
            "type" : "string"
          },
          "Tblt_card_facet" : {
            "type" : "string"
          },
          "Tblt_interface" : {
            "type" : "string"
          },
          "Tblt_interface_facet" : {
            "type" : "string"
          },
          "Tblt_phukien" : {
            "type" : "string"
          },
          "Tblt_sovongquay" : {
            "type" : "string"
          },
          "Tblt_sovongquay_facet" : {
            "type" : "string"
          },
          "Td_truyen_tbmang" : {
            "type" : "string"
          },
          "Td_truyen_tbmang_facet" : {
            "type" : "string"
          },
          "Theloaitranh_kgs" : {
            "type" : "string"
          },
          "Theloaitranh_kgs_facet" : {
            "type" : "string"
          },
          "Thoi_Gian_Sac_Dien" : {
            "type" : "string"
          },
          "Thoi_gian_cho_elt" : {
            "type" : "string"
          },
          "Thoi_gian_goi_elt" : {
            "type" : "string"
          },
          "Thoi_gian_sac_dien" : {
            "type" : "string"
          },
          "Time_sd_pin_laptop" : {
            "type" : "string"
          },
          "Tinh" : {
            "type" : "string"
          },
          "Tinh_nang_be" : {
            "type" : "string"
          },
          "Tinh_nang_be_1" : {
            "type" : "string"
          },
          "Tinh_nang_be_facet" : {
            "type" : "string"
          },
          "Tinh_nang_bep_dien" : {
            "type" : "string"
          },
          "Tinh_nang_binh_loc" : {
            "type" : "string"
          },
          "Tinh_nang_may_cafe" : {
            "type" : "string"
          },
          "Tinh_nang_may_duoi_contrung" : {
            "type" : "string"
          },
          "Tinh_nang_may_sua" : {
            "type" : "string"
          },
          "Tinh_nang_may_sua_facet" : {
            "type" : "string"
          },
          "Tinh_nang_may_xaysinhto" : {
            "type" : "string"
          },
          "Tinh_nang_noi_apsuat" : {
            "type" : "string"
          },
          "Tinh_nang_noi_comdien" : {
            "type" : "string"
          },
          "Tinh_nang_quat" : {
            "type" : "string"
          },
          "Tinhnang_router" : {
            "type" : "string"
          },
          "Tinhnang_router_facet" : {
            "type" : "string"
          },
          "Toc_do_khung_hinh" : {
            "type" : "string"
          },
          "Toc_do_khung_hinh_facet" : {
            "type" : "string"
          },
          "Tocdo_kn_usb_3g" : {
            "type" : "string"
          },
          "Tocdo_truyen_thenho" : {
            "type" : "string"
          },
          "Tocdo_truyen_thenho_facet" : {
            "type" : "string"
          },
          "Total_comment" : {
            "type" : "long"
          },
          "Trong_Luong_Textfield" : {
            "type" : "string"
          },
          "Trong_luong_textfield" : {
            "type" : "string"
          },
          "Trong_luong_thucpham" : {
            "type" : "string"
          },
          "Tuong_thich_bd_dtdd" : {
            "type" : "string"
          },
          "Tuong_thich_bd_dtdd_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Tuong_thich_bd_mtb" : {
            "type" : "string"
          },
          "Tuong_thich_bd_mtb_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Tuong_thich_md_bv_tt" : {
            "type" : "string"
          },
          "Tuong_thich_md_bv_tt_facet" : {
            "type" : "string"
          },
          "Tuong_thich_text_elt" : {
            "type" : "string"
          },
          "Type_product" : {
            "type" : "long"
          },
          "Url" : {
            "type" : "string"
          },
          "Url_key" : {
            "type" : "string"
          },
          "User_defined_atts" : {
            "type" : "string"
          },
          "VasUp" : {
            "type" : "long"
          },
          "Vasup" : {
            "type" : "long"
          },
          "Xuat_Xu" : {
            "type" : "string"
          },
          "Xuat_Xu_facet" : {
            "type" : "string"
          },
          "Xuat_xu" : {
            "type" : "string"
          },
          "Xuat_xu_elt" : {
            "type" : "string"
          },
          "Xuat_xu_elt_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "Xuat_xu_facet" : {
            "type" : "string",
            "analyzer" : "wp_tag_analyzer"
          },
          "shop_info" : {
            "type" : "nested",
            "include_in_parent" : true,
            "properties" : {
              "shop_Id" : {
                "type" : "string"
              },
              "shop_UserName" : {
                "type" : "string"
              },
              "shop_external" : {
                "type" : "string"
              },
              "shop_id" : {
                "type" : "long"
              },
              "shop_name" : {
                "type" : "string"
              },
              "shop_username" : {
                "type" : "string"
              }
            }
          }
        }
      }
    }
  }
}

.kibana index question

I came across a blog that talked about this project for dumping Kibana 4's Visualizations and Dashboards from, http://air.ghost.io/kibana-4-export-and-import-visualizations-and-dashboards/. However, I took a look at http://localhost:9200/.kibana and didn't see any names of the Visualizations or Dashboards that I have created.

Is there something that I'm missing?

Here's the dump of http://localhost:9200/.kibana:

{
  ".kibana":{
      "aliases":{},
      "mappings":{"config":{"properties":{"buildNum":{"type":"long"},
                                          "defaultIndex":{"type":"string"}}},
                  "index-pattern":{"properties":{"customFormats":{"type":"string"},
                                                 "fields":{"type":"string"},
                                                 "intervalName":{"type":"string"},
                                                 "timeFieldName":{"type":"string"},
                                                 "title":{"type":"string"}}},
                  "dashboard":{"properties":{"description":{"type":"string"},
                                             "hits":{"type":"integer"},
                                             "kibanaSavedObjectMeta":{"properties":{"searchSourceJSON":{"type":"string"}}},
                                             "panelsJSON":{"type":"string"},
                                             "title":{"type":"string"},
                                             "version":{"type":"integer"}}},
                  "visualization":{"properties":{"description":{"type":"string"},
                                                 "kibanaSavedObjectMeta":{"properties":{"searchSourceJSON":{"type":"string"}}},
                                                 "savedSearchId":{"type":"string"},
                                                 "title":{"type":"string"},
                                                 "version":{"type":"integer"},
                                                 "visState":{"type":"string"}}},
                  "search":{"properties":{"columns":{"type":"string"},
                                          "description":{"type":"string"},
                                          "hits":{"type":"integer"},
                                          "kibanaSavedObjectMeta":{"properties":{"searchSourceJSON":{"type":"string"}}},
                                          "sort":{"type":"string"},
                                          "title":{"type":"string"},
                                          "version":{"type":"integer"}}}},
      "settings":{"index":{"creation_date":"1433286524288",
                           "uuid":"c84SfPj1RKOculVsDvD7rQ",
                           "number_of_replicas":"1",
                           "number_of_shards":"1",
                           "version":{"created":"1050299"}}},
      "warmers":{}
  }
}

bulk mapping

sometimes you want to copy an entire cluster (bulk). You need to copy mappings first, but we have no bulk mapping option

SyntaxError: Unexpected end of input

I have started elasticdump of 36 million documents. After 2 million document job has been failed. Following is the command that i hv been used for dump.

elasticdump --input=http:// --output=/home/prod/data/data.json --scrollTime=10d --limit=200 >> logd.log

I tried it couple of time, got same error ...

SyntaxError: Unexpected end of input
at Object.parse (native)
at Request.requestResonse as _callback
at Request.self.callback (/usr/lib/node_modules/elasticdump/node_modules/request/request.js:123:22)
at Request.emit (events.js:98:17)
at Request. (/usr/lib/node_modules/elasticdump/node_modules/request/request.js:1047:14)
at Request.emit (events.js:117:20)
at IncomingMessage. (/usr/lib/node_modules/elasticdump/node_modules/request/request.js:998:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:929:16
at process._tickCallback (node.js:419:13)
[

Later i hv restarted with --ignore-errors and --scrollTime = 15d. Job is running, but i am not sure about will it dump all records or some of wll miss.

Output file formats

Would it be possible to have a flag that would alter the output format?
Specifically I am needing my output in a file of newline delimited jsons so I can use the data with other tools.
While it isn't hard to massage the data into the desired format, it would be cool if the tool had this functionality.

No help output

Current:

% elasticdump -h
Wed, 28 Jan 2015 00:39:04 GMT | starting dump
Wed, 28 Jan 2015 00:39:04 GMT | connect ECONNREFUSED
Wed, 28 Jan 2015 00:39:04 GMT | got 0 objects from source elasticsearch (offset: 0)
Wed, 28 Jan 2015 00:39:04 GMT | sent 0 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 00:39:04 GMT | dump complete

% elasticdump --help
Wed, 28 Jan 2015 00:39:17 GMT | starting dump
Wed, 28 Jan 2015 00:39:17 GMT | connect ECONNREFUSED
Wed, 28 Jan 2015 00:39:17 GMT | got 0 objects from source elasticsearch (offset: 0)
Wed, 28 Jan 2015 00:39:17 GMT | sent 0 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 00:39:17 GMT | dump complete

Expected:

Some form of help output explaining usage and listing available options.

Also, the above output suggests that invalid options are simply ignored, which is probably not a good behavior.

Readme says --input and --output options are required, yet this does not seem to be the case. What is the default output?

Writing to file is very slow

Hi,

I dump a very large index. It fetch the results fast but when it is writing them to file it writes them very slowly. Is there any limitation?

synchronous dump()

Is this the right place to ask a question? Anyway, I was curious if there's a way to make the dump() function blocking. I am trying to modify the code to dump each index individually, but it starts on the second index before the first is complete ... not sure how to change that behavior.

elasticdump crash

[root@rndeslogs1 ~]# ./node_modules/elasticdump/bin/elasticdump --input=http://localhost:9200/jaguaringestion --output=http://localhost:9200/jaguaringestionv2 --type=data --limit=300
Fri, 01 Aug 2014 20:50:59 GMT | starting dump
Fri, 01 Aug 2014 20:51:00 GMT | got 300 objects from source elasticsearch (offset: 0)
Fri, 01 Aug 2014 20:51:09 GMT | sent 300 objects to destination elasticsearch, wrote 300
Fri, 01 Aug 2014 20:51:09 GMT | got 300 objects from source elasticsearch (offset: 300)
Fri, 01 Aug 2014 20:51:13 GMT | sent 300 objects to destination elasticsearch, wrote 300
...
Fri, 01 Aug 2014 20:52:40 GMT | got 300 objects from source elasticsearch (offset: 5100)
Fri, 01 Aug 2014 20:52:44 GMT | sent 300 objects to destination elasticsearch, wrote 300
Fri, 01 Aug 2014 20:52:44 GMT | got 300 objects from source elasticsearch (offset: 5400)
Fri, 01 Aug 2014 20:52:50 GMT | sent 300 objects to destination elasticsearch, wrote 300
Fri, 01 Aug 2014 20:52:50 GMT | got 300 objects from source elasticsearch (offset: 5700)
Fri, 01 Aug 2014 20:52:55 GMT | sent 300 objects to destination elasticsearch, wrote 300
Fri, 01 Aug 2014 20:52:55 GMT | got 300 objects from source elasticsearch (offset: 6000)
Fri, 01 Aug 2014 20:53:00 GMT | sent 300 objects to destination elasticsearch, wrote 300
Fri, 01 Aug 2014 20:53:00 GMT | got 300 objects from source elasticsearch (offset: 6300)
Fri, 01 Aug 2014 20:53:05 GMT | sent 300 objects to destination elasticsearch, wrote 300

TypeError: Cannot read property 'statusCode' of undefined
at Request.requestResonse as _callback
at self.callback (/root/node_modules/elasticdump/node_modules/request/request.js:123:22)
at Request.EventEmitter.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (/root/node_modules/elasticdump/node_modules/request/request.js:244:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketOnEnd as onend
at Socket.g (events.js:180:16)
at Socket.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)

Exit code is 0 even when error occurs

I did mapping recovery. By mistake (apparently) did it to http://.../ instead of http://.../byindex. No errors shown, exit code 0. In tcpdump I'm seeing this:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=UTF-8
Content-Length: 105

{"error":"ActionRequestValidationException[Validation Failed: 1: mapping type is missing;]","status":400}

and the command does not work

connect EADDRNOTAVAIL

After about 30 seconds of importing the data into elasticsearch we get:

Tue, 17 Mar 2015 14:26:33 GMT | connect EADDRNOTAVAIL
Tue, 17 Mar 2015 14:26:33 GMT | dump ended with error (set phase) => Error: connect EADDRNOTAVAIL

Export Import not working on Windows 7

I am trying to use the following commands with two separate cluster/node i.e they have different cluster.names in same machine. The index and mapping I am trying these commands with is the one elasticsearch provided in the initial documents.

Localhost 9400 is running ES 1.4.0
Localhost 9200 is running ES 1.4.4

Operating system is windows 7.
elasticsearch-dumb is installed globally.

I am running these commands in cygwin.

Mapping

elasticdump --input=localhost:9400/shakespeare --output=localhost:9200/shakespeare --type=mapping

Thu, 26 Feb 2015 15:09:45 GMT | starting dump

Data

elasticdump --input=localhost:9400/shakespeare --output=localhost:9200/shakespeare --type=data

Thu, 26 Feb 2015 15:08:38 GMT | starting dump

However, it makes no visible changes in mapping or indices of cluster/node running at localhost:9200.

Unhelpful/incorrect error message

Fix for #67, as implemented in #69, added an error message which reads:

Tue, 17 Feb 2015 06:43:58 GMT | Unable to obtain scrollId; This tends to indicate an error with your index(es)

In actuality, this error only occurs (presumably) when the elasticsearch instance has no indexes, which is not exactly an error condition.

The message should be reworded to something like "Unable to obtain scrollId: elasticsearch instance has no indexes".

Where did my data go?

I used:

% zcat elasticsearch-dump.json.gz| elasticdump --input=\$ --output=http://localhost:9200/       
Wed, 28 Jan 2015 17:40:21 GMT | starting dump
Wed, 28 Jan 2015 17:40:22 GMT | got 9003 objects from source stdio (offset: 0)
Wed, 28 Jan 2015 17:41:38 GMT | sent 9003 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:41:39 GMT | got 9168 objects from source stdio (offset: 9003)
Wed, 28 Jan 2015 17:42:55 GMT | sent 9168 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:42:56 GMT | got 9319 objects from source stdio (offset: 18171)
Wed, 28 Jan 2015 17:44:14 GMT | sent 9319 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:44:15 GMT | got 9223 objects from source stdio (offset: 27490)
Wed, 28 Jan 2015 17:45:32 GMT | sent 9223 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:45:34 GMT | got 9084 objects from source stdio (offset: 36713)
Wed, 28 Jan 2015 17:46:50 GMT | sent 9084 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:46:52 GMT | got 9201 objects from source stdio (offset: 45797)
Wed, 28 Jan 2015 17:48:09 GMT | sent 9201 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:48:10 GMT | got 9039 objects from source stdio (offset: 54998)
Wed, 28 Jan 2015 17:49:26 GMT | sent 9039 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:49:27 GMT | got 9050 objects from source stdio (offset: 64037)
Wed, 28 Jan 2015 17:50:43 GMT | sent 9050 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:50:45 GMT | got 9176 objects from source stdio (offset: 73087)
Wed, 28 Jan 2015 17:52:01 GMT | sent 9176 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:52:02 GMT | got 9078 objects from source stdio (offset: 82263)
Wed, 28 Jan 2015 17:53:18 GMT | sent 9078 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:53:20 GMT | got 9127 objects from source stdio (offset: 91341)
Wed, 28 Jan 2015 17:54:36 GMT | sent 9127 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:54:37 GMT | got 9110 objects from source stdio (offset: 100468)
Wed, 28 Jan 2015 17:55:53 GMT | sent 9110 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:55:55 GMT | got 9105 objects from source stdio (offset: 109578)
Wed, 28 Jan 2015 17:57:11 GMT | sent 9105 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:57:12 GMT | got 9202 objects from source stdio (offset: 118683)
Wed, 28 Jan 2015 17:58:30 GMT | sent 9202 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:58:31 GMT | got 8902 objects from source stdio (offset: 127885)
Wed, 28 Jan 2015 17:59:46 GMT | sent 8902 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 17:59:47 GMT | got 8889 objects from source stdio (offset: 136787)
Wed, 28 Jan 2015 18:01:02 GMT | sent 8889 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:01:03 GMT | got 8882 objects from source stdio (offset: 145676)
Wed, 28 Jan 2015 18:02:17 GMT | sent 8882 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:02:19 GMT | got 8888 objects from source stdio (offset: 154558)
Wed, 28 Jan 2015 18:03:33 GMT | sent 8888 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:03:34 GMT | got 8864 objects from source stdio (offset: 163446)
Wed, 28 Jan 2015 18:04:49 GMT | sent 8864 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:04:50 GMT | got 8885 objects from source stdio (offset: 172310)
Wed, 28 Jan 2015 18:06:05 GMT | sent 8885 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:06:07 GMT | got 8920 objects from source stdio (offset: 181195)
Wed, 28 Jan 2015 18:07:22 GMT | sent 8920 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:07:23 GMT | got 8887 objects from source stdio (offset: 190115)
Wed, 28 Jan 2015 18:08:38 GMT | sent 8887 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:08:39 GMT | got 8844 objects from source stdio (offset: 199002)
Wed, 28 Jan 2015 18:09:54 GMT | sent 8844 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:09:55 GMT | got 8890 objects from source stdio (offset: 207846)
Wed, 28 Jan 2015 18:11:10 GMT | sent 8890 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:11:11 GMT | got 8886 objects from source stdio (offset: 216736)
Wed, 28 Jan 2015 18:12:25 GMT | sent 8886 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:12:26 GMT | got 8915 objects from source stdio (offset: 225622)
Wed, 28 Jan 2015 18:13:41 GMT | sent 8915 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:13:42 GMT | got 8911 objects from source stdio (offset: 234537)
Wed, 28 Jan 2015 18:14:57 GMT | sent 8911 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:14:58 GMT | got 8925 objects from source stdio (offset: 243448)
Wed, 28 Jan 2015 18:16:13 GMT | sent 8925 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:16:14 GMT | got 8961 objects from source stdio (offset: 252373)
Wed, 28 Jan 2015 18:17:30 GMT | sent 8961 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:17:31 GMT | got 8944 objects from source stdio (offset: 261334)
Wed, 28 Jan 2015 18:18:46 GMT | sent 8944 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:18:48 GMT | got 8944 objects from source stdio (offset: 270278)
Wed, 28 Jan 2015 18:20:03 GMT | sent 8944 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:20:04 GMT | got 8940 objects from source stdio (offset: 279222)
Wed, 28 Jan 2015 18:21:19 GMT | sent 8940 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:21:21 GMT | got 9016 objects from source stdio (offset: 288162)
Wed, 28 Jan 2015 18:22:36 GMT | sent 9016 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:22:38 GMT | got 8882 objects from source stdio (offset: 297178)
Wed, 28 Jan 2015 18:23:52 GMT | sent 8882 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:23:54 GMT | got 9508 objects from source stdio (offset: 306060)
Wed, 28 Jan 2015 18:25:14 GMT | sent 9508 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:25:15 GMT | got 9016 objects from source stdio (offset: 315568)
Wed, 28 Jan 2015 18:26:31 GMT | sent 9016 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:26:32 GMT | got 8903 objects from source stdio (offset: 324584)
Wed, 28 Jan 2015 18:27:47 GMT | sent 8903 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:27:48 GMT | got 8935 objects from source stdio (offset: 333487)
Wed, 28 Jan 2015 18:29:03 GMT | sent 8935 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:29:05 GMT | got 8993 objects from source stdio (offset: 342422)
Wed, 28 Jan 2015 18:30:20 GMT | sent 8993 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:30:22 GMT | got 8887 objects from source stdio (offset: 351415)
Wed, 28 Jan 2015 18:31:36 GMT | sent 8887 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:31:38 GMT | got 8930 objects from source stdio (offset: 360302)
Wed, 28 Jan 2015 18:32:53 GMT | sent 8930 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:32:54 GMT | got 8977 objects from source stdio (offset: 369232)
Wed, 28 Jan 2015 18:34:09 GMT | sent 8977 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:34:10 GMT | got 5932 objects from source stdio (offset: 378209)
Wed, 28 Jan 2015 18:35:00 GMT | sent 5932 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:35:01 GMT | got 8953 objects from source stdio (offset: 384141)
Wed, 28 Jan 2015 18:36:17 GMT | sent 8953 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:36:18 GMT | got 8965 objects from source stdio (offset: 393094)
Wed, 28 Jan 2015 18:37:33 GMT | sent 8965 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:37:34 GMT | got 8922 objects from source stdio (offset: 402059)
Wed, 28 Jan 2015 18:38:49 GMT | sent 8922 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:38:50 GMT | got 8947 objects from source stdio (offset: 410981)
Wed, 28 Jan 2015 18:40:06 GMT | sent 8947 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:40:07 GMT | got 8907 objects from source stdio (offset: 419928)
Wed, 28 Jan 2015 18:41:22 GMT | sent 8907 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:41:23 GMT | got 8891 objects from source stdio (offset: 428835)
Wed, 28 Jan 2015 18:42:38 GMT | sent 8891 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:42:39 GMT | got 9028 objects from source stdio (offset: 437726)
Wed, 28 Jan 2015 18:43:55 GMT | sent 9028 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:43:56 GMT | got 8968 objects from source stdio (offset: 446754)
Wed, 28 Jan 2015 18:45:11 GMT | sent 8968 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:45:12 GMT | got 8944 objects from source stdio (offset: 455722)
Wed, 28 Jan 2015 18:46:26 GMT | sent 8944 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:46:27 GMT | got 8929 objects from source stdio (offset: 464666)
Wed, 28 Jan 2015 18:47:42 GMT | sent 8929 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:47:43 GMT | got 8883 objects from source stdio (offset: 473595)
Wed, 28 Jan 2015 18:48:58 GMT | sent 8883 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:48:59 GMT | got 8929 objects from source stdio (offset: 482478)
Wed, 28 Jan 2015 18:50:14 GMT | sent 8929 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:50:16 GMT | got 9004 objects from source stdio (offset: 491407)
Wed, 28 Jan 2015 18:51:31 GMT | sent 9004 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:51:32 GMT | got 8995 objects from source stdio (offset: 500411)
Wed, 28 Jan 2015 18:52:48 GMT | sent 8995 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:52:49 GMT | got 3234 objects from source stdio (offset: 509406)
Wed, 28 Jan 2015 18:53:16 GMT | sent 3234 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:53:16 GMT | got 0 objects from source stdio (offset: 512640)
Wed, 28 Jan 2015 18:53:16 GMT | sent 0 objects to destination elasticsearch, wrote 0
Wed, 28 Jan 2015 18:53:16 GMT | dump complete

Now when I try to see my indexes:

% curl 'localhost:9200/_cat/indices?v'
health status index pri rep docs.count docs.deleted store.size pri.store.size 

Where was the data loaded?

What modifications to make for large indices

I started using this tool today after coming across it on HN last week to move some index from prod to test but it took over 9 hours just to complete one index. There were close to 1.9M records and I set the limit to 10000 record with bulk true. I noticed any higher than 10K and elasticdump would crash. I realize that network latency probably played a role as the prod servers are in west coast where as test is on the east coast but I feel there is more tweaking in the settings i could make to accomplish this much faster. How does scrollTime affect and if it is taking roughly 6 mins for each 10K dump to complete, is the default good enough? are there more tweaks I can make to maybe the ES configuration to further facilitate this. The index I am moving is already closed and optimized.Not sure if that helps or not.

of course it is possible that I am SOL and I may have maxed out my options but wondering if you guys can help suggest anything more.

undefined "_index": ".kibana",

I'm trying to import my Kibana 4 saved Queries, Visualizations and DashBoards.

When I try to import I get:

Mon, 30 Mar 2015 13:47:39 GMT | starting dump

undefined:1
"_index": ".kibana",
        ^
SyntaxError: Unexpected token :
    at Object.parse (native)
    at /usr/lib/node_modules/elasticdump/lib/transports/file.js:45:27
    at getLine (/usr/lib/node_modules/elasticdump/node_modules/line-reader/lib/line_reader.js:74:9)
    at LineReader.nextLine (/usr/lib/node_modules/elasticdump/node_modules/line-reader/lib/line_reader.js:93:9)
    at file.getLines (/usr/lib/node_modules/elasticdump/lib/transports/file.js:37:17)
    at /usr/lib/node_modules/elasticdump/lib/transports/file.js:51:12
    at getLine (/usr/lib/node_modules/elasticdump/node_modules/line-reader/lib/line_reader.js:74:9)
    at LineReader.nextLine (/usr/lib/node_modules/elasticdump/node_modules/line-reader/lib/line_reader.js:93:9)
    at file.getLines (/usr/lib/node_modules/elasticdump/lib/transports/file.js:37:17)
    at /usr/lib/node_modules/elasticdump/lib/transports/file.js:51:12

My export command:

elasticdump --input=http://135.60.151.232:9200/.kibana --output=$ --type=data --searchBody='{"filter": { "or": [ {"type": {"value": "dashboard"}}, {"type" : {"value":"visualization"}}] }}' > kibana-exported.json

My import command:

elasticdump --input=kibana.json --output=http://MyIp:9200/.kibana --type=data

When I browse to http://MyIp:9200/.kibana I can see this:

{".kibana":{"aliases":{},"mappings":{"config":{"properties":{"buildNum":{"type":"long"}}}},"settings":{"index":{"creation_date":"1427722524272","uuid":"QIa46E0zRImVekm0RRGvPg","number_of_replicas":"1","number_of_shards":"1","version":{"created":"1050099"}}},"warmers":{}}}

Add option to input/output line separated json

Please add support for line separated json files:

{ "_id": "1", .....}
{ "_id": "2", .....}
{ "_id": "3", .....}

Compared to current:

[
{ "_id": "1", .....},
{ "_id": "2", .....},
{ "_id": "3", .....}
]

This would make it easier to use with stream processing tools like (grep, awk, sed, jq, ...)

Detecting elasticsearch input/output conflicts with windows paths

These two lines cause issues when running on Windows:

https://github.com/taskrabbit/elasticsearch-dump/blob/ffed53f7e0fd7c67b30a6a65cfdf989a04d7f4db/elasticdump.js#L28
https://github.com/taskrabbit/elasticsearch-dump/blob/ffed53f7e0fd7c67b30a6a65cfdf989a04d7f4db/elasticdump.js#L42

Code is looking for ':' to determine whether or not an input/output is an elasticsearch url, however, Windows file paths contain ':' (e.g. C:\fTemp).

Discovered in this issue: godaddy/kibana4-backup#4

(btw, great tool!)

When using Bulk API the actual output index name is ignored

When using the Bulk API (--bulk option set to true) to save documents, the documents are saved on the destination in an index with the same name as the index it came from, regardless of the index name present on the output URL.

This happens because the Elasticsearch (ES) Bulk API requires one to name the destination index for each document and the current implementation copies that information from the source record (was, at some point, here).

This makes this option not usable when used when input and output are on the same ES server or copying from many indices to a single one (using wildcards), and slightly misleading when on different servers, as the actual destination index name is silently ignored. I think that this should at least be noted on the usage and docs.

One good idea, IMHO, is to simple remove the _index parameter of the action so the index being sent on the URL is used, as explained here: http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/bulk.html#_don_8217_t_repeat_yourself

If the original behavior is actually wanted, by any reason, then it could be activated by an command line option.

Wrong type guessing on bulk import

Not a error, but to clarify on doc:

I tried this morning to bulk import all indexes from one cluster to a new one.
To avoid having to move all data into an intermediate file and then to the cluster I did:

$ elasticsearch-dump --all=true --bulk=true --input=http://fromhere:9200/ --output=http://tothere:9200/

It worked, but we have some indexes with geoshape and geopoint field types that had been converted from:

"polygon" : { "tree_levels" : 10, "type" : "geo_shape" },
"center" : { "lat_lon" : true, "type" : "geo_point" },

to:

"polygon" : { "properties" : { "type" : { "type" : "string" }, "coordinates" : { "type" : "double" } } },
"center" : { "properties" : { "lon" : { "type" : "double" }, "lat" : { "type" : "double" } } },

If you first create the indexes mappings (one by one), then the --all=true --bulk=true --input=host1 --output=host2 will work fine.

It would be nice to be able to limit the number or rows to dump in a run.
$ elasticdump --limit=1000 --offset=350000 --maxrows=20000 --input=host1 --output=host2 --bulk=true_or_false

By the way, congratulations, this is a great tool !!

quotes are disappearing from searchBody (PowerShell)

I'm sure it's more related to PowerShell, but just in case you know the solution.

> elasticdump --input=http://gofra2:9200/gofra/notifications --output=test.json --searchBody '{"query":{"term":{"username": "admin"}}}'
undefined:1
{query:{term:{username: admin}}}
 ^
SyntaxError: Unexpected token q
    at Object.parse (native)
    at Object.<anonymous> (C:\Users\vorou\AppData\Roaming\npm\node_modules\elasticdump\bin\elasticdump:40:23)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

As you can see there is no quotes in the error message, and so JSON parsing fails.

Now, without quotes:

> elasticdump --input=http://gofra2:9200/gofra/notifications --output=test.json --searchBody {"query":{"term":{"username": "admin"}}}
Unexpected token ':' in expression or statement.

And with double quotes:

> elasticdump --input=http://gofra2:9200/gofra/notifications --output=test.json --searchBody "{"query":{"term":{"username": "admin"}}}"
undefined:1
{

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at Object.<anonymous> (C:\Users\vorou\AppData\Roaming\npm\node_modules\elasticdump\bin\elasticdump:40:23)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

So much love for PowerShell. Any ideas?

Exporting an index then importing as a different index name

I'm probably missing something here but I had to do a search/replace in my exported json file to adjust the index name to then import into a different index name.

Was there a parameter or method that would allow elasticdump to do this for me?

Cheers.

repository is missing a LICENSE file

This repository is missing a LICENSE file, so it's not clear what permissions you're granting users of the software.

Please add a LICENSE file or otherwise indicate under what license this software is being distributed.

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.