Last active
September 5, 2018 09:52
-
-
Save kisakyegordon/4531826f2f2e81a8e2cbfcbbad92e7c6 to your computer and use it in GitHub Desktop.
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
# 1. Search For Everything | |
# 2. Search for the most recent published event | |
# 3. Search for the most recent subscribed event | |
# 4. Search for events within the last 24hours | |
# 1. Search for everything. | |
GET pubsub-registry/_search | |
{ | |
"query": { | |
"match_all": {} | |
} | |
} | |
# 2. Search for the most recent published event | |
GET pubsub-registry/_search | |
{ | |
"query":{ | |
"match": { | |
"actionType": "publish" | |
} | |
}, | |
"size": 1, | |
"sort":[ | |
{ | |
"timestamp.keyword": { | |
"order": "desc" | |
} | |
} | |
] | |
} | |
# 3. Search for the most recent subscribed event | |
GET pubsub-registry/_search | |
{ | |
"query":{ | |
"match": { | |
"actionType": "subscribe" | |
} | |
}, | |
"size": 1, | |
"sort":[ | |
{ | |
"timestamp.keyword": { | |
"order": "desc" | |
} | |
} | |
] | |
} | |
} | |
# 4. Search for events within the last 24hours | |
GET pubsub-registry/_search | |
{ | |
"sort": [{ | |
"timestamp.keyword": { | |
"order": "desc" | |
} | |
}], | |
"query":{ | |
"range":{ | |
"timestamp.keyword": { | |
"gte": "(now-24h)" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment