Created
July 14, 2011 18:22
-
-
Save juneym/1083059 to your computer and use it in GitHub Desktop.
Sample Date Facet Range that can be used for showing facet label like: 30 minutes ago, 1 hour ago etc.
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
{ | |
"query": { | |
"match_all": {} | |
}, | |
"facets": { | |
"dtmPosted": { | |
"range": { | |
"key_script": "doc['dtmPosted'].date.getMillis()", | |
"value_script": "doc['dtmPosted'].date.getMillis()", | |
"ranges": [ | |
{ | |
"from": 1310665698000, | |
"to": 1310667498000 | |
}, | |
{ | |
"from": 1310663898000, | |
"to": 1310665698000 | |
}, | |
{ | |
"from": 1310660298000, | |
"to": 1310663898000 | |
}, | |
{ | |
"from": 1310649498000, | |
"to": 1310660298000 | |
}, | |
{ | |
"from": 1310631498000, | |
"to": 1310649498000 | |
}, | |
{ | |
"from": 1310581098000, | |
"to": 1310631498000 | |
}, | |
{ | |
"from": 1310494698000, | |
"to": 1310581098000 | |
}, | |
{ | |
"from": 1310408298000, | |
"to": 1310494698000 | |
}, | |
{ | |
"from": 1310321898000, | |
"to": 1310408298000 | |
}, | |
{ | |
"from": 1310235498000, | |
"to": 1310235498000 | |
}, | |
{ | |
"from": 1310149098000, | |
"to": 1310235498000 | |
}, | |
{ | |
"from": 1310062698000, | |
"to": 1310149098000 | |
}, | |
{ | |
"from": 1309976298000, | |
"to": 1310062698000 | |
}, | |
{ | |
"from": 1309889898000, | |
"to": 1309976298000 | |
}, | |
{ | |
"from": 1309803498000, | |
"to": 1309889898000 | |
}, | |
{ | |
"to": 1309803498000 | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the above JSON snippet is based on the following "Elastica_Facet_Range" configuration: