Skip to content

Send search request to Algolia with some delay #5174

@Markeli

Description

@Markeli

🚀 Feature

Now a new search request is sending to Aloglia on each query change. I want to reduce the number of requests to Aloglia. It would be nice if Docusarus will have some delay option n config. If the delay is set, the request will be sent if the user is not printing. Without delay in the config, the search behavior will be the same as now.

Have you read the Contributing Guidelines on issues?

Yes.

Motivation

This feature can reduce the number of requests to Algolia, and therefore reduce the costs of search.

API Design

Add new option to Algolia search plugin config. If the delay is set search query will be sent only after a user stops inputting the query. I assume that desired behavior can be easily achieved by React hooks. There is an example on StackOverflow: https://stackoverflow.com/questions/53071774/reactjs-delay-onchange-while-typing

Have you tried building it?

Unfortunately, I'm not a react developer, so I can't build it myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions