[求助]kibana5.2-discover搜索框:keyword类型wildcard_query的搜索框实现
Kibana | 作者 Lincoln | 发布于2017年06月03日 | 阅读数:9248
kibana读取目标es的index文件,其中message字段为keyword类型,
1.kibana-discover-搜索框:怎么实现关键字查询(参与官方文档有wildcard-query)
2.搜索框直接输入关键字"RequestHandler",可以实现,但关键字底色未变黄
3.kibana-Dev Tools页面输入wildcard-query可以实现
索引的mapping设置
Step1: kibana-discover-搜索框:直接输入关键字“RequestHandler”,message底色未变黄
Step2: kibana-discover-搜索框:直接输入关键字message:“RequestHandler”,message无返回结果,由于keyword类开的导致。
Step3: kibana-Dev Tools: wildcard qurey返回结果
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.
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底色未变黄
Step2: kibana-discover-搜索框:直接输入关键字message:“RequestHandler”,message无返回结果,由于keyword类开的导致。
Step3: kibana-Dev Tools: wildcard qurey返回结果
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" }
}
}
1 个回复
kennywu76 - Wood
赞同来自: