-
Notifications
You must be signed in to change notification settings - Fork 103
Troubleshooting Elasticsearch and Quepid
You will need to configure Elasticsearch to accept requests from the browser using CORS. To enable CORS, add the following to elasticsearch's config file. Usually, this file is located near the elasticsearch executable at config/elasticsearch.yml
.
http.cors:
enabled: true
allow-origin: /https?:\/\/localhost(:[0-9]+)?/
If you are using Basic Authentication, ie a URL in the format of [http|https]://[username:password@][host][:port]/[collectionName]/_search
then you will need to add:
http.cors:
enabled: true
allow-origin: /https?:\/\/localhost(:3000)?/
allow-credentials: true
allow-headers: "X-Requested-With, Content-Type, Content-Length, Authorization"
The last two lines allow for the authentication to happen via headers, which is the way Elasticsearch likes it. Notice the allow-origin
is set up to only allow access from port 3000.
We now have three different versions of Elasticsearch deployed with the same TMDB dataset, which is useful if you have a new feature that you want to make sure is backwards compatible.