How to combine Terms and Match query

Hi,
is there a way to combine a term and a match query? I have data with categorys A,B,C,D... which contains extra field which can vary.

_source:
category: A
value: 3

_source:
category: A
value:2

_source:
category: A
value: 3
....

I want a query that finds all documents with the category A &B and value 3. My idea was:

{
    "query" : {
        "terms" : {
            "category":["A","B"]
        },
        "match" : {
            "message" : {
                "value": "3"
            }
        }
    }
}

but I get the error: "[terms] malformed query, expected [END_OBJECT] but found [FIELD_NAME]"

My question: Can I combine Terms and Match querys? If so: How?

Thanks,
defalt

The bool query is used to combine multiple child query clauses, with the appropriate Boolean logic

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