我正在使用Python使用elasticsearch。我的代码看起来有点像这样:
from elasticsearch import Elasticsearch
if __name__ == '__main__':
index="IndexPosition"
es=Elasticsearch(['https://localhost:8080'])
res = es.search(index='{0}'.format(index), doc_type="log",size=1000, from_=0, body={ "query": {
"match": {
...Match condition
}
}
}})
现在,由于架构的更改,用户身份验证已添加到elasticsearch中。假设用户名为"user",密码为"pass"。我该如何在查询中传递用户名和密码?
http_auth
参数的? - GeneticsGuy