Elasticsearch nested query

This is my 'nested search' query:

Following page : https://gist.github.com/2152146

{
"query": {
"nested": {
"_scope": "my_scope",
"path": "stores",
"score_mode": "avg",
"query": {
"filtered" : {
"query" : {
"match_all": {}
},
"filter" : {
"term" : { "stores.id" : "1001" }
}
}
}
}
},
"facets" : {
"range1" : {
"range" : {
"stores.price" : [
{ "to" : 200.0 },
{ "from" : 200.0, "to" : 500.0 },
{ "from" : 500.1, "to" : 700.0 },
{ "from" : 700, "to" : 900.0 },
{ "from" : 900, "to" : 1000.0 },
{ "from" : 1000.0 }
]
},
"scope": "my_scope"
}
}
}

My Exception :

"error" : "SearchPhaseExecutionException[Failed to execute phase [query], total failure; shardFailures {[zxSIYLK_TXyB5eBJ-SZQag][test][0]: SearchParseException[[test][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\r\n "query": {\r\n ....}}}}}].

How can I solve this problem?