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

Support using api key to connect selfhosted Elasticsearch #2156

Open
yp05327 opened this issue Jan 18, 2025 · 1 comment
Open

Support using api key to connect selfhosted Elasticsearch #2156

yp05327 opened this issue Jan 18, 2025 · 1 comment

Comments

@yp05327
Copy link

yp05327 commented Jan 18, 2025

🐛 Describe the bug

# Initialize Elasticsearch client
if config.cloud_id:
self.client = Elasticsearch(
cloud_id=config.cloud_id,
api_key=config.api_key,
verify_certs=config.verify_certs,
)
else:
self.client = Elasticsearch(
hosts=[f"{config.host}" if config.port is None else f"{config.host}:{config.port}"],
basic_auth=(config.user, config.password) if (config.user and config.password) else None,
verify_certs=config.verify_certs,
)

The initialize of Elasticsearch only support using api key to connect to the cloud service.
For the selfhosted instance, I can also use api_key to connect it. So api_key should also be provided in L37-L39.

@yp05327
Copy link
Author

yp05327 commented Jan 21, 2025

This is a sample to fix this issue: yp05327@ab9940c

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

1 participant