I am trying to convert searchSourceJSON attribute of savedObject in DQL. But I haven't found a way to do it. The idea is to be able to execute the query that is stored in the object and execute it directly in ElasticSearch.
Perhaps the buildEsQuery could be the key. But I am not an expert in Kibana and for me it is complicated. I've been at it for several days.
someone could help me? Thanks a you
KQL
{
"highlightAll": true,
"version": true,
"query": {
"query": "",
"language": "kuery"
},
"filter": [
{
"meta": {
"alias": null,
"negate": false,
"disabled": false,
"type": "phrase",
"key": "category.keyword",
"params": {
"query": "Women's Accessories"
},
"indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index"
},
"query": {
"match_phrase": {
"category.keyword": "Women's Accessories"
}
},
"$state": {
"store": "appState"
}
}
],
"indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.index"
}
DSL
{
"query": {
"bool": {
"must": [],
"filter": [
{
"match_all": {}
},
{
"match_phrase": {
"category.keyword": "Women's Accessories"
}
}
],
"should": [],
"must_not": []
}
}
}