怎么又是你

[求助]kibana5.2-discover搜索框:keyword类型wildcard_query的搜索框实现

Kibana | 作者 Lincoln | 发布于2017年06月03日 | 阅读数:9198

kibana读取目标es的index文件,其中message字段为keyword类型,
1.kibana-discover-搜索框:怎么实现关键字查询(参与官方文档有wildcard-query)
2.搜索框直接输入关键字"RequestHandler",可以实现,但关键字底色未变黄
3.kibana-Dev Tools页面输入wildcard-query可以实现
 
 
索引的mapping设置
PUT _template/tmplt_ofbiz
{
"template": "ofbiz*",
"mappings": {
"log": {
"properties": {
"host": {
"type": "keyword"
},
"source": {
"type": "keyword"
},
"message": {
"type": "keyword"
}
}
}
}
}


 Step1: kibana-discover-搜索框:直接输入关键字“RequestHandler”,message底色未变黄
屏幕快照_2017-06-03_下午11.25_.33_.png

 Step2: kibana-discover-搜索框:直接输入关键字message:“RequestHandler”,message无返回结果,由于keyword类开的导致。
屏幕快照_2017-06-03_下午11.27_.17_.png

 
 Step3: kibana-Dev Tools: wildcard qurey返回结果
屏幕快照_2017-06-03_下午11.24_.36_.png

 
Step4: wildcar qurey 官方文档:https://www.elastic.co/guide/e ... .html
Wildcard Queryedit

Matches documents that have fields matching a wildcard expression (not analyzed). Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. Note that this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow wildcard queries, a wildcard term should not start with one of the wildcards * or ?. The wildcard query maps to Lucene WildcardQuery.
 
GET /_search
{
"query": {
"wildcard" : { "user" : "ki*y" }
}
}

 
已邀请:

kennywu76 - Wood

赞同来自:

输入框输入  message: *RequestHandler* 应该可以match,效果等同wildcard query。

要回复问题请先登录注册