Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I set X-opaque-Id to header when searching? #847

Closed
ryook opened this issue Sep 20, 2018 · 3 comments
Closed

How can I set X-opaque-Id to header when searching? #847

ryook opened this issue Sep 20, 2018 · 3 comments

Comments

@ryook
Copy link

ryook commented Sep 20, 2018

I want to set X-opaque-Id to header to track task.
There is API in elasticsearch, Can't I use it using this library?

https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#_identifying_running_tasks

@abhishek063
Copy link

+1. I was wondering the same. How to set this in python elasticsearch library?

@e9
Copy link

e9 commented Dec 25, 2019

es = Elasticsearch(["http://localhost:9200"], headers={"x-opaque-id": "123456"})
res = es.search(...)

@sethmlarson
Copy link
Contributor

This has been fixed in #1135, can be set per API request or on the client like so:
This will be available in elasticsearch>=7.6.0.

es = Elasticsearch(..., opaque_id="app-1")
es.search(..., opaque_id="request-2")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants