Mapping

  • Defines how document and its fields are stored and indexed
  • Mapping can be derived dynamically by ElasticSearch
  • Handful core data types are supported
  • Mapping can be added to existing index for new fields
  • Existing field mapping not always possible to modify
  • ElasticSearch will derive mapping for new type and for new fields:
    curl -XPOST localhost:9200/ordering/order/1 -d '
    {"id": "1", "placedOn": "2016-10-17T13:03:30.830Z"}'
    
  • Retrieving existing mappings:
    curl 'localhost:9200/ordering/order/_mapping?pretty=true'
    
  • Expected response:
    {
    "ordering" : {
      "mappings" : {
        "order" : {
          "properties" : {
            "id" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "placedOn" : {
              "type" : "date"
            }
          }
        }
      }
    }
    }
    
  • Rich support for date-time formats

results matching ""

    No results matching ""