django-haystack
django-haystack copied to clipboard
Latest Elasticsearch client not working with OpenSearch
- [✅ ] Tested with the latest Haystack release
- [ ] Tested with the current Haystack master branch
Expected behaviour
Elasticsearch Python client works with OpenSearch
Actual behaviour
https://github.com/elastic/elasticsearch-py/issues/1667
Steps to reproduce the behaviour
- Attempt to connect to OpenSearch cluster with latest Elasticsearch client using the elasticsearch7 backend
Recommended Steps
Support OpenSearch (API compatible with Elasticsearch 7) as a backend https://opensearch.org/docs/latest/clients/python/
Configuration
- Operating system version: Debian 11 Bullseye
- Search engine version: Elasticsearch 7
- Python version: 3.8
- Django version: 2.2.23
- Haystack version: 3.1.1
Are there any updates?
I have a working setup.
I have this in my setting:
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch7_backend.Elasticsearch7SearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'site-haystack',
},
}
Using:
- django-haystack==3.1.1
- django==3.1.9
- elasticsearch==7.13.3
- python 3.8.7
latest opensearch from homebrew. (opensearch 1.2.4)
The commands update_index and rebuild_index work and my search functionality also works on my test setup.
Is the correct resolution to implement an opensearch_backend that's based on elasticsearch7_backend, but uses opensearch-py instead?
@acdha Looks like you're the most active recent maintainer; any thoughts?
@bhrutledge I tried that, but ended down a rabbit hole of incompatible APIs: https://github.com/automartin5000/django-haystack