{
indexName: String,
documentName: String,
'queryString': {
"query": {
"bool": {
"should": [{
"bool": {
"must": [{
"match_phrase": {
"from.jid": String
}
},
{
"match_phrase": {
"to.jid": String
}
}],
"must_not": {
"exists": {"field": "isDeleted"}
}
}
},
{
"bool": {
"must": [{
"match_phrase": {
"from.jid": String
}
},
{
"match_phrase": {
"to.jid": String
}
}],
"must_not": {
"exists": {"field": "isDeleted"}
}
}
}],
"minimum_should_match": 1
}
},
"scroll": "1m",
"scroll_id": scrollId ? scrollId : '',
//"from": length,
"size": 10,
"sort": [{
"createdOn":"desc"
}],
}
}