我正在尝试在“描述”列中获取唯一值。根据我的数据,我有很多类似的描述。我只想要独特的。
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"}
qq_遁去的一_1
相关分类