Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hint for Array mappings (simple and complex types) #14151

Closed
jeffsteinmetz opened this issue Oct 16, 2015 · 1 comment
Closed

Add hint for Array mappings (simple and complex types) #14151

jeffsteinmetz opened this issue Oct 16, 2015 · 1 comment

Comments

@jeffsteinmetz
Copy link

It seems like a "hint" would be helpful to projects like elasticsearch-hadoop / spark if the mappings exposed when a json array is expected.
elastic/elasticsearch-hadoop#484
elastic/elasticsearch-hadoop#482

It may also be useful for tools like Kibana.
A hint such as "array": true

  • (side note, this hint is unrelated to nested object mapping via "type: "nested": Similar to but really more of a hint vs. a nested mapping that actually changes how it is indexed.)

such as

  "mappings": {
    "foo": {
      "properties": {
        "bar": {
          "array": true, 
          "properties": {
            "name":    { "type": "string"  },
            "scores":   { "type": "string", "array": true }
          }
        }
      }
    }
  }
}

which would provide hints to json documents such as

{"foo" : { "bar" : ["name": "jeff", "scores": [10,20,30], "name" : "bob", "scores" : [5,10] ] } }
@clintongormley
Copy link

Hi @jeffsteinmetz

Any field in Elasticsearch can be an array or a single value, so I don't like adding the array parameter as a hint. However, this kind of application specific extra mapping info can be stored in the mapping in the _meta field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants