Last update:
May 8, 2024
Elasticsearch¶
The Virto Commerce Elastic Search module enables integrating Elasticsearch as a search engine.
ElasticSearch implements ISearchProvider
defined in the Virto Commerce Search module and uses the Elasticsearch engine, which stores indexed documents on:
Configuration¶
To configure Elasticsearch as a search provider, use the following schema:
Node | Default or Sample Value | Description |
---|---|---|
Search.Provider | "ElasticSearch" |
Specifies the search provider name, which must be set to "ElasticSearch". |
Search.Scope | "default" |
Specifies the common name (prefix) for all indexes. Each document type is stored in a separate index, and the full index name is scope-{documenttype} . This allows one search service to serve multiple indexes. The key is optional. Its default value is default . |
Search.ElasticSearch.Server | Specifies the network address and port of the Elasticsearch server. | |
Search.ElasticSearch.User | "elastic" |
Specifies the username for either the Elastic Cloud cluster or private Elasticsearch server. |
Search.ElasticSearch.Key | (Optional) Specifies the password for either the Elastic Cloud cluster or private Elasticsearch server. | |
Search.ElasticSearch.EnableCompatibilityMode | false |
(Optional) Set this to "true" to use Elasticsearch v8.x or "false" (default) for earlier versions. |
Search.ElasticSearch.EnableHttpCompression | false |
(Optional) Set this to "true" to enable gzip compressed requests and responses or "false" (default) to disable compression. |
Search.ElasticSearch.CertificateFingerprint | During development, you can provide the server certificate fingerprint. When present, it is used to validate the certificate sent by the server. The fingerprint is expected to be the hex string representing the SHA256 public key fingerprint. |
Examples
Note
Virto Commerce has its native Elasticsearch 8.x module. The current module works with Elasticsearch 8.x in compatibility mode.
Enable the compatibility mode for Elastic Cloud v8.x:
Configure Elasticsearch v8.x without security features enabled:
appsettings.json
"Search": {
"Provider": "ElasticSearch",
"Scope": "default",
"ElasticSearch": {
"EnableCompatibilityMode": "true",
"Server": "https://localhost:9200"
}
}
Configure Elasticsearch v8.x with ApiKey authorization:
Configure Elastic Cloud v7.x as follows: