Indexing Service
Configure search indexer to bring great searching experience on your storefront.
The Indexing Service is designed to help you configure the search index in your Emporix instance.
The Indexing Service is responsible for including all your resources, such as products, or categories, in the search index and make them searchable on your storefront. You have to enable your own indexing service on Emporix by providing your credentials for the index provider into CE platform. Currently, the supported index provider is Algolia. For more information how you can configure search, see Search Configuration.
The Indexing Service gives you the possibility to provide your own API keys to the indexing provider, separately for each tenant. This approach gives you more flexibility in configuration.
There are two groups of endpoints in the Indexing Service:
Secured endpoints - that require a security scope and serve managing configuration.
Example response:
{ "active": true, "searchKey": "84dc4886f81f805c42bdd89d64de751a", "applicationId": "8AP2HABA2I", "indexName": "exampleTenant", "provider": "ALGOLIA", "writeKey": "51ebe89215dddcf85e5dacd5643d17e7" }
Public endpoints - that do not require any security scopes and they can be used directly on a storefront. The public endpoints do not return a
writeKey
, but asearchKey
only.
Even though the public endpoints do not require any scopes, an authorization token is required to complete the request.
Example response:
```
{
"active": true,
"searchKey": "84dc4886f81f805c42bdd89d64de751a",
"applicationId": "8AP2HABA2I",
"indexName": "exampleTenant",
"provider": "ALGOLIA"
}
```
Reindexing data
Be aware that changing configuration for indexing provider isn't enough to apply your changes in the index. Usually, the indexing process of your data is triggered by changes done on your products, or dependant entities, such as category, price, media etc. There is a scheduler job that discovers the delta changes on the resource data and starts reindexing of the updated instances, so that they are searchable on the storefront.
Applying the changes done to the search index configuration require updating all existing product data. To avoid updating all the data, there is a reindexing mechanism available. So, if you change the index configuration, remember to reindex all your product data by using the reindex
endpoint.
Indexing strategies
As Emporix is a multi-site solution, data on each site may differ, such as availability
or price
. Therefore, site-aware data must be included in the index. The Indexing Service provides two index strategies:
MERGE: the default strategy. The strategy creates just a single index that contains information from all the sites. The site-aware information is stored in
sitePrices
andsiteAvailabilities
properties. These properties are maps where a key corresponds to a site code and a value corresponds to theprice
oravailability
object respectively. This approach is more performant as you have only one index.
SPLIT: an alternative strategy. The strategy creates as many indices as the number of sites declared in the system. The index item does not contain
sitePrices
andsiteAvailabilities
fields. All the site-aware fields are available on the root level. This approach may be more flexible as a particular index contains only information related to one site. But, the fields that are not site-aware, likedescription
,name
etc are duplicated across all the indices. The number of indices is significantly higher.
Changing index strategy
Changing the index strategy can be done in the following ways:
System Preferences of the Emporix Management Dashboard: see the System Preferences.
API request to the Configuration Service
(If there is an already existing configuration for your tenant, send
PUT
request to update configuration. If there is no configuration yet, first send thePOST
request to create one. If there is no configuration, the MERGE strategy is used by default.)
Please remain patient as propagating changes to the index strategy may take up to 1 hour, so you might not be able to see the changes instantly.
Last updated
Was this helpful?