Skip to content

0.21 meilisearch breaking changes #516

@nezaboravi

Description

@nezaboravi
  • Scout Version: v9.2.8
  • Scout Driver: MeiliSearch
  • Laravel Version: 8.58.0
  • PHP Version: 8.0.9
  • Database Driver & Version: mySql 8.0.25 for macos11.3 on x86_64 (Homebrew)

Description:

Since last changes on meilisearch, filters are not working.
I have seen changes and updated code, so instead of 'filters' now is a 'filter' as a index

MeiliSearch\Exceptions\ApiException
Json deserialize error: unknown field `filters`, expected one of `q`, `offset`, `limit`, `attributesToRetrieve`, `attributesToCrop`, `cropLength`, `attributesToHighlight`, `matches`, `filter`, `facetsDistribution` at line 1 column 31

When I replace it with filter, I am getting error that my field cant be indexed, as its not indexable.

--> 1:1 | 1 | active=1 | ^----^ | = attribute `active` is not filterable, available filterable attributes are: (View: 

Meili search documentation says this:

"By default, filterableAttributes is empty. This means that filters do not work without first explicitly adding attributes to the filterableAttributes list."

I cant find a way to add attributes to filterableAttributes list. I suppose I can manually 'curl' update, but this just is not a solution. Anyone has idea how to make filterableAttributes?

Steps To Reproduce:

ad filter and and search using filter

Model::search(
            $query,
            function ($meilisearch, $query, $options) {
                // $options['filters'] = 'active=1'; // breaking change in meilisearch 0.21
                 // $options['filter'] = 'active=1'; // change it to filter, without s
                return $meilisearch->search($query, $options);
            }
        )
        ```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions