Не проверено, но вам нужно что-то вроде этого,
с term
,
GET documents/_search
{
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"should" : [
{ "term" : {"user" : "user1"}},
{ "term" : {"user" : "user2"}}
],
"should" : {
{ "term" : {"type" : "type1ID"}},
{ "term" : {"type" : "type2ID"}}
}
}
}
}
}
}
ИЛИ с terms
GET documents/_search
{
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"should" : [
{"terms": {"user": ["user1","user2"]}}
],
"should" : {
{"terms": {"type": ["type1ID","type2ID"]}}
}
}
}
}
}
}