Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maharg101/5220406 to your computer and use it in GitHub Desktop.
Save maharg101/5220406 to your computer and use it in GitHub Desktop.
elasticsearch date arithmetic behaviour oddity
{
"sort": [
{
"publication_time": {
"order": "desc"
}
}
],
"from": 0,
"size": 3,
"fields": [
"headline"
],
"query": {
"query_string": {
"query": "+publication_time:[now-5m TO now]"
}
}
}
{
"sort": [
{
"publication_time": {
"order": "desc"
}
}
],
"from": 0,
"size": 3,
"fields": [
"headline"
],
"query": {
"query_string": {
"query": "+publication_time:[now-5m TO 2013-03-23]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment