本文整理汇总了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")