【发布时间】:2023-03-16 01:21:01
【问题描述】:
我有一个带有以下映射的 Elasticsearch 索引“库”:
{
"mappings": {
"book": {
"properties": {
"title": { "type": "text", "index": "not_analyzed" },
"author": { "type": "text", "index": "not_analyzed" },
"price": { "type": "integer" },
}
}
}
现在我想进行查询以查找作者数量等于 3 的所有文档(书籍)。即我想进行匹配的查询
curl -XGET "http://localhost:9200/library/_search?pretty=true" -d '{
"query": {
"match": {
Number of values of term "author" = 3.
}
}
}'
有没有办法在不添加额外术语的情况下进行这样的查询?
[我知道在搜索结果中查找某个词的所有可能值的聚合,但无法根据上述条件转换该聚合。]
【问题讨论】:
标签: elasticsearch elasticsearch-2.0