# Elasticsearch mapping config synchronization

## Description

There is a synchronization issue between the production Elasticsearch "schema" and the test (local) environment "schema". To synchronize both "schemes", a rake task`es:dump_mapping`was created in oma-models repo.

`es:dump_mapping`rake tasks fetches specified mapping config data for a specified index from a specified host:port.

## Usage

```
cd oma-models
rake es:dump_mapping`
```

### Example target run

```
$ rake es:dump_mapping
---------------------------------------------------------------------
Elasticsearch URL: elasticsearch.omamatic.com:9200 (Y/n)

Enter index name (example: influencers_staging)
backlinks
Enter type (example: entity)
backlink_es
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3115  100  3115    0     0   4825      0 --:--:-- --:--:-- --:--:-- 13369
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   410  100   410    0     0    879      0 --:--:-- --:--:-- --:--:--  1767
---------------------------------------------------------------------
{
  "mappings": {
    "backlink_es": {
      "dynamic": "false",
      "properties": {
        "alt": {
          "type": "string",
          "analyzer": "snowball"
        },
        "anchor_text": {
...
---------------------------------------------------------------------
Mapping will be stored to backlinks_20140425100633.json
---------------------------------------------------------------------
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://omalab.gitbook.io/guide/engineering-wiki/testing/elasticsearch-mapping-config-synchronization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
