feat(index): add compact() method for index compaction#2133
Conversation
Closes meilisearch#2066 Implements the `POST /indexes/{indexUid}/compact` endpoint introduced in Meilisearch v1.23. Compaction reorganizes the index database to reclaim space and improve read performance. Example: ```ts await client.index('movies').compact().waitTask(); ```
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds ChangesIndex compaction support
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Index
participant HTTP
participant MeiliSearch
Client->>Index: client.index('movies').compact()
Index->>HTTP: POST /indexes/movies/compact
HTTP->>MeiliSearch: authenticated request
MeiliSearch-->>HTTP: enqueued task response
HTTP-->>Index: EnqueuedTaskPromise
Index-->>Client: return promise
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
Closing due to inactivity. Over 3 months with no review. Happy to reopen if the team is interested. |
|
Apologies for the delay; this slipped through the cracks! |
Strift
left a comment
There was a problem hiding this comment.
Thanks for your PR, but the CI is not passing. I suggest running linter + formatter + tests locally before requesting another review 🙏
Summary
Adds support for the index compaction API introduced in Meilisearch v1.23 (reference).
Changes
compact()method to theIndexclass — callsPOST /indexes/{indexUid}/compacttests/compact.test.tswith permission, auth denial, and URL construction test casescompact_index_1code sample to.code-samples.meilisearch.yamlUsage
Closes
Closes #2066
Summary by CodeRabbit