当前位置: 首页>>代码示例>>Python>>正文


Python RestConnection.create_fts_index方法代码示例

本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.create_fts_index方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.create_fts_index方法的具体用法?Python RestConnection.create_fts_index怎么用?Python RestConnection.create_fts_index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lib.membase.api.rest_client.RestConnection的用法示例。


在下文中一共展示了RestConnection.create_fts_index方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_fts_log_redaction

# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import create_fts_index [as 别名]
 def test_fts_log_redaction(self):
     gen_create = BlobGenerator('logredac', 'logredac-', self.value_size, end=self.num_items)
     self._load_all_buckets(self.master, gen_create, "create", 0)
     index_definition = {
         "type": "fulltext-index",
         "name": "index1",
         "sourceType": "couchbase",
         "sourceName": "default"
     }
     rest = RestConnection(self.master)
     status = rest.create_fts_index("index1", index_definition)
     if status:
         log.info("Index 'index1' created")
     else:
         log.info("Error creating index, status = {0}".format(status))
     self.sleep(60, "waiting for docs to get indexed")
     query_json = {"query": {"field": "type", "match": "emp"}}
     hits, _, _, _ = rest.run_fts_query(index_name="index1",
                        query_json=query_json)
     log.info("Hits from query {0}: {1}".format(query_json, hits))
     self.set_redaction_level()
     self.start_logs_collection()
     result = self.monitor_logs_collection()
     try:
         logs_path = result["perNode"]["[email protected]" + str(self.master.ip)]["path"]
     except KeyError:
         logs_path = result["perNode"]["[email protected]"]["path"]
     redactFileName = logs_path.split('/')[-1]
     nonredactFileName = logs_path.split('/')[-1].replace('-redacted', '')
     remotepath = logs_path[0:logs_path.rfind('/') + 1]
     self.verify_log_files_exist(remotepath=remotepath,
                                 redactFileName=redactFileName,
                                 nonredactFileName=nonredactFileName)
     self.verify_log_redaction(remotepath=remotepath,
                               redactFileName=redactFileName,
                               nonredactFileName=nonredactFileName,
                               logFileName="ns_server.fts.log")
开发者ID:arod1987,项目名称:testrunner,代码行数:39,代码来源:log_redaction_tests.py


注:本文中的lib.membase.api.rest_client.RestConnection.create_fts_index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。