diff --git a/assets/js/autosuggest.js b/assets/js/autosuggest.js index 9eeb180b16..f407566f85 100644 --- a/assets/js/autosuggest.js +++ b/assets/js/autosuggest.js @@ -562,6 +562,13 @@ function init() { query = JSON.stringify(query); } + // Allow filtering the search query based on the input. + if (typeof window.epAutosuggestQueryFilter !== 'undefined') { + query = JSON.stringify( + window.epAutosuggestQueryFilter(JSON.parse(query), searchText, input), + ); + } + // fetch the results const response = await esSearch(query, searchText);