5
如何在ElasticSearch中对子对象字段进行过滤搜索?例如,我的文档有一个id
和data
领域是数据是如何存储在我的数据库中的JSON数组:Elasticsearch过滤搜索子对象字段
{_id: 000, merchant: "merchant_1", email: "[email protected]"}
我的搜索查询:
"query": {
"filtered": {
"filter": { "term": { "data.merchant": "merchant_1"} },
"query": {
"query_string": {"query": "hello"} }
}
}
}
没有按” t返回任何内容,但仅使用query_string hello
执行查询将返回正确的行。改变"data.merchant"
=>"merchant"
也不会改变任何东西。
我在这里做错了什么?
更新:我结束了刚刚使用布尔查询,它工作。