Перезаписать значение по умолчанию для индекса вasticsearch - PullRequest
0 голосов
/ 12 апреля 2019

Эластичный поисковый сервер версии 6.7.1 версия драйвера python 6.3.1

request_body = {
    "settings": {
        "index" : {"number_of_shards" : 1, "number_of_replicas" : 0 
      }},
    "mappings": {
        "document": {"dynamic": "strict","properties": {
                "doc_name": { "type": "text"},                   
                "doc_location" : { "type" : "text" },
                "doc_keywords": { "type": "nested","properties": {
                        "dynamic": "true","tag": {"type": "text"},
                        "score": {"type": "text"}
                    } } }} }}
 es_object.indices.create(index="tutorial",ignore=400,body=request_body)

С помощью клиента Python создается индекс, но с настройками по умолчанию в качестве основного сегмента 5 и реплик 1. команда curl проиндексированные данные с правильной указанной настройкой. Я что-то пропустил, чтобы установить?

curl -XPUT 'http://server_ip:9200/documentrepository/' -H 'Content-Type: application/json' -d '{
    "settings": {
            "number_of_shards": 1,
            "number_of_replicas": 0
        },
        "mappings": {
            "document": {
                "dynamic": "strict",
                "properties": {
                    "doc_name": { "type": "text"},                   
                    "doc_s3_location" : { "type" : "text" },
                    "doc_keywords": {
                        "type": "nested",
                        "properties": {"tag": {"type": "text"},"score": {"type": "text"}
                        }
                  }
              }
           }
       }
}'

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...