Elasticsearch have some tools to do that simple.
For example we have a pin in a specific location (lat, long) like this:
{
"pin" : {
"location" : {
"lat" : 40.12,
"lon" : -71.34
}
}
}
To search in a range of 200km we can do a query like this:
{
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "200km",
"pin.location" : {
"lat" : 40,
"lon" : -70
}
}
}
}
}
Is really easy
And for dates you can use the a range query like this:
{
"range" : {
"date" : {
"gte" : "now/d",
"lt" : "now+1d/d"
}
}
}
For more example take a look in the documentation
https://www.elastic.co/guide/en/elasticsearch/guide/current/geoloc.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html