You need to pass the search request a "query", so just change the above to:

GET /_search
{ "query": { "filtered": .... }, from: 0, size: 3 ...}




On 14 March 2014 14:55, Subhadip Bagui <[email protected]> wrote:

> Hi,
>
> I'm trying to run the below bool query with filter range to fetch all the
> node data with CLOUD_TYPE="AWS-EC2"" and NODE_STATUS="ACTIVE".
> But I'm getting SearchPhaseExecutionException from elasticsearch. Please
> let me know the correct way to do this.
>
>
> curl -XPOST "http://10.203.251.142:9200/aricloud/_search"; -d
> '{
>     "filtered": {
>         "query": {
>             "bool": {
>                 "must": [
>                     {
>                         "term": {
>                             "CLOUD_TYPE": "AWS-EC2"
>                         }
>                     },
>                     {
>                         "term": {
>                             "NODE_STATUS": "ACTIVE"
>                         }
>                     }
>                 ]
>             }
>         },
>         "filter": {
>             "range": {
>                 "NODE_CREATE_TIME": {
>                     "to": "2014-03-14 18:43:55",
>                     "from": "2014-03-14 16:22:32"
>                 }
>             }
>         }
>     },
>     "sort": {
>         "NODE_ID": "desc"
>     },
>     "from": 0,
>     "size": 3
> }'
>
> --
> 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/4e53acd6-d68a-43fe-8340-72ae695e0060%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/4e53acd6-d68a-43fe-8340-72ae695e0060%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPt3XKSTtR1ppgD_VopKPwXGZX3j3B_aQUMtHpeJxgA%3DX0qP3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to