I have created the following search query in Elastic. I am wanting to using it in a Discover query using the Elasticsearch Query DSL. However, I cannot seem to convert it. This is the query that I have using Kibana Dev console:
GET testssl*/_search
{
"aggs": {
"2": {
"terms": {
"field": "identifierTupple",
"order": {
"_key": "desc"
},
"size": 120
},
"aggs": {
"1": {
"top_hits": {
"size": 1,
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}
}
}
}
},
"size": 0
}
I cannot seem to convert the above to elastic DSL to use. Is this possible?
My outcome is to create a discover view showing the top hits of identifierTupple
.