We are migrating from ES 2.4/Kibana4 to ES/Kibana 6.2.3. We use our own tool for pushing structured JSON into the ElasticSearch cluster. Functionally everything is basically working .. but we're struggling with the right mappings in the latest version of ES.
Here is the index template we currently have:
{
"order": 99,
"index_patterns": [
"logs-*"
],
"settings": {
"index": {
"codec": "best_compression",
"refresh_interval": "30s",
"number_of_shards": "52",
"number_of_replicas": "1"
}
},
"mappings": {
"event": {
"_source": {
"enabled": true
},
"properties": {
"all": {
"type": "keyword",
"index": true
}
},
"dynamic_templates": [
{
"geo_fields": {
"path_match": "*__geo.location",
"mapping": {
"type": "geo_point"
}
}
},
{
"epoch_fields": {
"path_match": "*epochms",
"mapping": {
"type": "date",
"doc_values": true
}
}
},
{
"all_strings": {
"match_mapping_type": "string",
"mapping": {
"copy_to": "all",
"type": "text",
"index": true,
"fields": {
"keyword": {
"type": "keyword",
"index": true,
"ignore_above": 256
}
}
}
}
}
]
}
},
"aliases": {}
}
We have a few goals with this template:
- All
string
fields should be searchable (obviously). - Any
string
field thats shorter than 256chars should be usable in visualizations. We may shorten this in the future. - Any
string
field longer than 256chars is not - All tokenized words are sent into an
all
field, that we pass to Kibana as thedefault_field
when people do string searches that have no field name associated with them.
I think we've got this maybe half right .. but not quite right. We have a few notable problems right now that we could use help with.
all
field searching is only partially working
In ES 2.4/Kibana2.4, if we search for a partial string (say "cron:session"
), we get back a highlighted match anywhere in our documents with that string.. whether its a full match to a field or a partial match.
With our current mapping in ES 6, we actually get no results on that search. If we search for a value that maps to an entire field (say cron
) we will get a match back because some documents have program__str: "cron"
in them. Also, this search is case-sensitive .. which is not ideal.
I will note, if we search for message__str:"cron:session"
, the results are good.. this failure only applies to the all
field.
highlighting does not work
When we search for a match in a specific field, highlighting works.. but when we use the all
field (above), if we happen to get a match back, we will still not get highlighting of that match. Seems like this may be likely related to the above issue?