我阅读了教程to "Custom type field", 当我运行此代码时:
报告错误:
我希望有人可以帮助我。谢谢。
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#_parent_child_without_mapping_types
答案 0 :(得分:1)
I recently bumped into this, but my solution was a little different.
I believe the ElasticSearch documentation here concerning scripting with reindex
might be incorrect, or at least it did not work for me.
Instead of using source
in the following:
"script": {
"source": "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}",
"lang": "painless"
}
I had to use inline
:
"script": {
"inline": "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}",
"lang": "painless"
}
And then, worked like a charm. Checked with raw HTTP requests and python ElasticSearch client. This was on ElasticSearch version 5.5.1.