Next.js starter store considerations
The Ruby Next.js starter store includes several search-related factors to consider, particularly when integrating with different search engines. By default, the store uses Elasticsearch. However, it can also be configured to use Solr through the HCL Commerce Orchestration Service.
The Orchestration Service facilitates interoperability between Elasticsearch and Solr by translating queries between the two engines. While this enables flexibility in choosing a search backend, not all query patterns or features are compatible across both engines. As a result, some queries may produce different results depending on the underlying search engine.
This document outlines known limitations and key points when using Solr via the Orchestration Service. This is a dynamic list and may be updated as support is improved or constraints are addressed.
The KeywordSuggestionByTerm API does not work after product name update
The Ruby storefront can encounter an issue where a product name ceases to be searchable for certain customers after the name is updated within HCL Commerce. This behvior occurs because two levels of caches influence the Next.js search: the browser cache, and the Next.js server side cache.
In a case where a customer has searched for a product by name, the product name was subsequently changed, and then the customer searches again, the browser cache and the server side caches can lose synchronization. The server cache has a 1 minute TTL, so this situation is expected to be rare. To avoid it, the browser cache must be properly invalidated.
- Wait for the index update process to complete.
- Wait for one more minute.
- Do a hard refresh on the browser (Ctrl-F5 or open a new browser tab to relaunch the Ruby store).
Ruby store preview does not trigger delta reindex
Ruby is not able to trigger index updates through store preview, so preview changes can only be based on a scheduler job Creating and scheduling the UpdateSearchIndex job.
UpdateSearchIndex does not run for delta index under workspace, hence Business user can not preview the change in workspace.