Skip to content

Commit 95e750f

Browse files
author
Anthony Seure
committed
chore: Do not restrict search on product section
**🔖 Summary** Following some recent improvements we made for the documentation's search, this commit is a suggestion to remove an odd feature: currently, when the search feature is triggered from a specific product section, the search results which belong to that section are surfaced first, even though they are less relevant. From my experience, and according to others, this is rather confusing, and this change is about preventing that behavior, effectively surfacing the most relevant results, no matter which page the user is currently browsing. **🚧 Changes** - Remove the Algolia [`optionalFilters`](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/how-to-promote-with-optional-filters/) which were responsible for promoting lesser relevant search results from the currently browsed page. **✅ Testing plan** - Ran the documentation locally using `npm run dev` and looked at the before/after XHR requests going to Algolia to make sure the `optionalFilters` are not present anymore (also see the before/after screenshots showing what the search results look like).
1 parent 366d92f commit 95e750f

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

assets/search.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88

99
let {
1010
apikey: apiKey,
11-
product,
1211
index: indexName,
1312
} = algoliaConfig
1413

15-
const facetFilters = product ? [`product:${product}`] : []
16-
1714
function loaded() {
1815
window.docsearch({
1916
indexName,
@@ -33,9 +30,6 @@
3330
getMissingResultsUrl({ query }) {
3431
return `/search/?q=${query}`;
3532
},
36-
searchParameters: {
37-
optionalFilters: facetFilters
38-
},
3933
transformItems: items => {
4034
return items.filter(item => {
4135
const url = new URL(item.url)

0 commit comments

Comments
 (0)