Filter and Match all order

I have an index and I am getting a geo_bounding_box with lat and long
from google maps. With out the extra filter the query works fine.

I am using elasticsearch head page to debug this. When I use this part
of the query
"query": {
"match_all": {},
"filter": {
"range": {
"inspection_score": {
"from": 30
}
}
}
}

It works fine. When I switch the order of match_all and filter the
query does not parse. Please see gist for the full query details. I am
using code to generate the json and it puts the filter in front of the
match all so it breaks.

I moved the range part in to the filter with the bounding_box as an
and statement.
I updated the bottom of the gist with my new working query. It is odd
to me still
that one query works well and the other errors.

My new query that works fine
{
"query": {
"filtered": {
"filter": {
"and": [
{
"geo_bounding_box": {
"location": {
"bottom_right": [
-122.315513187315,
47.6137317545592
],
"top_left": [
-122.320740812685,
47.6149522383193
]
}
}
},
{
"range": {
"inspection_score": {
"from": 50
}
}
}
]
},
"query": {
"match_all": {}
}
}
}
}

On Aug 29, 10:04 pm, BeckerIV sbecke...@gmail.com wrote:

query problem · GitHub

I have an index and I am getting a geo_bounding_box with lat and long
from google maps. With out the extra filter the query works fine.

I am using elasticsearch head page to debug this. When I use this part
of the query
"query": {
"match_all": {},
"filter": {
"range": {
"inspection_score": {
"from": 30
}
}
}
}

It works fine. When I switch the order of match_all and filter the
query does not parse. Please see gist for the full query details. I am
using code to generate the json and it puts the filter in front of the
match all so it breaks.

Heya,

Yea, thats the correct format. The query parsing is a bit too lenient, and
if it can be parsed, it will be...

On Tue, Aug 30, 2011 at 8:14 AM, BeckerIV sbeckeriv@gmail.com wrote:

I moved the range part in to the filter with the bounding_box as an
and statement.
I updated the bottom of the gist with my new working query. It is odd
to me still
that one query works well and the other errors.

My new query that works fine
{
"query": {
"filtered": {
"filter": {
"and": [
{
"geo_bounding_box": {
"location": {
"bottom_right": [
-122.315513187315,
47.6137317545592
],
"top_left": [
-122.320740812685,
47.6149522383193
]
}
}
},
{
"range": {
"inspection_score": {
"from": 50
}
}
}
]
},
"query": {
"match_all": {}
}
}
}
}

On Aug 29, 10:04 pm, BeckerIV sbecke...@gmail.com wrote:

query problem · GitHub

I have an index and I am getting a geo_bounding_box with lat and long
from google maps. With out the extra filter the query works fine.

I am using elasticsearch head page to debug this. When I use this part
of the query
"query": {
"match_all": {},
"filter": {
"range": {
"inspection_score": {
"from": 30
}
}
}
}

It works fine. When I switch the order of match_all and filter the
query does not parse. Please see gist for the full query details. I am
using code to generate the json and it puts the filter in front of the
match all so it breaks.