meilisearch / meilisearch/meilisearch-java
[Meilisearch v1.48.0] Add document relations (experimental)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 245
- Forks
- 152
- PR merge metrics
- No merged PRs in 30d
Description
## Context
Meilisearch introduced [document relations](https://www.meilisearch.com/docs/capabilities/indexing/joins/define_index_relationships) 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](https://www.meilisearch.com/docs/capabilities/indexing/how_to/document_relations) for more information.
## Tasks
- [ ] Add methods to interact with [Get foreignKeys](https://www.meilisearch.com/docs/reference/api/settings/get-foreignkeys), [Update foreignKeys](https://www.meilisearch.com/docs/reference/api/settings/update-foreignkeys), and [Reset foreignKeys](https://www.meilisearch.com/docs/reference/api/settings/reset-foreignkeys) API endpoints
- [ ] Update the global settings methods to accept and handle the `foreignKeys` setting
- [ ] Add test cases for all new methods
- [ ] Add code samples in `.code-samples.meilisearch.yaml` matching the Meilisearch documentation CURL examples:
- [ ] Under `get_foreign_keys_setting_1`: equivalent of [this code sample](https://github.com/meilisearch/documentation/blob/ea674f4b86c52675c7996d817ec1b339c164dcff/.code-samples.meilisearch.yaml#L1607-L1609)
- [ ] Under `update_foreign_keys_setting_1`: equivalent of [this code sample](https://github.com/meilisearch/documentation/blob/ea674f4b86c52675c7996d817ec1b339c164dcff/.code-samples.meilisearch.yaml#L1611-L1624)
- [ ] Under `reset_foreign_keys_setting_1`: equivalent of [this code sample](https://github.com/meilisearch/documentation/blob/ea674f4b86c52675c7996d817ec1b339c164dcff/.code-samples.meilisearch.yaml#L1626-L1628)
## Resources
Release notes:
- [Meilisearch v1.39](https://github.com/meilisearch/meilisearch/releases/tag/v1.39.0) introduced **cross-index document hydration** via a new `foreignKeys` index setting. This allows linking documents across indexes so that search results are automatically enriched with related data.
- [Meilisearch v1.42](https://github.com/meilisearch/meilisearch/releases/tag/v1.42.0) 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 in `filterableAttributes`.
- [Meilisearch v1.48](https://github.com/meilisearch/meilisearch/releases/tag/v1.48.0) 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 by locating the existing settings methods and their tests in the Java client, then compare their patterns with the Meilisearch foreignKeys API documentation linked in the issue. Add the three foreignKeys operations, include the setting in global settings handling, and add coverage for each method. Update .code-samples.meilisearch.yaml with the three documented examples and verify the test suite passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100