|
|
# Configure Elasticsearch as search engine
|
|
|
|
|
|
To configure Elasticsearch as your Search Engine, you must follow this steps:
|
|
|
|
|
|
1. From the Ghost **Code injection**, insert the following code into the _Site Header_
|
|
|
```html
|
|
|
<script type="text/javascript">
|
|
|
var elasticsearch_username = '<ELASTICSEARCH_USERNAME>';
|
|
|
var elasticsearch_password = '<ELASTICSEARCH_PASSWORD>';
|
|
|
var elasticsearch_auth = btoa(elasticsearch_username + ":" + elasticsearch_password);
|
|
|
</script>
|
|
|
```
|
|
|
2. If you Elasticsearch endpoint URL is different than the suggested one (`/api/search`), then precise the URL in addition to the other information:
|
|
|
```javascript
|
|
|
var elasticsearch_endpoint = 'https://my-elasticsearch.com';
|
|
|
``` |