Mapper для [clientip] конфликтует с существующим отображением в других типах: \ n [mapper [clientip] имеет другие значения [норм], не может измениться с отключенного на включенное]
Elasticsearch 6.2.4
Мы используем logstash +asticsearch, чтобы получить некоторые показатели пропускной способности при использовании нашего облачного фронта.Вот как logstash анализирует вещи: https://gist.github.com/chrisan/1c5ce5beacfc0e124d39fa842f051857#file-logstash-api-conf
Это генерирует индексы, такие как: https://gist.github.com/chrisan/1c5ce5beacfc0e124d39fa842f051857#file-indicies
С такими сопоставлениями, как: https://gist.github.com/chrisan/1c5ce5beacfc0e124d39fa842f051857#file-mappings
Меня попросили различитьIP-адреса, и я попытался использовать агрегированный запрос:
{
"size": 0,
"aggs" : {
"distinct_ips" : {
"filter" : { "term": { "company" : "XXX" } },
"aggs" : {
"cardinality" : { "cardinality": {"field": "clientip" } }
}
}
}
}
Но это возвращает:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [clientip] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "logstash-2018.01.01",
"node": "dO1JCnAnSmmk5EfDmfYgqQ",
"reason": {
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [clientip] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."
}
}
]
},
"status": 400
}
Поэтому я попытался обновить это с помощью сопоставления
PUT / * / _/ _doc? update_all_types
{
"properties": {
"clientip": {
"type": "text",
"fielddata": true
}
}
}
Что возвращает:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Mapper for [clientip] conflicts with existing mapping in other types:\n[mapper [clientip] has different [norms] values, cannot change from disable to enabled]"
}
],
"type": "illegal_argument_exception",
"reason": "Mapper for [clientip] conflicts with existing mapping in other types:\n[mapper [clientip] has different [norms] values, cannot change from disable to enabled]"
},
"status": 400
}
Что я делаю не так?