Skip to content

Commit

Permalink
[raw/kitsune] Include mapping for data.metadata.value too big
Browse files Browse the repository at this point in the history
This commit includes the mapping for Kitsune to fix an error
inserting Perceval items when the field 'data.metadata.value'
is too big.

Signed-off-by: Jose Javier Merchante <[email protected]>
  • Loading branch information
jjmerchante committed Feb 23, 2024
1 parent 4131795 commit 0f4e848
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
37 changes: 36 additions & 1 deletion grimoire_elk/raw/kitsune.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions releases/unreleased/kitsune-raw-mapping-updated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Kitsune raw mapping updated
category: added
author: Jose Javier Merchante <[email protected]>
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.

0 comments on commit 0f4e848

Please sign in to comment.