Elasticsearch error when trying to register Percolator with geo_distance filter -


i'm using elasticsearch marvel/sense plugin create index of shapes dot type , register geo_distance filter in percolator:

put shapes {   "mappings": {     "dot": {       "properties": {         "location": {           "type": "geo_point",           "fielddata": {             "lat_lon": "true",             "precision": "1cm"           }         }       }     }   } }  put shapes/.percolator/in_sight {     "filtered" : {         "query" : {             "match_all" : {}         },         "filter" : {             "geo_distance" : {                 "distance" : "200km",                 "location" : {                     "lat" : 40,                     "lon" : -70                 }             }         }     } } 

this yields following error:

{    "error": "percolatorexception[[shapes] failed parse query [in_sight]]; nested: nullpointerexception; ",    "status": 500 } 

any idea?

thanks.

found answer, it's syntax hard guess elasticsearch:

    #create mappings dot , ellipse types put shapes {   "mappings": {     "dot": {       "properties": {         "tag" : { "type" : "string" },         "location": {           "type": "geo_point",           "fielddata": {             "lat_lon": "true"           }         }       }     },     "ellipse": {       "properties": {         "tag" : { "type" : "string" },         "location": {           "type": "geo_point",           "fielddata": {             "lat_lon": "true"           }         }       }     }   } }  #register geo_distance percolator put shapes/.percolator/in_sight {   "query": {     "filtered": {       "filter": {         "geo_distance": {           "distance": "250km",           "location": {             "lat": 30,             "lon": 31           }         }       }     }   } }  #query doc against percolator. post shapes/ellipse/_percolate {   "doc": {     "tag": "t3",     "location": {       "lat": 30,       "lon": 30     }   } } 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -