Reputation: 3628
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.
Upvotes: 5
Views: 3700
Reputation: 30163
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
}
}
]
}
}
}
Upvotes: 8