Search with "or" condition

Hi guys,
can't understood how to do search by few fields, but with or condition:

GET /my_index/my_type/_search
{
"query": {
    "bool": {
        "filter": {
            "bool": {
                "should": {
                    "prefix": [
                        { "field": { "title": "brown" }},
                        { "field": { "message": "dog"   }}
                    ],
                    "minimum_should_match": 1 
                }
            }
        } 
   }
}

Something like (untested):

GET /my_index/my_type/_search
{
"query": {
    "bool": {
        "filter": {
            "bool": {
                "should": [
                   { "prefix": { "field": { "title": "brown" }}},
                   { "prefix": { "field": { "message": "dog" }}}
                ],
                "minimum_should_match": 1 
           }
      } 
   }
}

thanks

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