As Elasticsearch implements SQL-like queries, i'm trying to migarate existing one using Elasticsearch SQL.
Source query:
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "foofoo bar",
"fields": [
"desc^4",
"desc.ngram^3"
],
"operator": "AND"
}
}
],
"should": [
{
"match": {
"user_id": {
"query": "222",
"boost": "2"
}
}
}
]
}
}
}
I've tried to replicate this to Query String Query, that can be passed to QUERY() inside SQL query and ended with:
+((+desc:(foofoo )^3 +desc:(bar)^3) | (+desc.ngram:(foofoo )^3 +desc.ngram:(bar)^3)) user_id:(222)^2
It gives the same result as using normal bool query, but is there any easier way to use it inside SQL query?