I got the query wotking by using 

{
                          "query_string": {
                             "default_field": "state",
                             "query": "MA NY"
                          }
                  }

- Paul
On Tuesday, 31 December 2013 11:07:06 UTC+5:30, paul wrote:
>
> My query is as below ,  which gives me all the colleges with state code 
> "MA" i want all the colleges that are in "MA" or "NY" how to add OR filter 
>
> {
>   "query": {
>     "filtered": {
>       "query": {
>         "nested": {
>           "path": "programs",
>           "query": {
>             "bool": {
>               "must": [
>                 {
>                   "match": {
>                     "programs.progName": "Computer and Information 
> Sciences"
>                   }
>                 },
>                 {
>                   "range": {
>                     "programs.Bachelor": {
>                       "gt": 0
>                     }
>                   }
>                 }
>               ]
>             }
>           }
>         }
>       },
>       "filter": {
>         "and": {
>           "filters": [
>             {
>               "bool": {
>                 "must": [
>                   {
>                     "term": {
>                       "state": "MA"
>                     }
>                   },
>                   {
>                     "range": {
>                       "costOutofstateTution": {
>                         "gte": 0,
>                         "lte": 30000
>                       }
>                     }
>                   }
>                 ]
>               }
>             }
>           ]
>         }
>       }
>     }
>   }
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/d23102f3-3180-4cdc-9d51-8ca960c7bcd0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to