Mapping

I mentioned earlier that Elasticsearch doesn't require a data structure to be defined for the document types. However, Elasticsearch internally figures out the structure of the data that we insert. We have the ability to define this structure manually but don't necessarily need to. When Elasticsearch uses its own guess of the data structure, it's said to be using a dynamic mapping for the document type. Let's look at what Elasticsearch guessed for our product document type. Using the command line, make the following request with curl:

> curl 'http://localhost:9200/daintree/products/_mapping?pretty' { "daintree" : { "mappings" : { "products" : { "properties" : { "category" : { "type" : "string" }, "name" : { "type" : "string" }, "price" ...

Get Django Project Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.