elastic / search-ui

Search UI. Libraries for the fast development of modern, engaging search experiences.
https://docs.elastic.co/search-ui
Apache License 2.0
1.92k stars 368 forks source link

Elasticsearch API Connector - local dev? #1022

Closed ColeDCrawford closed 8 months ago

ColeDCrawford commented 8 months ago

Describe the bug In production I will be using Elastic Cloud, but want to be able to connect to my localhost version of Elasticsearch during development. It is running at https://localhost:9200 with Docker Compose. I am trying to connect using an API key. If I provide https://localhost:9200 as the host, I get the error http client did not trust this server's certificate, closing connection from Elasticsearch and An unexpected error occurred: Failed to fetch from SearchUI on the client side console. If I use http://localhost:9200, I get received plaintext http traffic on an https channel, closing connection. Is there a way to run this without proxying, either through an Elasticsearch config change or a SearchUI config change? On the backend of my app I am using Django Elasticsearch DSL and can pass in the ca.crt, but I don't think there are any options for this in SearchUI unless there's a custom headers option I am missing.

@joemcelroy any ideas?

Which backends and packages are you using: Backend: Elasticsearch 8.12 Packages:

    "@elastic/react-search-ui-views": "1.20.2",
    "@elastic/search-ui": "1.20.2",
    "@elastic/search-ui-app-search-connector": "1.20.2",
    "@elastic/search-ui-elasticsearch-connector": "1.20.2"
ColeDCrawford commented 8 months ago

Any notes here, or is it not possible to use with a local Elasticsearch instance without proxying?

joemcelroy commented 8 months ago

hey its possible to use locally but theres couple of things: