I am fairly new to Elasticsearch. I am trying to map basic logical queries to elasticsearch query DSL.
I understand that bool is used to make boolean(logical) queries to ES. I can map queries like if (cond1 && cond2), but I cannot understand how to make OR queries like if(cond1 || cond2)
Logical Query
if(attr1==val1 && attr2=val2){}
Elastic Search DSL
"bool" : {
"must" : {
["term":{"attr1":"val1"}, {"term":"attr2":"val2"}]
}
}
What do I write for if(attr1==val1 || attr2==val2)
?