Hi all
I created a index template as following:
{
"template" : "logstash-bmwrtti-*",
"settings" : {
"index.refresh_interval" : "5s",
"analysis" : {
"tokenizer" : {
"url_tokenizer" : {
"type" : "pattern",
"pattern" : "&"
}
},
"analyzer" : {
"url_analyzer" : {
"type" : "custom",
"tokenizer" : "url_tokenizer",
"filter" : ["lowercase"]
}
}
}
},
"mappings" : {
"_default_" : {
"_all": {
"enabled": true
},
"properties" : {
"rowkey" : {
"type" : "text"
},
"dirveid" : {
"type" : "text",
"fielddata": true
},
"uri" : {
"type" : "text",
"analyzer" : "url_analyzer"
},
"reqtime" : {
"type" : "date",
"format" : "epoch_millis"
},
"restime" : {
"type" : "date",
"format" : "epoch_millis"
},
"answertime" : {
"type" : "integer"
},
"serverip" : {
"type" : "ip"
},
"adcode" : {
"type" : "text"
},
"ccplonlat" : {
"type" : "geo_point"
},
"deslonlat" : {
"type" : "geo_point"
},
"cversion" : {
"type" : "text"
},
"dversion" : {
"type" : "text"
},
"responsesize" : {
"type" : "integer"
},
"datatype" : {
"type" : "text"
}
}
}
}
}
two questions:
1、When I run a logstash to output document to the elasticsearch, each type will be created a mapping.
How to create a index template for all type?
2、When I call the cardinality agg for field [driveid] , returning the [driveid] need set fielddata=true
How to set the not analyzer?
PS: my es version is 5.1 .