New parameters for ElasticsearchDocumentStore initializer? #7402
-
Hi, we have an existing implementation of Haystack v1.25 with Python 3.10 and ElasticSearch 8. We use https for the connection, with a provided certificate. We're testing through upgrading to 2.0 and notice that the parameters have changed for the initializer for the ElasticsearchDocumentStore class? We used to use: document_store = ElasticsearchDocumentStore( Leaving username as username obtains: TypeError: init() got an unexpected keyword argument 'username' We noticed that the parameter for host was changed to hosts, and now includes the protocol identifier and port. But there is no way to put the username and password into the connection string like one might (i.e. https://user:pass@host:port), since that obtains: ValueError: URL must include a 'scheme', 'host', and 'port' component (ie 'https://localhost:9200') In the present example at https://docs.haystack.deepset.ai/docs/elasticsearch-document-store, you have: document_store = ElasticsearchDocumentStore(hosts = "http://localhost:9200") What is the purpose of the <> surrounding the URL? Is that an array specifier I've not seen before? Is it required for a single host? Edit: Markdown eats the braces. Was that their intended purpose originally? Regardless of the username and password, how do we specify the path to our certificate? Where is the documentation on either the breaking change or the new parameter set for the ElasticSearchDocumentStore class? We love the product and all but we found the documentation on migrations posted here: https://docs.haystack.deepset.ai/docs/migration to be a bit lacking ;) Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For the potential future searcher, there is additional documentation to be found here: and here: and tbh this probably should've been posted on the haystack_integrations repo because that's where the ElasticsearchDocumentStore class is. But in any case the docs clearly do say, if you look hard: and "For more details on how to connect to Elasticsearch and configure security, see the official Elasticsearch documentation" so we can pass through the extra params directly to the native Elasticsearch initializer. Putting it all together, results in new connection string:
which tests good. Thanks! |
Beta Was this translation helpful? Give feedback.
For the potential future searcher, there is additional documentation to be found here:
https://github.com/deepset-ai/haystack-integrations/blob/main/integrations/elasticsearch-document-store.md
and here:
https://docs.haystack.deepset.ai/reference/integrations-elasticsearch#module-haystack_integrationsdocument_storeselasticsearchdocument_store
and tbh this probably should've been posted on the haystack_integrations repo because that's where the ElasticsearchDocumentStore class is. But in any case the docs clearly do say, if you look hard:
and
"For more details on how to connect to Elasticsearch and configure security, see the official Elasticsearch documentation"
Which itself states:
so…