本文整理汇总了Python中elasticsearch_tornado.BaseClient类的典型用法代码示例。如果您正苦于以下问题:Python BaseClient类的具体用法?Python BaseClient怎么用?Python BaseClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mtermvector
def test_mtermvector(self):
c = BaseClient()
body = """
{
"docs": [
{
"_index": "testidx",
"_type": "test",
"_id": "2",
"term_statistics": true
},
{
"_index": "testidx",
"_type": "test",
"_id": "1",
"fields": [
"text"
]
}
]
}
"""
c.mtermvectors(
index = 'index',
doc_type = 'index',
body = body,
cb=self.handle_cb,
)
self.wait()
示例2: test_abort_benchmark
def test_abort_benchmark(self):
c = BaseClient()
c.abort_benchmark(
name = 'test',
cb = self.handle_cb,
)
self.wait()
示例3: test_suggest
def test_suggest(self):
c = BaseClient()
c.suggest(
'{"bulk":"bulk1","id_":"bulk1"}', index='test',
cb=self.handle_cb
)
self.wait()
示例4: test_scroll
def test_scroll(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400]}
)
c.scroll('test', cb=h_cb)
self.wait()
示例5: test_get_doc
def test_get_doc(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 403, 404]}
)
c.get_doc('test', 'test123', callback=h_cb)
self.wait()
示例6: test_clear_scroll
def test_clear_scroll(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 403, 404]}
)
c.clear_scroll('aaaaa', cb=h_cb)
self.wait()
示例7: test_get_source
def test_get_source(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 403, 404]}
)
c.get_source('test', 'test123', cb=h_cb)
self.wait()
示例8: test_search_template
def test_search_template(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 404, 403,]}
)
c.search_template(index='test', doc_type='test', cb=h_cb)
self.wait()
示例9: test_put_template
def test_put_template(self):
c = BaseClient()
c.put_template(
'temp123',
'{"template":"test123"}',
cb = self.handle_cb,
)
self.wait()
示例10: test_count_percolate
def test_count_percolate(self):
c = BaseClient()
c.count_percolate(
'test',
'test',
cb=self.handle_cb
)
self.wait()
示例11: test_mtermvector
def test_mtermvector(self):
c = BaseClient()
c.mtermvectors(
index = 'index',
doc_type = 'index',
cb=self.handle_cb,
)
self.wait()
示例12: test_exists
def test_exists(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 403, 404]}
)
c.exists('test', 'test123', cb=h_cb)
self.wait()
示例13: test_index
def test_index(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 403, 404]}
)
c.index('test', 'test', '{"test":"123"}', doc_id='test123', cb=h_cb)
self.wait()
示例14: test_search_shards
def test_search_shards(self):
c = BaseClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 404, 403,]}
)
c.search_shards(index='test', doc_type='test', callback=h_cb)
self.wait()
示例15: test_termvector
def test_termvector(self):
c = BaseClient()
c.termvector(
'index',
'index',
'bulk1',
cb=self.handle_cb,
)
self.wait()