meilisearch / meilisearch/meilisearch-ruby
[Meilisearch v1.48.0] Add document relations (experimental)
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 224
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
Context
Meilisearch introduced document relations as an experimental feature.
Objective
Add support for the document relations settings as an experimental feature. Experimental features should require opt-in by the user. Read the how to guide for more information.
Tasks
- Add methods to interact with Get foreignKeys, Update foreignKeys, and Reset foreignKeys API endpoints
- Update the global settings methods to accept and handle the
foreignKeyssetting - Add test cases for all new methods
- Add code samples in
.code-samples.meilisearch.yamlmatching the Meilisearch documentation CURL examples:- Under
get_foreign_keys_setting_1: equivalent of this code sample - Under
update_foreign_keys_setting_1: equivalent of this code sample - Under
reset_foreign_keys_setting_1: equivalent of this code sample
- Under
Resources
Release notes:
- Meilisearch v1.39 introduced cross-index document hydration via a new
foreignKeysindex setting. This allows linking documents across indexes so that search results are automatically enriched with related data. - Meilisearch v1.42 extended it with document join filtering — the ability to filter search results using the
_foreign()filter syntax on related indexes. This requires the foreign key field to also be configured infilterableAttributes. - Meilisearch v1.48 refined it by restricting foreign filters to retrieval routes only.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing settings methods and their tests, then compare the foreignKeys API endpoints and the linked Meilisearch documentation. Add the three foreignKeys operations, support the setting in global settings, and cover each method with tests. Update .code-samples.meilisearch.yaml under get_foreign_keys_setting_1, update_foreign_keys_setting_1, and reset_foreign_keys_setting_1 to match the documented CURL examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100