meilisearch-rust icon indicating copy to clipboard operation
meilisearch-rust copied to clipboard

[v1.14] Filterable attributes settings opt-out

Open Strift opened this issue 8 months ago • 0 comments

This issue follows the changes related to Meilisearch v1.14.0 mega issue.

Description

Update the settings API to handle the new filterableAttributes syntax.

For more context, see the related issue in Meilisearch: https://github.com/meilisearch/meilisearch/issues/5163

Tasks

  • [ ] Update the methods to update settings to accept the new filterableAttributes syntax
  • [ ] Update the methods to return the new filterableAttributes syntax (when Meilisearch returns it)
  • [ ] Update update_filterable_attributes_1 code sample in .code-samples.meilisearch.yaml

For reference, here's how the test are implemented in Meilisearch JS SDK:

// this mixes the old syntax (field name) and new syntax (settings opt-in)
const newFilterableAttributes = [
  "author",
  {
    attributePatterns: ["genre"],
    features: {
      facetSearch: true,
      filter: { equality: true, comparison: false },
    },
  },
];
// we update the filterable attributes settings
await client
  .index(index.uid)
  .updateFilterableAttributes(newFilterableAttributes)
  .waitTask();
// the method to retrieve filterable attributes settings can also return mixed syntax
const response = await client.index(index.uid).getFilterableAttributes();
expect(response).toEqual(newFilterableAttributes);

Strift avatar Apr 17 '25 05:04 Strift