Skip to content

Commit 3fd75a5

Browse files
authored
add missing indexName for autocomplete sections (#1133)
1 parent 6a9ebd2 commit 3fd75a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

view/frontend/web/internals/common.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ requirejs(['algoliaBundle'], function(algoliaBundle) {
292292

293293
hit.displayKey = hit.displayKey || hit.name;
294294

295+
hit.__indexName = algoliaConfig.indexName + "_" + section.name;
295296
hit.__queryID = payload.queryID;
296297
hit.__position = payload.hits.indexOf(hit) + 1;
297298

@@ -336,6 +337,7 @@ requirejs(['algoliaBundle'], function(algoliaBundle) {
336337
var toEscape = hit._highlightResult.query.value;
337338
hit._highlightResult.query.value = algoliaBundle.autocomplete.escapeHighlightedString(toEscape);
338339

340+
hit.__indexName = algoliaConfig.indexName + "_" + section.name;
339341
hit.__queryID = payload.queryID;
340342
hit.__position = payload.hits.indexOf(hit) + 1;
341343

@@ -355,6 +357,7 @@ requirejs(['algoliaBundle'], function(algoliaBundle) {
355357
suggestion: function (hit, payload) {
356358
hit.url = algoliaConfig.baseUrl + '/catalogsearch/result/?q=' + hit.value + '&refinement_key=' + encodeURIComponent(section.name);
357359

360+
hit.__indexName = algoliaConfig.indexName + "_section_" + section.name;
358361
hit.__queryID = payload.queryID;
359362
hit.__position = payload.hits.indexOf(hit) + 1;
360363

0 commit comments

Comments
 (0)