创建新的模式索引时,如何在Elastic Search中设置默认映射? [英] How can I setup a default mapping in Elastic Search when it creates a new Patterned Index?
问题描述
But it won't fix my problem going forward when more log entries come in that will cause a field to be conflicting (as in Long
instead of Float
in my case), especially when it rolls over to create a new Index of a specific pattern (i.e. the next day), for example: log-20170101 on the 1st of January 2017, but on the next day it will become 20170102 which won't have the applied mapping that I applied on the previous indexes.
如何设置Elastic Search在新创建的以"log"开头的索引上应用映射?
How can I setup Elastic Search to apply a mapping on newly created Indexes that start with "log"?
推荐答案
我遇到了称为通过采用在重新索引过程中定义的映射(请参见 answer ),我能够为构成索引模式"log- *"一部分的索引设置模板.
By taking my mappings that I defined in the Re-Index process (see this answer), I was able to setup a Template for the Indexes that forms part of the Index Pattern "log-*".
额外的好处是,无论我告诉Kibana多少次刷新索引模式,它都不会添加新的关键字或更改任何定义的类型,因此我终于可以知道我的给定字段一直在只要值是数字,冲突"现在将被解释为 Float
.
The added benefit was that, no matter how many times I told Kibana to refresh my Index Patterns it never added new keywords or changed any of the defined types, so I can finally rest in knowing that my given field that was constantly "conflicting" will now be interpreted as Float
as long as the value is numeric.
这篇关于创建新的模式索引时,如何在Elastic Search中设置默认映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!