Potřebujete Pomoci.
Jak to udělat Query do Elasticsearch, jako je tento:
SELECT * FROM tableA WHERE
tableA.clm1 IN ('A','B')
AND
(tableA.clm2 IN ('C', 'D') OR tableA.clm3 IN ('E','F'))
OR
tableA.clm4 = 'Z'
Děkuji.
Potřebujete Pomoci.
Jak to udělat Query do Elasticsearch, jako je tento:
SELECT * FROM tableA WHERE
tableA.clm1 IN ('A','B')
AND
(tableA.clm2 IN ('C', 'D') OR tableA.clm3 IN ('E','F'))
OR
tableA.clm4 = 'Z'
Děkuji.
Můžete použít bool dotaz
{
"query": {
"bool": {
"should": [
{
"term": {
"clm4.keyword": {
"value": "Z"
}
}
}, -- OR
{
"bool": {
"filter": [
{
"terms": {
"clm1.keyword": [
"A",
"B"
]
}
}, --AND
{
"bool": {
"should": [
{
"terms": {
"clm2.keyword": [
"C",
"D"
]
}
}, --OR
{
"terms": {
"clm3.keyword": [
"E",
"F"
]
}
}
]
}
}
]
}
}
]
}
}
}
filter
místomust
když děláte přesná shoda dotazy