Я пытаюсь получить уникальные значения в столбце «описание». По моим данным у меня много похожих описаний. Я хочу только уникальные.
con.search(index='data', body={
"aggs": {
"query": {
"match": {"description": query_input}
},
"size": 30,
"distinct_description": {
}
}
})
Однако это не работает вообще. Любые предложения.
Пример:
{id: 1, state: "OP", description: "hot and humid"}
{id: 2, state: "LO", description: "dry"}
{id: 3, state: "WE", description: "hot and humid"}
{id: 4, state: "OP", description: "green and vegetative"}
{id: 5, state: "HP", description: "dry"}
Результат:
{id: 1, state: "OP", description: "hot and humid"}
{id: 2, state: "LO", description: "dry"}
{id: 4, state: "OP", description: "green and vegetative"}