dynamic-mapping.asciidoc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. [[dynamic-mapping]]
  2. == Dynamic mapping
  3. One of the most important features of {es} is that it tries to get
  4. out of your way and let you start exploring your data as quickly as possible.
  5. To index a document, you don't have to first create an index, define a mapping
  6. type, and define your fields -- you can just index a document and the index,
  7. type, and fields will display automatically:
  8. [source,console]
  9. --------------------------------------------------
  10. PUT data/_doc/1 <1>
  11. { "count": 5 }
  12. --------------------------------------------------
  13. <1> Creates the `data` index, the `_doc` mapping type, and a field
  14. called `count` with data type `long`.
  15. The automatic detection and addition of new fields is called
  16. _dynamic mapping_. The dynamic mapping rules can be customized to suit your
  17. purposes with:
  18. <<dynamic-field-mapping,Dynamic field mappings>>::
  19. The rules governing dynamic field detection.
  20. <<dynamic-templates,Dynamic templates>>::
  21. Custom rules to configure the mapping for dynamically added fields.
  22. TIP: <<index-templates,Index templates>> allow you to configure the default
  23. mappings, settings and aliases for new indices, whether created
  24. automatically or explicitly.
  25. include::dynamic/field-mapping.asciidoc[]
  26. include::dynamic/templates.asciidoc[]