Terms query from array with AND

Hi,

what would be the best way to make the below terms query to AND the two fields in the array passed to the .raw field?
At the moment if seems to be doing an OR between them:

{"sort" : [{ "_score" : {"order" : "asc"}}],"query": {"bool" : {"filter" :{"bool": {"must":[{ "terms": {"categories.raw" : ["category2","category1"]}}, {"range": {"price": {"gte": 0,"lte": 250}}}]}}}},"from": 0, "size": 40}

Thanks,
Isaac

Are you sure it will make the terms query AND instead of the default OR?

My apologies, misread your question. Can you post an example of a document?

sure,

{
"name" : "name_of_the_thing",
"categories" : ["category1","category2"],
"price": 10
}

Thanks
Isaac

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.