facebook / facebook/docusaurus

Algolia plugin SearchPage does not respect configuration

Open
#3,805 15 comments 5 reactions 0 assignees View on GitHub
bug domain: search
Dominant language
TypeScript
Stars
66.2k
Forks
10k
Avg merge
1d 3h
Merged PRs (30d)
52

Description

## 🐛 Bug Report

Use some algolia config like:

```
algolia: {
apiKey: '47ecd3b21be71c5822571b9f59e52544',
indexName: 'docusaurus-2',
contextualSearch: true,
searchParameters: {facetFilters: ['bad:filter']},
},
```

Due to the presence of `bad:filter`, it should actually never find any result.

But the current search page does not respect the plugin configuration options.

We should rather make the search page results consistent with the navbar search input / modal results, and use the plugin options.

**Edit**: if contextual search is not enable, we should not append any facet filter to the query by default, to prevent issues such as https://github.com/facebook/docusaurus/issues/4644

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.