Skip to content

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

Open
@bidoubiwa

Description

@bidoubiwa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions