【发布时间】:2018-10-30 16:48:54
【问题描述】:
参考 - https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-query-string-query.html
如果我想在这个 ES 查询中添加通配符搜索 -
{
"query": {
"bool": {
"must": [
{ "match": { "fieldA": "{{fieldA}}" } }
]
}
}
}
那么通配符查询就变成了——
{
"query": {
"query_string": {
"default_field": "fieldA",
"query": "{{fieldA}}"
}
}
}
但是,如果我在第一个 ES 查询中有 2 个参数 -
{
"query": {
"bool": {
"must": [
{ "match": { "fieldA": "{{fieldA}}" } },
{ "match": { "fieldB": "{{fieldB}}" }}
]
}
}
}
使用 Wilcard 的 ES 查询会是什么?
【问题讨论】: