Ignore geo points having lat & lon 0 from graph

Hi,

I have few records in DB having latitude and longitude value 0. I am storing them as a geo points in elastic search.

"location": {
"lat": 0,
"lon": 0
}

Could I filter to ignore records having lat = 0 and lon = 0 ? There is query to specify the range but can't find anything to exclude records having 0 lat & lon?

{
"query": {
"filtered": {
"filter": {
"geo_distance_range": {
"location": {
"lat": 40,
"lon": -74
}
}
}
}
}
}

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:

```
CODE
```

I moved your question to #elasticsearch as it's not related to #graph.

I'd recommend changing your index process and for example use a logstash mutate filter to simply remove the point from your document at index time.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.