Created
July 23, 2019 23:05
-
-
Save QuantVI/7b4c0b94e4b045653a705d39abb60eff to your computer and use it in GitHub Desktop.
ElasticSearch query: external confirmation status, versus internal status code. Example of an aggregation query returning results in JSON format. These result were passed to "Excel Printer" via "Scribe Report", two other gists you'll find here.
This file contains hidden or 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
| { "size": 0, | |
| "query": { | |
| "term": {"propertyId":"{{property_id}}"} | |
| }, | |
| "aggs": { | |
| "pms_status_code": { | |
| "terms" : { "field" : "confirmationStatus"}, | |
| "aggs": { | |
| "conf_status": { | |
| "terms" : { "field" : "statusCode"}, | |
| "aggs": { | |
| "min_check-in" : { "min" : { "field" : "checkinDate" }}, | |
| "max_check-in" : { "max" : { "field" : "checkinDate" }}, | |
| "min_check-out": { "min" : { "field" : "checkoutDate" }}, | |
| "max_check-out": { "max" : { "field" : "checkoutDate" }} | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment