0

我正在使用 Boto 的 CloudSearch API 来查询 CloudSearch 索引。我看不到检索每个搜索结果的排名/分数的方法。可能吗?

4

1 回答 1

0

将排名表达式的名称添加到 return_fields 参数:

import boto
conn = boto.connect_cloudsearch(key,secret)
domain = conn.create_domain('domain_name')
search_service = domain.get_search_service()

results = search_service.search(query, return_fields=['text_relevance','name_of_custom_rank_expression'])

for result in results:
    score = result['data']['name_of_custom_rank_expression'][0]
于 2013-01-17T07:18:44.407 回答