Skip to content

feat: add rerank_depth_start parameter to search() - #304

Open
vicilliar wants to merge 1 commit into
mainlinefrom
joshua/rerank-depth-start
Open

feat: add rerank_depth_start parameter to search()#304
vicilliar wants to merge 1 commit into
mainlinefrom
joshua/rerank-depth-start

Conversation

@vicilliar

@vicilliar vicilliar commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds rerank_depth_start: Optional[int] = None parameter to Index.search()
  • Serialises as rerankDepthStart in the Marqo API request body
  • Follows the same pattern as rerank_depth / rerankDepth
  • None value is omitted from the request body (existing behaviour preserved)

Server-side PR: marqo-ai/marqo#1393

Test plan

  • test_rerank_depth_start_serialized_as_camel_case — verifies correct key name in request body
  • test_rerank_depth_start_none_omitted_from_body — verifies None is not sent
  • test_rerank_depth_start_zero_included_in_body — verifies 0 (falsy but valid) is sent

🤖 Generated with Claude Code


Note

Low Risk
Low risk: adds an optional search parameter that is omitted when None, with unit tests covering serialization and the 0 edge case.

Overview
Adds a new optional rerank_depth_start parameter to Index.search() and serializes it to the API as rerankDepthStart, enabling reranking/score modifiers to apply only to a specified slice of the top rerank_depth results.

Includes unit tests that mock the HTTP layer to verify camelCase serialization, omission when None, and inclusion when set to 0 (falsy but valid).

Written by Cursor Bugbot for commit 07f2288. This will update automatically on new commits. Configure here.

Introduces `rerank_depth_start` as an optional parameter in `Index.search()`.
Maps to `rerankDepthStart` in the Marqo API request body.

When provided, hits before `rerank_depth_start` are preserved with their
original scores and ordering, while hits in [rerank_depth_start, rerank_depth)
are subject to global score modifier reranking. Omitting or setting to 0
preserves existing behaviour.

Changes:
- `index.py`: add `rerank_depth_start` param, serialise as `rerankDepthStart`
- `tests/v2_tests/test_score_modifier_search.py`: unit tests verifying correct
  serialisation and omission when None

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant