我正在使用带有pyes的elasticsearch。我在最后一页的结果中得到了重复。这是我的查询:
"query": {
"query": {
"filtered": {
"filter": {
"and": [
{
"match_all": {
}
}
]
},
"query": {
"bool": {
"minimum_number_should_match": 1,
"should": [
{
"text": {
"name.keyword_name": {
"operator": "and",
"query": "kentucky",
"type": "boolean",
"fuzziness": 0.8
}
}
},
{
"text": {
"address": {
"operator": "and",
"query": "kentucky",
"type": "boolean"
}
}
},
{
"text": {
"neighborhoods.name": {
"operator": "and",
"query": "kentucky",
"type": "boolean",
"fuzziness": 0.8
}
}
},
{
"text": {
"categories.name": {
"operator": "and",
"query": "kentucky",
"type": "boolean",
"fuzziness": 0.8
}
}
}
]
}
}
}
},
"facets": {
"neighborhoods.id": {
"terms": {
"field": "neighborhoods.id",
"size": 10
}
},
"categories.id": {
"terms": {
"field": "categories.id",
"size": 10
}
}
},
"size": 15,
"from": 15,
"fields": [
"id",
"categories.id",
"name",
"address",
"city",
"state",
"zipcode",
"location",
"_id",
"pos_review_count",
"neg_review_count",
"wishlist_count",
"recommender_count",
"checkin_count"
]
},
在这个查询中,我有
"size": 15,
"from": 15,
而且对于这个特定的查询,返回的对象的总计数是 24。“从”为 15,总计数为 24,我想在这里得到 9 个结果。但相反,因为我将“大小”设置为 15,所以我得到 15 个结果条目。由于只剩下 9 个唯一结果,因此将显示 6 个文档两次。关于如何使这个给我9个结果而不是15个重复的任何想法?
谢谢你的帮助!