Days are passing, but still can't get used to the syntax of queries.
My current query structure:
{
"query":{
"bool":{
"must":{ /* --- Here is my full-text search query --- */
"match":{
"full_text": {
"query": "test",
"operator": "and",
"fuzziness": "AUTO"
}
}
},
"filter":[
{ /* --- Here are all of my optional faceted search terms goes --- */
"term":{
"status":"Published"
}
},
{ /* --- Here are my 2 required 'AND' search terms:` range` and `script` --- */
"range":{
"price":{"gt":0}
}
},
{
"script":{
"script":{
"source":"doc['activated'].value.getMillis() + doc['duration'].value*24*60*60*1000 > System.currentTimeMillis()",
"lang":"painless"
}
}
}]
}
}
}
At this point I'm happy with it.
But there is also a need to have my filter query with my 'AND' search terms (range
and script
) as 'OR' search terms. And here I'm stuck with syntax.
Any help would be appreciated,
thanks in advance!