本文整理汇总了Python中boto.cloudsearch.search.SearchConnection.build_query方法的典型用法代码示例。如果您正苦于以下问题:Python SearchConnection.build_query方法的具体用法?Python SearchConnection.build_query怎么用?Python SearchConnection.build_query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boto.cloudsearch.search.SearchConnection
的用法示例。
在下文中一共展示了SearchConnection.build_query方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cloudsearch_search_nextpage
# 需要导入模块: from boto.cloudsearch.search import SearchConnection [as 别名]
# 或者: from boto.cloudsearch.search.SearchConnection import build_query [as 别名]
def test_cloudsearch_search_nextpage(self):
"""Check next page query is correct"""
search = SearchConnection(endpoint=HOSTNAME)
query1 = search.build_query(q='Test')
query2 = search.build_query(q='Test')
results = search(query2)
self.assertEqual(results.next_page().query.start,
query1.start + query1.size)
self.assertEqual(query1.q, query2.q)
示例2: test_cloudsearch_results_matched
# 需要导入模块: from boto.cloudsearch.search import SearchConnection [as 别名]
# 或者: from boto.cloudsearch.search.SearchConnection import build_query [as 别名]
def test_cloudsearch_results_matched(self):
"""
Check that information objects are passed back through the API
correctly.
"""
search = SearchConnection(endpoint=HOSTNAME)
query = search.build_query(q='Test')
results = search(query)
self.assertEqual(results.search_service, search)
self.assertEqual(results.query, query)