Filter geo_distance - Failed to parse source


(xrado) #1

Hi,

i'm trying to filter by geo_distance, but always geting error (logs) "Failed
to parse source"

i have query:

{
"query": {
"filtered" : {
"query" : {
"field" : {
"_all" : "test~0.3"
}
},
"filter" : {
"term" : { "model" : "company" }
}
}
}
}

..which work fine, then i add geo_distance

{
"query": {
"filtered" : {
"query" : {
"field" : {
"_all" : "test~0.3"
}
},
"filter" : {
"geo_distance" : {
"distance" : "200km",
"location" : {
"lat" : 40,
"lon" : -70
}
}
}
}
}
}

i get Failed to parse source

i mapped location as geo_point type

what am i doing wrong?

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/filter-geo-distance-Failed-to-parse-source-tp2842327p2842327.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(Shay Banon) #2

Please gist your samples, and the failure that you are getting.
On Wednesday, April 20, 2011 at 1:56 PM, xrado wrote:

Hi,

i'm trying to filter by geo_distance, but always geting error (logs) "Failed
to parse source"

i have query:

{
"query": {
"filtered" : {
"query" : {
"field" : {
"_all" : "test~0.3"
}
},
"filter" : {
"term" : { "model" : "company" }
}
}
}
}

..which work fine, then i add geo_distance

{
"query": {
"filtered" : {
"query" : {
"field" : {
"_all" : "test~0.3"
}
},
"filter" : {
"geo_distance" : {
"distance" : "200km",
"location" : {
"lat" : 40,
"lon" : -70
}
}
}
}
}
}

i get Failed to parse source

i mapped location as geo_point type

what am i doing wrong?

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/filter-geo-distance-Failed-to-parse-source-tp2842327p2842327.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #3