# Use Elasticsearch server

## Setup Sitefinity CMS to use Elasticsearch

> info  **PREREQUISITES**: As of Sitefinity CMS 15.4.8641, you must use Elasticsearch server version 9.5.3. If you upgrade to Sitefinity CMS 15.4.8641 or later, you must upgrade your Elasticsearch server to version 9.5.3 and reindex all Elasticsearch search indexes. For earlier Sitefinity CMS versions, you must use Elasticsearch server version 8.11.0. Using any other Elasticsearch version may cause compatibility issues.

To use an Elasticsearch server for Sitefinity search indexes, perform the following:

1. In Sitefinity CMS backend, navigate to *Administration » Settings »* *Search*.
2. Under *Which search service to use in your site*?, select *Elasticsearch*.
3. In *Elasticsearch URL*, enter the root URL of your Elasticsearch  server.\
   The default value is `http://localhost:9200/`.
4. If the Elasticsearch client is using authentication, you must also configure the following properties. If no authentication is configured for the Elasticsearch, leave the following fields blank:
   * *Elasticsearch Username*
   * *Elasticsearch Password* The password is encrypted and is displayed as any other password in the browser.
5. Click *Save changes*.

After changing the search service or the location of the Elasticsearch server, you must reindex any existing indexes manually, otherwise they will not work. Use the *Reindex* button on the *Search* basic settings screen to reindex all active search indexes in bulk.

> info  **NOTE**: Highlighting in Elasticsearch is limited to 1,000,000 text characters. To increase this limit, you must make a `PUT` request with following code: \
> `PUT /<index_name>/_settings 
> { "index" : { "highlight.max_analyzed_offset" : 10000000 } }`.
