Skip to content

Commit d7a8cf6

Browse files
committed
Add language filter to algolia search
1 parent 3f58dde commit d7a8cf6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ document.addEventListener('DOMContentLoaded', () => {
1717
},
1818
mounted() {
1919
const selector = document.querySelector('.docSearch-input')
20+
const lang = document.documentElement.lang || 'en'
2021

2122
docsearch({
2223
apiKey: '31f842779e5b33726ec73f8f973b2202',
2324
indexName: 'nativescript-vue',
2425
inputSelector: selector,
25-
debug: true // Set debug to true if you want to inspect the dropdown
26+
algoliaOptions: {facetFilters: [`lang:${lang}`]},
27+
debug: false
2628
})
2729
},
2830
destroyed() {

0 commit comments

Comments
 (0)