MeiliSearch/crates/meilisearch-types/src
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
..
deserr New error codes 2025-02-05 15:03:16 +01:00
batch_view.rs add the batches 2025-01-07 16:26:06 +01:00
batches.rs Rename callTrace into progressTrace 2025-02-25 10:09:03 +01:00
compression.rs Move crates under a sub folder to clean up the code 2024-10-21 08:18:43 +02:00
document_formats.rs Use a nonrandom hasher when decoding JSON 2024-12-11 12:04:29 +01:00
error.rs Merge branch 'main' into granular-filterable-attributes 2025-03-11 10:05:58 +01:00
facet_values_sort.rs Implements the get and delete tasks route 2025-01-07 16:26:04 +01:00
features.rs Make composite embedders experimental 2025-03-10 14:22:47 +01:00
index_uid.rs Make search types serialize and deserialize so that reading from a proxy is possible 2025-02-05 15:03:16 +01:00
index_uid_pattern.rs Move crates under a sub folder to clean up the code 2024-10-21 08:18:43 +02:00
keys.rs Add new permissions 2025-02-05 15:03:16 +01:00
lib.rs Implements the get all batches route with filters working 2024-11-20 10:42:55 +01:00
locales.rs Change the filterableAttributes setting API 2025-03-03 10:22:02 +01:00
settings.rs Change the filterableAttributes setting API 2025-03-03 10:22:02 +01:00
star_or.rs add the searches route and fix a few broken things 2025-01-07 16:26:06 +01:00
task_view.rs add the upgradeTo field in the details 2025-01-23 16:51:23 +01:00
tasks.rs add the upgradeTo field in the details 2025-01-23 16:51:23 +01:00
versioning.rs update the version file atomically 2025-02-06 18:23:28 +01:00