Skip to content

Commit b85e72e

Browse files
pickypgjordansissel
authored andcommitted
Disable fielddata use for analyzed strings
By default, users should not be sorting, aggregating, or scripting against the analyzed string variant of fields. Instead, users should do those things against the `.raw` multifield variant. This _will_ prevent the use of `significant_terms` aggregation against the associated field, which will be undesirable in rare cases. Given the rarity of that need, I would much rather have those users manually enable fielddata explicitly for the field (it is dynamically updatable!). Fixes #309
1 parent bc900c7 commit b85e72e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: lib/logstash/outputs/elasticsearch/elasticsearch-template.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"match" : "message",
1212
"match_mapping_type" : "string",
1313
"mapping" : {
14-
"type" : "string", "index" : "analyzed", "omit_norms" : true
14+
"type" : "string", "index" : "analyzed", "omit_norms" : true,
15+
"fielddata" : { "format" : "disabled" }
1516
}
1617
}
1718
}, {
@@ -20,6 +21,7 @@
2021
"match_mapping_type" : "string",
2122
"mapping" : {
2223
"type" : "string", "index" : "analyzed", "omit_norms" : true,
24+
"fielddata" : { "format" : "disabled" },
2325
"fields" : {
2426
"raw" : {"type": "string", "index" : "not_analyzed", "doc_values" : true, "ignore_above" : 256}
2527
}

0 commit comments

Comments
 (0)