facebook / facebook/docusaurus

`getMissingResultsUrl` not supported by algolia options in docusaurus config

Aperta
#10,737 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug closed: wontfix
Lingua principale
TypeScript
Stelle
66.2k
Fork
10k
Merge medio
1g 3h
PR unite (30g)
52

Descrizione

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Prerequisites

- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the `npm run clear` or `yarn clear` command.
- [X] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).

### Description

Hello there!

I'm trying to add a message at the bottom of Algolia search results that prompts the user to open a GitHub issue if no results are found. The [Docusaurus documentation](https://docusaurus.io/docs/search#customizing-the-algolia-search-behavior) pointed me to the [Algolia DocSearch documentation](https://docsearch.algolia.com/docs/api/#getmissingresultsurl) which references a `getMissingResultsUrl` option. That option isn't available on the [algolia config type](https://github.com/facebook/docusaurus/blob/9c0e19c669ffcbc0972bfd8527e8b93f1f74e7d8/packages/docusaurus-theme-search-algolia/src/theme-search-algolia.d.ts#L12) but I tried anyway as I thought it might still work.

Unfortunately, it doesn't. So I'm guessing the search component used inside Docusaurus doesn't take this option into account.

### Reproducible demo

https://stackblitz.com/edit/github-kv4zyn?file=docusaurus.config.ts

### Steps to reproduce

1. Update `algolia.appId` and `algolia.apiKey` with valid values
2. Use the search functionality to find something that doesn't exist (I use `thisissomethingthatdoesntexist`)
3. See that a "missing results" blurb is not present (as seen [here](https://docsearch.algolia.com/docs/api/#getmissingresultsurl))

### Expected behavior

The "missing results" blurb should be visible and editable.

### Actual behavior

There is no "missing results" sentence, nor does one appear if the `getMissingResultsUrl` option is set.

### Your environment

_No response_

### Self-service

- [ ] I'd be willing to fix this bug myself.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.