5

I would like to search for query_string that contains Bob and an Industry_Type_ID of either 8 OR 9.

I am getting a parse error: Parse Failure [No parser for element [Industry_Type_ID]]

{
    "query" : {
        "query_string":{"query":"Bob"},
        "terms" : {
            "Industry_Type_ID" : [ "8", "9" ],
            "minimum_match" : 1
        }
    }
}

I am sure I am missing something obvious.

1 Answer 1

8

You can do it using bool query with two must clauses:

{
    "query" : {
        "bool" : {
            "must" : [
                {
                    "query_string":{"query":"Bob"}
                },
                {
                    "terms" : {
                        "Industry_Type_ID" : [ "8", "9" ],
                        "minimum_match" : 1
                    }
                }
            ]
        }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.