How I fixed my Elasticsearch index mapping

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • I created an Elasticsearch/OpenSearch index mapping that couldn't answer questions I asked it, so I built two alternative mappings for the same data.
    One is a very wide, dynamic, and update-heavy mapping that's easy to query. The other is strict and tidy, but uses nested documents. There are pros and cons to each, and I discuss those.
    Three costumes for the same data!

КОМЕНТАРІ • 6

  • @kickinit333
    @kickinit333 Рік тому +1

    Great video. I've been using ES since pre-1.0 beta so I have too many mapping horror stories to even begin but yeah, changing mappings can be as painful as updating a data type in a large database.
    I never found a good use case for nested docs. In many cases, it was easier to just make a new index with the new mapping.
    I always, always use index aliases to minimize reporting downtime. Took me a few late nights to finally do that.
    Cheers.

    • @GeorgeBridgemanData
      @GeorgeBridgemanData  Рік тому +1

      I'm the opposite - I've seen plenty of use-cases for nested docs but usually try to find a way to completely overhaul the mapping, or put the data into another system, to avoid needing them. Whenever I think I need them, a siren goes off in my head and I do whatever I can to find an alternative!
      You're absolutely right about aliases. They're essential!

    • @kickinit333
      @kickinit333 Рік тому

      @@GeorgeBridgemanData Good to know. Thanks!

  • @wendel.s.l
    @wendel.s.l Рік тому +1

    Great video! I am sorry to ask an off-topic question, but here it goes: can anyone recommend videos or texts about upgrading ES from 7.9 to 8.1 with "minimal trouble"? Thanks.

    • @GeorgeBridgemanData
      @GeorgeBridgemanData  Рік тому

      Thanks very much!
      Is there any specific reason you wouldn't upgrade to 8.4 or even 8.5?
      I'm not sure about 'minimal trouble'! You'll need to upgrade to 7.17 first, even if you're targeting an upgrade to 8.1. The upgrade steps are quite simple but orchestrating everything, especially on a fairly large cluster, can be a pain. There are a couple of pages on the Elastic docs site that will probably help:
      www.elastic.co/guide/en/elastic-stack/8.1/upgrading-elastic-stack.html#prepare-to-upgrade
      www.elastic.co/guide/en/elastic-stack/8.1/upgrading-elasticsearch.html
      If your cluster is larger than even just a few nodes, using some form of automation is a good idea. Ansible can help a lot.

    • @wendel.s.l
      @wendel.s.l Рік тому

      @@GeorgeBridgemanData Thanks for the reply.
      Here we have a dozen clusters with 3 nodes each.
      There is no specific reason not to upgrade to 8.4 or 8.5. Do you think it is more productive upgrading to the latest version?