MeiliSearch/crates
meili-bors[bot] a2a86ef4e2
Merge #5254
5254: Granular Filterable attribute settings r=ManyTheFish a=ManyTheFish

# Related
**Issue:** https://github.com/meilisearch/meilisearch/issues/5163
**PRD:** https://meilisearch.notion.site/API-usage-Settings-to-opt-out-indexing-features-filterableAttributes-1764b06b651f80aba8bdf359b2df3ca8

# Summary
Change the `filterableAttributes` settings to let the user choose which facet feature he wants to activate or not.
Deactivating a feature will avoid some database computation in the indexing process and save time and disk size.

# Example

`PATCH /indexes/:index_uid/settings`

```json
{
  "filterableAttributes": [
    {
      "patterns": [
        "cattos",
        "doggos.age"
      ],
      "features": {
        "facetSearch": false,
        "filter": {
          "equality": true,
          "comparison": false
        }
      }
    }
  ]
}
```

# Impact on the codebase
- Settings API:
  - `/settings`
  - `/settings/filterable-attributes`
  - OpenAPI 
  - may impact the LocalizedAttributesRules due to the AttributePatterns factorization
- Database:
  - Filterable attributes format changed
  - Faceted field_ids are no more stored in the database
  - FieldIdsMap has no more unexisting fields
- Search:
  - Search using filters
  - Facet search
  - `Attributes` ranking rule
  - Distinct attribute
  - Facet distribution
- Settings reindexing:
  - searchable
  - facet
  - vector
  - geo
- Document indexing:
  - searchable
  - facet
  - vector
  - geo
- Dump import

# Note for the reviewers
The changes are huge and have been split in different commits with a dedicated explanation, I suggest reviewing the commit 1by1

Co-authored-by: ManyTheFish <many@meilisearch.com>
2025-03-12 09:00:43 +00:00
..
benchmarks Update tests using filterable attributes rules 2025-03-03 10:33:34 +01:00
build-info Upgrade compatible dependencies 2025-01-08 13:52:14 +01:00
dump Update dumps 2025-03-03 10:33:39 +01:00
file-store Upgrade incompatible dependencies 2025-01-08 15:58:03 +01:00
filter-parser Refactor search and facet-search 2025-03-03 10:25:32 +01:00
flatten-serde-json Move crates under a sub folder to clean up the code 2024-10-21 08:18:43 +02:00
fuzzers Fix the tests to use the new replace/update documents 2025-02-03 10:34:07 +01:00
index-scheduler Merge #5254 2025-03-12 09:00:43 +00:00
json-depth-checker Move crates under a sub folder to clean up the code 2024-10-21 08:18:43 +02:00
meili-snap Upgrade compatible dependencies 2025-01-08 13:52:14 +01:00
meilisearch Merge #5254 2025-03-12 09:00:43 +00:00
meilisearch-auth Upgrade incompatible dependencies 2025-01-08 15:58:03 +01:00
meilisearch-types Merge #5254 2025-03-12 09:00:43 +00:00
meilitool Remove unsafes 2025-02-12 10:46:45 +01:00
milli Add default deserialize value 2025-03-11 17:55:49 +01:00
permissive-json-pointer Add indices field to _matchesPosition to specify where in an array a match comes from (#5005) 2024-11-20 01:00:43 +01:00
tracing-trace Upgrade compatible dependencies 2025-01-08 13:52:14 +01:00
xtask Put the Ollama tests under a feature 2025-02-06 17:27:47 +01:00