【发布时间】:2015-05-13 13:57:38
【问题描述】:
我创建了名为“testindex”的索引和名为 type1、type2、type3 的三种类型。我需要这三种类型的过滤数据。我是这样过滤的。
GET testindex/type1,type2,type3/_search
{"query":{
"filtered":{
"query":{
"match_phrase_prefix":{"title":"c"}
},
"filter":{
"bool":{
"must":[
{
"term":{
"status": "1"
}
}
]
}
}
}
}
这工作正常,但问题是 type3 没有 status 字段。我只需要考虑 type1 和 type2 的过滤器,而不是 type3 的过滤器。我需要帮助来解决这个问题。
【问题讨论】:
-
“type3 没有状态字段是什么意思。我需要考虑仅对 type1 和 type2 进行过滤,而不是对 type3 进行过滤”?如果 type3 的
status字段不存在,您预计会发生什么?
标签: php elasticsearch