使用以下代码建立索引时,由于找不到未知字段解析器而产生错误:
client.reindex({
body: {
script: {
source: {
index: index,
type: "_doc",
query: {
term: {
id: id
}
}
},
dest: {
index: dest_ind
}
}
}
}
答案 0 :(得分:2)
将dest
放在外部,而不是嵌套在script
-https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html
client.reindex({
body: {
source: {
index: index,
type: "_doc",
query: {
term: {
id: id
}
}
},
dest: {
index: dest_ind
}
}
})