[Why] { "error":{ "root_cause":[{ "type":"illegal_argument_exception", "reason":"The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." }], "type":"illegal_argument_exception", "reason":"The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." }, "status":400 }
Signed-off-by: Lu Weitao luweitaobe@163.com --- sbin/es-accounts-mapping.sh | 34 ++++++++++----------- sbin/es-jobs-mapping.sh | 2 -- sbin/es-regression-mapping.sh | 16 +++++----- sbin/es-repo-mapping.sh | 56 +++++++++++++++++------------------ 4 files changed, 50 insertions(+), 58 deletions(-)
diff --git a/sbin/es-accounts-mapping.sh b/sbin/es-accounts-mapping.sh index d04b0f3..c4ac2fc 100755 --- a/sbin/es-accounts-mapping.sh +++ b/sbin/es-accounts-mapping.sh @@ -12,24 +12,22 @@ else echo "begin create index." curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/accounts' -d '{ "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "my_commit_url": { - "type": "keyword" - }, - "my_token": { - "type": "keyword" - }, - "my_email": { - "type": "keyword" - }, - "my_name": { - "type": "keyword" - }, - "my_login_name": { - "type": "keyword" - } + "dynamic": false, + "properties": { + "my_commit_url": { + "type": "keyword" + }, + "my_token": { + "type": "keyword" + }, + "my_email": { + "type": "keyword" + }, + "my_name": { + "type": "keyword" + }, + "my_login_name": { + "type": "keyword" } } } diff --git a/sbin/es-jobs-mapping.sh b/sbin/es-jobs-mapping.sh index edc6159..1c4aa43 100755 --- a/sbin/es-jobs-mapping.sh +++ b/sbin/es-jobs-mapping.sh @@ -37,7 +37,6 @@ else echo "jobs index not exists, begin create index." curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/jobs' -d '{ "mappings": { - "_doc": { "dynamic": false, "dynamic_templates": [ { @@ -166,7 +165,6 @@ else "format": "yyyy-MM-dd HH:mm:ss" } } - } } }' if [ $? -ne 0 ] diff --git a/sbin/es-regression-mapping.sh b/sbin/es-regression-mapping.sh index 8e04bdb..5ae0f71 100755 --- a/sbin/es-regression-mapping.sh +++ b/sbin/es-regression-mapping.sh @@ -10,15 +10,13 @@ else echo "begin create index." curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/regression' -d '{ "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "error_id": { - "type": "keyword" - }, - "job_id": { - "type": "keyword" - } + "dynamic": false, + "properties": { + "error_id": { + "type": "keyword" + }, + "job_id": { + "type": "keyword" } } } diff --git a/sbin/es-repo-mapping.sh b/sbin/es-repo-mapping.sh index 17f0986..290efb3 100755 --- a/sbin/es-repo-mapping.sh +++ b/sbin/es-repo-mapping.sh @@ -11,35 +11,33 @@ echo 'Start to create "repo" index.' curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/repo' -d ' { "mappings": { - "_doc": { - "properties": { - "git_repo": { - "type": "keyword" - }, - "pkgbuild_repo": { - "type": "keyword" - }, - "url": { - "type": "keyword" - }, - "fetch_time": { - "type": "keyword" - }, - "new_refs_time": { - "type": "keyword" - }, - "offset_fetch": { - "type": "long" - }, - "offset_new_refs": { - "type": "long" - }, - "priority": { - "type": "long" - }, - "queued": { - "type": "boolean" - } + "properties": { + "git_repo": { + "type": "keyword" + }, + "pkgbuild_repo": { + "type": "keyword" + }, + "url": { + "type": "keyword" + }, + "fetch_time": { + "type": "keyword" + }, + "new_refs_time": { + "type": "keyword" + }, + "offset_fetch": { + "type": "long" + }, + "offset_new_refs": { + "type": "long" + }, + "priority": { + "type": "long" + }, + "queued": { + "type": "boolean" } } }