{ "query": { "filtered" : { "filter" : { "terms": { "name": ["John","Bas","Peter"] } } } }}
哪一个Elasticsearch会像您曾经使用过的那样重写
{ "query": { "filtered" : { "filter" : { "bool": { "should": [ { "term": { "name": "John" } }, { "term": { "name": "Bas" } }, { "term": { "name": "Peter" } } ] } } } }}
bool过滤器比
and或更好
or。原因在Elasticsearch博客中进行了解释:http://www.elasticsearch.org/blog/all-about-
elasticsearch-filter-bitsets/
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)