Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve usage of the @algolia/autocomplete-plugin-recent-searches plugin #1148

Open
bidoubiwa opened this issue Jun 7, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@bidoubiwa
Copy link
Contributor

Description
Currently the recent-search plugins requires your document to contain a ObjectID field that itself contains the value of the query. This is a mistake on their part, see here.

This means that the index containing the query suggestion of another index must have an ObjectID field:
For example:

{
    "id": 1,
    "popularity": 1214,
    "query": "cooktop",
    "objectID": "cooktop"
  }

Additionally, ObjectID must also be added in the filterableAttributes

{
  "filterableAttributes": ["objectID"]
}

Solution
To tackle this issue, we should create our own getAlgoliaSearchParams, named getMeilisearchSearchParams.

That method should me similar to the one from algolia, but instead of using ObjectID it should use the query field in this line.

@bidoubiwa bidoubiwa added the enhancement New feature or request label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant