feat: add personalized search (experimental)#971
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughIntroduces a new ChangesPersonalized Search Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds support for the
personalizesearch parameter introduced in Meilisearch 1.47.0. Closes #970.Personalizemodel (model/Personalize.java) with auserContextfield, mirroring the existingHybridmodel (lombok builder +toJSONObject()).SearchRequestandIndexSearchRequestnow accept an optionalpersonalizeobject and serialize it into the request body.IndexSearchRequestcovers federated / multi-search, which 1.47.0 also supports per the issue note.SearchRequestTestandIndexSearchRequestTestcovering the serialization and getters.Usage:
Note: the SDK performs search over POST (
Search/Index.search), so there is no separate GET search path in the client to update —personalizeis added to the POST request body.Overview
This PR adds support for the
personalizesearch parameter introduced in Meilisearch 1.47.0, enabling users to provide personalization context in search requests. The implementation includes a newPersonalizemodel class and updates to search request classes with corresponding unit tests.Changes
New Model
Personalizeclass with auserContextfield, configured with Lombok annotations for builders, getters, and setterstoJSONObject()method for serialization andtoString()override for JSON string representationUpdated Search Classes
SearchRequest: Added optionalpersonalizefield with JSON serialization supportIndexSearchRequest: Added optionalpersonalizefield with JSON serialization supportTesting
SearchRequestTest(toStringWithPersonalizeUsingBuilder) verifyingpersonalizeserialization and getter functionalityIndexSearchRequestTestverifyingpersonalizeserialization withuserContextfieldUsage
Users can now use personalization in search requests via the builder pattern:
The implementation supports both standard search and federated/multi-search operations with personalization context.