mapper.asciidoc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. [[index-modules-mapper]]
  2. == Mapper
  3. The mapper module acts as a registry for the type mapping definitions
  4. added to an index either when creating it or by using the put mapping
  5. api. It also handles the dynamic mapping support for types that have no
  6. explicit mappings pre defined. For more information about mapping
  7. definitions, check out the <<mapping,mapping section>>.
  8. [float]
  9. === Dynamic / Default Mappings
  10. Dynamic mappings allow to automatically apply generic mapping definition
  11. to types that do not have mapping pre defined or applied to new mapping
  12. definitions (overridden). This is mainly done thanks to the fact that
  13. the `object` type and namely the root `object` type allow for schema
  14. less dynamic addition of unmapped fields.
  15. The default mapping definition is plain mapping definition that is
  16. embedded within ElasticSearch:
  17. [source,js]
  18. --------------------------------------------------
  19. {
  20. _default_ : {
  21. }
  22. }
  23. --------------------------------------------------
  24. Pretty short, no? Basically, everything is defaulted, especially the
  25. dynamic nature of the root object mapping. The default mapping
  26. definition can be overridden in several manners. The simplest manner is
  27. to simply define a file called `default-mapping.json` and placed it
  28. under the `config` directory (which can be configured to exist in a
  29. different location). It can also be explicitly set using the
  30. `index.mapper.default_mapping_location` setting.
  31. Dynamic creation of mappings for unmapped types can be completely
  32. disabled by setting `index.mapper.dynamic` to `false`.