0

I have a field which is a 3d array, and don't want ES to index it.

The problem is how to write its type in mapping? Should I use {index: false} or {enabled: false}?

1 Answer 1

1

You can use enabled only at the mapping type level (i.e. for the whole type) or for object types.

Since you have an array, you simply need to use index: false instead.

The field can simply have a type text (+ keyword if you need exact matches) since the array will be flattened:

      "my_field": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for you answer. But what type should be specified? If I omit type field, it complains that "No type specified for field [xxx]"
You need to set the type that matches the type of your data. Can you show a sample 3d array that you have?
It's something like this: {"my_field": [[["a-1", "a-2"], ["b-1", "b-2"]], [["c-1", "c-2"], ["d-1", "d-2"]]]}.

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.