字段名称中的通配符查询 [英] Wildcard queries in field name
本文介绍了字段名称中的通配符查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
通配符:{user:ki * y }
但是如果我想在字段中使用通配符,那么什么?
如何看起来有效的查询:
通配符:{base / *:value }
解决方案
您可以使用query_string ,它允许两个字段名通配符和查询文本通配符。
这些行的一些东西:
{
query: {
query_string:{
fields:[
base *
],
query:ki * y
}
}
}
I can use simple wildcard query like this:
"wildcard" : { "user" : "ki*y" }
but if i want to use wildcard in field, then what? How shoud look valid query for this:
"wildcard" : { "base/*" : "value" }
解决方案
You can use query_string which allows both field names wildcards and query text wildcards.
Something around these lines:
{
"query": {
"query_string": {
"fields": [
"base*"
],
"query": "ki*y"
}
}
}
这篇关于字段名称中的通配符查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文