// algoliaUnifiedUi.js
export default class AlgoliaUnifiedUi extends LightningElement {
renderedCallback() {
// Ensure this matches your products index's name
const productsIndexName =
"zzaa_001_sandbox_us01_dx__RefArch__products__en_US";
const currencyCode = "EUR";
window.UnifiedUI.start({
inputContainer: this.template.querySelector(".site-search"),
keyboardShortcuts: false,
appId: "ALGOLIA_APPLICATION_ID",
searchApiKey: "ALGOLIA_SEARCH_API_KEY",
currencyCode,
index: {
indexName: productsIndexName,
searchParameters: {
analytics: true,
clickAnalytics: true,
hitsPerPage: 18,
attributesToSnippet: ["short_description:25"],
},
},
sorts: [
{
label: "Price ascending",
value: `${productsIndexName}__price_${currencyCode}_asc`,
},
{
label: "Price descending",
value: `${productsIndexName}__price_${currencyCode}_desc`,
},
],
});
}
}