【问题标题】:Elasticsearch Percolator with python api带有 python api 的 Elasticsearch Percolator
【发布时间】:2023-04-01 20:30:01
【问题描述】:

您好,我正在尝试使用“elasticsearch.py​​”api 进行渗透索引。但我什至没有得到任何结果。

API 文档似乎有 3 或 4 个与渗透相关的函数。

我已经检查了以下可能性。谁能帮帮我,让我解决一下。

es = Elasticsearch()
query = {'query': {'term': {'message': 'bonsai tree'}}}
es.create(index='test', doc_type='message', percolate=query, id='kuku2', body = {"message":"bonsai tree"})
doc = {'doc': {'message': 'I am a bonsai tree'}}
k = es.percolate(index='test', doc_type='type1', body=doc)
print k

###### 结果#####

 u'matches': [], u'total': 0, u'took': 0, u'_shards': {u'successful': 1, u'failed': 0, u'total': 1}}

我希望“es.percolate”用于搜索。 “es.create”允许我们将文档注册为渗透索引。但是文档中并没有那么完美地提到它。 “.percolate”也用于代替索引。请帮忙。

【问题讨论】:

  • @IMOTOV - 你能帮帮我吗......

标签:
python
elasticsearch
elasticsearch-percolate