diff --git a/grimoire_elk/raw/kitsune.py b/grimoire_elk/raw/kitsune.py index cc9925338..fc84a6174 100644 --- a/grimoire_elk/raw/kitsune.py +++ b/grimoire_elk/raw/kitsune.py @@ -20,9 +20,44 @@ # from .elastic import ElasticOcean +from grimoire_elk.elastic_mapping import Mapping as BaseMapping + + +class Mapping(BaseMapping): + + @staticmethod + def get_elastic_mappings(es_major): + """Get Elasticsearch mapping. + + :param es_major: major version of Elasticsearch, as string + :returns: dictionary with a key, 'items', with the mapping + """ + + mapping = ''' + { + "dynamic":true, + "properties": { + "data": { + "properties": { + "metadata": { + "dynamic":false, + "properties": { + "value": { + "type": "text", + "index": true + } + } + } + } + } + } + } + ''' + + return {"items": mapping} class KitsuneOcean(ElasticOcean): """Kitsune Ocean feeder""" - pass + mapping = Mapping diff --git a/releases/unreleased/kitsune-raw-mapping-updated.yml b/releases/unreleased/kitsune-raw-mapping-updated.yml new file mode 100644 index 000000000..6bec9867c --- /dev/null +++ b/releases/unreleased/kitsune-raw-mapping-updated.yml @@ -0,0 +1,9 @@ +--- +title: Kitsune raw mapping updated +category: added +author: Jose Javier Merchante +issue: null +notes: > + Update the mapping for Kitsune backend to fix an error + inserting Perceval items in the raw index when the field + 'data.metadata.value' is too big.