Skip to content

How to create a custom ES mapping "from scratch" using Maestro.

Anders Richardsson edited this page Mar 1, 2024 · 1 revision

Maestro needs an index created before starting the service, otherwise it’ll create one with the default mappings in https://github.com/overture-stack/maestro/tree/master/maestro-app/src/main/resources. When that happens, it doesn't account for the schemas setup in song (for multiple reasons, but mostly complexity and edge case avoidance), so the "initial" mapping will most likely not work for most projects. The less-than-ideal approach to create your own custom mapping, so that Arranger can consume the data, is:

  • start Maestro, letting it do this initially or not makes no difference, the point is to have maestro boot.
  • from the default mappings, capture the "autocomplete", settings and analyser aspects to each *-centric index (the mapping for each index is somewhat different).
  • nuke those indexes from Elasticsearch. This is the key part here to gather the new fields.
  • ask Maestro to index the data, at which point it assumes that mapping is already set.
  • Elasticsearch will then infer the mapping for the data on its own, as a mix of the fields in the Maestro defaults and the song schema, but without all the "autocomplete 'magic'".
  • then get that mapping, cross-reference the fields with the default mapping gathered before.
  • manually recreate the index from scratch with that custom mapping (not through Maestro).
  • then restart maestro, index again
  • profit!
Clone this wiki locally