elasticsearch,config,Json,Indexing,elasticsearch,Config" /> elasticsearch,config,Json,Indexing,elasticsearch,Config" />

配置不使用json的elasticsearch索引

配置不使用json的elasticsearch索引,json,indexing,elasticsearch,config,Json,Indexing,elasticsearch,Config,我使用以下json来配置elasticsearch。目标是一次性设置索引和类型(这是设置docker图像的要求)。这是我所能做到的,这将使elasticsearch成功启动。问题是索引尚未创建,但不会出错。我尝试过的其他形式阻止服务启动 { "cluster": { "name": "MyClusterName" }, "node": { "name": "MyNodeName" }, "indices": { "number_of_shards": 4, "i

我使用以下json来配置elasticsearch。目标是一次性设置索引和类型(这是设置docker图像的要求)。这是我所能做到的,这将使elasticsearch成功启动。问题是索引尚未创建,但不会出错。我尝试过的其他形式阻止服务启动

 {
"cluster": {
    "name": "MyClusterName"
},
"node": {
    "name": "MyNodeName"
},
"indices": {
    "number_of_shards": 4,
    "index.number_of_replicas": 4
},
"index": {
    "analysis": {
        "analyzer": {
            "my_ngram_analyzer": {
                "tokenizer": "my_ngram_tokenizer",
                "filter": "lowercase"
            },
            "my_lowercase_whitespace_analyzer": {
                "tokenizer": "whitespace",
                "filter": "lowercase"
            }
        },
        "tokenizer": {
            "my_ngram_tokenizer": {
                "type": "nGram",
                "min_gram": "2",
                "max_gram": "20"
            }
        }
    },
    "index": {
        "settings": {
            "_id": "indexindexer"
        },
        "mappings": {
            "inventoryIndex": {
                "_id": {
                    "path": "indexName"
                },
                "_routing": {
                    "required": true,
                    "path": "indexName"
                },
                "properties": {
                    "indexName": {
                        "type": "string",
                        "index": "not_analyzed"
                    },
                    "startedOn": {
                        "type": "date",
                        "index": "not_analyzed"
                    },
                    "deleted": {
                        "type": "boolean",
                        "index": "not_analyzed"
                    },
                    "deletedOn": {
                        "type": "date",
                        "index": "not_analyzed"
                    },
                    "archived": {
                        "type": "boolean",
                        "index": "not_analyzed"
                    },
                    "archivedOn": {
                        "type": "date",
                        "index": "not_analyzed"
                    },
                    "failure": {
                        "type": "boolean",
                        "index": "not_analyzed"
                    },
                    "failureOn": {
                        "type": "date",
                        "index": "not_analyzed"
                    }
                }
            }
        }
      }
   }
 }
我可能有一个在开机后脚本中使用curl的解决方法,但我更喜欢在配置文件中处理配置


谢谢

elasticsearch似乎不允许在一个yml中完成所有配置。我发现的解决方法是创建一个索引模板并将其放置在
/templates/
目录中,然后在旋转服务之后,我使用curl创建索引。索引匹配将捕获它并根据模板提供它