Skip to content

Instantly share code, notes, and snippets.

@john-bai
Created June 28, 2011 00:41
Show Gist options
  • Select an option

  • Save john-bai/1050220 to your computer and use it in GitHub Desktop.

Select an option

Save john-bai/1050220 to your computer and use it in GitHub Desktop.
Error when performing geo_distance filter example
jtherrell$ curl -XGET http://localhost:9200/test/pin/_search?pretty=true -d '{
"query" : {
"match_all" : {}
}
}
'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "pin",
"_id" : "1",
"_score" : 1.0, "_source" : {
"pin" : {
"location" : {
"lat" : 40.12,
"lon" : -71.34
}
}
}
} ]
}
}jtherrell$ curl -XGET http://localhost:9200/test/pin/_search?pretty=true -d
curl: option -d: requires parameter
curl: try 'curl --help' or 'curl --manual' for more information
jtherrell$ curl -XGET http://localhost:9200/test/pin/_search?pretty=true -d '{
> "filtered" : {
> "query" : {
> "match_all" : {}
> },
> "filter" : {
> "geo_distance" : {
> "distance" : "200km",
> "pin.location" : {
> "lat" : 40,
> "lon" : -70
> }
> }
> }
> }
> }'
{
"error" : "SearchPhaseExecutionException[Failed to execute phase [query], total failure; shardFailures {[PvAjtOmYQ1WM2OgWwRuyHQ][test][0]: SearchParseException[[test][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"filtered\" : {\n \"query\" : {\n \"match_all\" : {}\n },\n \"filter\" : {\n \"geo_distance\" : {\n \"distance\" : \"200km\",\n \"pin.location\" : {\n \"lat\" : 40,\n \"lon\" : -70\n }\n }\n }\n }\n}]]]; nested: SearchParseException[[test][0]: from[-1],size[-1]: Parse Failure [No parser for element [filtered]]]; }{[PvAjtOmYQ1WM2OgWwRuyHQ][test][1]: SearchParseException[[test][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"filtered\" : {\n \"query\" : {\n \"match_all\" : {}\n },\n \"filter\" : {\n \"geo_distance\" : {\n \"distance\" : \"200km\",\n \"pin.location\" : {\n \"lat\" : 40,\n \"lon\" : -70\n }\n }\n }\n }\n}]]]; nested: SearchParseException[[test][1]: from[-1],size[-1]: Parse Failure [No parser for element [filtered]]]; }{[PvAjtOmYQ1WM2OgWwRuyHQ][test][2]: SearchParseException[[test][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"filtered\" : {\n \"query\" : {\n \"match_all\" : {}\n },\n \"filter\" : {\n \"geo_distance\" : {\n \"distance\" : \"200km\",\n \"pin.location\" : {\n \"lat\" : 40,\n \"lon\" : -70\n }\n }\n }\n }\n}]]]; nested: SearchParseException[[test][2]: from[-1],size[-1]: Parse Failure [No parser for element [filtered]]]; }{[PvAjtOmYQ1WM2OgWwRuyHQ][test][3]: SearchParseException[[test][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"filtered\" : {\n \"query\" : {\n \"match_all\" : {}\n },\n \"filter\" : {\n \"geo_distance\" : {\n \"distance\" : \"200km\",\n \"pin.location\" : {\n \"lat\" : 40,\n \"lon\" : -70\n }\n }\n }\n }\n}]]]; nested: SearchParseException[[test][3]: from[-1],size[-1]: Parse Failure [No parser for element [filtered]]]; }{[PvAjtOmYQ1WM2OgWwRuyHQ][test][4]: SearchParseException[[test][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"filtered\" : {\n \"query\" : {\n \"match_all\" : {}\n },\n \"filter\" : {\n \"geo_distance\" : {\n \"distance\" : \"200km\",\n \"pin.location\" : {\n \"lat\" : 40,\n \"lon\" : -70\n }\n }\n }\n }\n}]]]; nested: SearchParseException[[test][4]: from[-1],size[-1]: Parse Failure [No parser for element [filtered]]]; }]",
"status" : 500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment