Created
August 10, 2017 20:36
-
-
Save eskibars/ec4afb8bcc6f2917b89f729fcaca67d6 to your computer and use it in GitHub Desktop.
Example of date search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT t | |
PUT /t/t/_mapping | |
{ | |
"properties": { | |
"publishdate": { | |
"type": "date" | |
} | |
} | |
} | |
POST /t/t | |
{ | |
"publishdate": "2001-02-03T04:56:00" | |
} | |
GET /t/t/_search | |
{ | |
"query": { | |
"bool": { | |
"filter": { | |
"range": { | |
"publishdate": { | |
"lt": "now" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment