title: Get previous and next document by date in Elasticsearch
body: <p>My Elasticsearch index contains documents each having a date field. The documents can be sorted by date.</p>
  
  <p>Supposed I have a specific document ID and its date, what is the best way to get the previous and next document inside the index by date?</p>
  
  <p>I had a look at the fuzzy query with dates but it does not solve the problem directly. It would return the most similar documents but not necessarily the previous and next one.</p>