Conversation
Add search_after parameter to SearchRequest for cursor-based pagination that scales to large offsets. Previously, deep pagination with from/size was O(n). Now search_after uses sort values as a cursor for O(1) pagination. - Add search_after: Option<Vec<Value>> to SearchRequest - Add sort_values: Option<Vec<Value>> to SearchHit (returned on every hit) - When search_after is present, skip to the first doc whose sort values are greater than the cursor - sort_values includes [sort_field, score, doc_id] for tie-breaking - search_after and from are mutually exclusive
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ 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 |
Validation now rejects search_after without sort — cursor is meaningless without a defined sort order. Also adds test for this case.
Summary
search_after: Option<Vec<Value>>toSearchRequestfor cursor-based paginationsort_values: Option<Vec<Value>>toSearchHit(returned on every hit)search_afteris provided, skip to the first doc whose sort values are greater than the cursor (O(1) instead of O(n))sort_valuesincludes[sort_field_value, score, doc_id]for stable tie-breakingsearch_afterandfromare mutually exclusive (validated at request time)search_afterrequiressortfield to be specified (validated at request time)Test plan
cargo test --workspace— all tests passcargo clippy --workspace --all-targets— cleanAPI usage example