我在ElasticSearch中有以下数据结构:
"assets": {
"type": "nested",
"properties": {
"assetId": {
"type": "keyword"
},
"assetSource": {
"type": "keyword"
},
}
假设我想排除'assetSource'的值为'Web'
的结果我在Term(field='assets.assetSource', query='web')
中使用了query.exclude
,但由于资产属于多字段,因此会抱怨[term] query doesn't support multiple fields
如何解决此问题?
答案 0 :(得分:0)
愚蠢的我,我应该像这样使用Term过滤器:
Term(**{'assets.assetSource':'vault'})