SELECT sender
FROM julymonth
WHERE recipient IN ('x', 'y')
GROUP BY sender;
此处发件人和收件人是列名,而julymonth是表名。
答案 0 :(得分:0)
对您的结构进行成像,这就是:
POST /julymonth/_search
{
"query": {
"filtered": {
"filter": {
"terms": {
"recipient": [
"x",
"y"
]
}
}
}
},
"aggs": {
"senders": {
"terms": {
"field": "sender",
"size": 0
}
}
}
}