1

I read the Tutorial to "Custom type field", When I run this code: the code

The error was reported: the error

I hope someone can help me.thanks.

  [1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#_parent_child_without_mapping_types
1
  • Try updating source in script to inline. see this: qbox.io/blog/… Commented Sep 18, 2017 at 14:06

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.