Retour aux cas pratiques
ElasticsearchFondamental

Correction d’un champ mal typé empêchant une agrégation

Scénario

Contexte : Une application souhaite effectuer une agrégation sur le champ category d’un index produits. Le Problème : Le champ category est défini en type text uniquement. Mapping actuel : "category": { "type": "text" } Les agrégations échouent car le champ n’est pas de type keyword. Contraintes : Corriger le mapping sans perdre la capacité de recherche textuelle. Permettre à la fois la recherche et les agrégations. Livrable attendu : Proposer un mapping adapté (multi-field text + keyword) permettant d’effectuer des agrégations sur category.

Compétences ciblées

mappingkeywordaggregationbugfixsearch
    Correction d’un champ mal typé empêchant une agrégation — mise en situation Elasticsearch | CodeDuel