我正在使用Boto的CloudSearch API来查询CloudSearch索引。我找不到检索每个搜索结果的排名/分数的方法。有可能吗?
答案 0 :(得分:0)
将rank表达式的名称添加到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]