0

I have the following JSON format and want to create a mapping for it from Elasticsearch console :

{
  "properties": {
    "@timestamp" : {
     "type" : "date"
    },
    "list": [
      {
        "name": "John",
        "age": "37",
        "title": "Tester"
      }
    ]
  }
}

1 Answer 1

3

There's no list or array type in ES, you simply declare objects and then you can add a list of those objects to your documents:

PUT your-index
{
   "mappings": {
      "properties": {
         "@timestamp" : {
            "type" : "date"
         },
         "list": {
            "type": "object",
            "properties": {
               "name": {
                  "type": "text"
               },
               "age": {
                  "type": "integer"
               },
               "title": {
                  "type": "text"
               }
            }
         }
      }
   }
}
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.