【发布时间】:2019-07-12 11:59:03
【问题描述】:
我第一次使用 Elasticsearch 和 Kibana,所以请保持冷静!
我得到了一个 ES,它已经有一个名为 dai-* 的索引,其中预先摄取了一些数据。为了安全地使用 ES,我创建了一个名为 ad-prior 的新索引。然后我继续为这两个索引提供如下数据:
{'obj_id': 'UHDRXEWEEK', 'event_type': 'PREC_AD_STARTED', 'event_id': '5c6b584373d', 'timestamp': 1550540223736L, 'channel_id': '123456789'}
{'obj_id': 'FDREJJSSHE', 'event_type': 'PREC_AD_STARTED', 'event_id': '4f53jhabd24', 'timestamp': 1550540225872L, 'channel_id': '123456789'}
然后我尝试在 Kibana 的 Discover 上进行搜索:
event_type.keyword:PREC_AD_STARTED
event_type:PREC_AD_STARTED
event_type:'PREC_AD_STARTED'
索引dai-*:以上搜索均返回367 hits。
索引ad-prior:上述搜索返回不同的结果:event_type:PREC_AD_STARTED 返回8 hits,但另外两个返回0 hits。
为什么上述搜索对dai-* 返回相同的结果,而对ad-prior 返回不同的结果?
更新
为了回答@Nishant Saini 的评论,我在此处获取了event_type 的我想成为的映射:
对于dai-*:
"event_type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
对于ad-prior:
"event_type": {
"type": "keyword",
"ignore_above": 1024
}
【问题讨论】:
-
dai-*使用通配符,因此针对所有以 dia- 开头的索引。新索引ad-prior的映射是否与dia-*相同? -
@NishantSaini 我添加了更多细节。
标签: elasticsearch kibana elasticsearch-dsl