我不确定我是否正在使用 NDB Search API,因为它应该被使用。我已经通读了文档,但我认为我要么缺少某些东西,要么缺乏我的 python 技能。任何人都可以确认/改进使用搜索的这种进展吗?
# build the query object
query_options = search.QueryOptions(limit=results_per_page, offset=number_to_offset)
query_object = search.Query(query_string=escaped_param, options=query_options)
# searchResults object
video_search_results = videos.INDEX.search(query_object)
# ScoredDocuments list
video_search_docs = video_search_results.results
# doc_ids
video_ids = [x.doc_id for x in video_search_docs]
# entities
video_entities = [Video.GetById(x) for x in video_ids]