diff options
author | Sarah German <sgerman@gitlab.com> | 2022-06-15 19:50:55 +0300 |
---|---|---|
committer | Sarah German <sgerman@gitlab.com> | 2022-06-15 19:50:55 +0300 |
commit | 65b328c808c21ac18772c9bb8894f2f1bfc08112 (patch) | |
tree | 3b8323b69d2bcd72785d0d4e770d6a6a450e7300 | |
parent | 7002de1bafe9fabc0953347b5d8a8b534b6fe6b4 (diff) |
Backport version faceting for InstantSearchinstantsearch-facet-14.9
-rw-r--r-- | content/frontend/search/index.js | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/content/frontend/search/index.js b/content/frontend/search/index.js index 1c658dc9..917ec4b4 100644 --- a/content/frontend/search/index.js +++ b/content/frontend/search/index.js @@ -1,23 +1,12 @@ import instantsearch from 'instantsearch.js'; import { singleIndex } from 'instantsearch.js/es/lib/stateMappings'; -import { - searchBox, - refinementList, - infiniteHits, - stats, - poweredBy, - configure, -} from 'instantsearch.js/es/widgets'; +import { searchBox, infiniteHits, stats, poweredBy, configure } from 'instantsearch.js/es/widgets'; import algoliasearch from 'algoliasearch'; document.addEventListener('DOMContentLoaded', () => { const search = instantsearch({ indexName: 'gitlab', searchClient: algoliasearch('3PNCFOU757', '89b85ffae982a7f1adeeed4a90bb0ab1'), - algoliaOptions: { - // Filter by tags as described in https://github.com/algolia/docsearch-configs/blob/master/configs/gitlab.json - filters: 'tags:gitlab<score=3> OR tags:omnibus<score=2> OR tags:runner<score=1>', - }, routing: { stateMapping: singleIndex('gitlab'), }, @@ -41,15 +30,6 @@ document.addEventListener('DOMContentLoaded', () => { container: '#powered-by', }), - refinementList({ - container: '#refinement-list', - attribute: 'tags', - sortBy: ['name:asc', 'isRefined'], - templates: { - header: 'Refine your search:', - }, - }), - infiniteHits({ container: '#hits', templates: { @@ -67,6 +47,7 @@ document.addEventListener('DOMContentLoaded', () => { configure({ // Number of results shown in the search dropdown hitsPerPage: 10, + facetFilters: [`version:14.9`], }), ]); |