source-mode-setting.asciidoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. [[troubleshoot-migrate-source-mode]]
  2. == Configuring source mode in mappings is deprecated and replaced by an index setting
  3. Index <<mapping-source-field,source>> mode was previously configured in mappings as follows:
  4. [source,js]
  5. ----
  6. "mappings": {
  7. "source": {
  8. "mode": "synthetic"
  9. },
  10. "foo": {
  11. "type": "keyword"
  12. },
  13. "bar": {
  14. "type": "keyword"
  15. }
  16. }
  17. ----
  18. // NOTCONSOLE
  19. Starting with version 8.18, this method for configuring the source mode is considered
  20. deprecated and replaced by index setting `index.mapping.source.mode` that accepts the
  21. same values: `stored`, `synthetic` and `disabled`. The index setting can be
  22. used as follows:
  23. [source,js]
  24. ----
  25. "settings": {
  26. "index.mapping.source.mode": "synthetic"
  27. }
  28. "mappings": {
  29. "foo": {
  30. "type": "keyword"
  31. },
  32. "bar": {
  33. "type": "keyword"
  34. }
  35. }
  36. ----
  37. // NOTCONSOLE
  38. Existing indexes using the deprecated method for configuring the source mode are not
  39. affected, but creating new indexes raises warnings and will not be supported in a future
  40. release. This can be an issue for data streams and other indexes that get regularly
  41. generated using component templates. To avoid these problems, identify all affected
  42. component templates, as shown in the <<migration-api-deprecation,deprecation info API>>,
  43. and update them to use setting `index.mapping.source.mode` instead of
  44. `mappings.source.mode`, according to the examples above.