My index is not_analyzed by default. However I want to analyze the hostname for case insensitive and partial matching.
I want to do the opposite of what most people do. Instead of creating a .raw
field for analyzed strings, I want to create a .anal
field for not_analyzed fields matching "host" field name. I tried something like this in my template without any luck:
"string_fields" : {
"mapping" : {
"fielddata" : {
"format" : "disabled"
},
"index" : "not_analyzed",
"omit_norms" : true,
"type" : "string",
"fields" : {
"anal" : {
"index" : "analyzed",
"type" : "string"
}
}
},
"match_mapping_type" : "string",
"match" : "host"
}