Fix eleastisearch field limit
[oom.git] / kubernetes / pomba / charts / pomba-search-data / resources / config / es-payload-translation.json
index de8bacf..58ed8f6 100644 (file)
@@ -1,19 +1,16 @@
 {
-  "attr-translations": [{
-      "from": "\"type\":\"string\",\"index\":\"analyzed\"",
-      "to": "\"type\":\"text\",\"index\":\"true\""
-    },
+  "attr-translations": [       
     {
-      "from": "\"type\":\"string\",\"index\":\"not_analyzed\"",
-      "to": "\"type\":\"keyword\",\"index\":\"true\""
+      "query": "$..[?(@.type=='string' && @.index=='analyzed')]",
+      "update": {"type": "text", "index": true, "fielddata": true}
     },
     {
-      "from": "\"type\":\"string\"",
-      "to": "\"type\":\"text\""
+      "query": "$..[?(@.type=='string' && @.index=='not_analyzed')]",
+      "update": {"type": "keyword", "index": true}
     },
     {
-      "from": "searchable",
-      "to": "index"
+      "query": "$..[?(@.type=='string' && !@.index)]",
+      "update": {"type": "text", "fielddata": true}
     }
   ]
 }
\ No newline at end of file