You can do it like this:
{
"query": {
"bool": {
"filter": {
"term": {
"type": "A"
}
},
"minimum_should_match": 1,
"should": [
{
"bool": {
"must_not": {
"exists": {
"field": "title"
}
}
}
},
{
"bool": {
"must_not": {
"exists": {
"field": "description"
}
}
}
}
]
}
}
}
You can use a [Filtered Query][1] for this. Filters are not scored. See the query below for searching the term `"xyz"`:
POST <index name>/<type>/_search
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"should": [
{
"term": {
"name": "xyz"
}
},
{
"term": {
"description": "xyz"
}
}
]
}
}
}
}
[1]: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html