I need to do a query in solr that returns the document closest to a given timestamp. Let's say these are my documents:
[{
myDateField_dt: "2012-12-01T18:37:35.282Z"
},
{
myDateField_dt: "2012-12-01T18:37:38.282Z"
},
{
myDateField_dt: "2012-12-01T18:37:40.282Z"
}]
and this is my search date: 2012-12-01T18:37:36.282Z
then the query should return the first date from my example docs because it's closest to my search date. How would I do this with solr / lucene?