Skip to content

Search Replay

Show:

Search Replay re-runs a previous search using the search_id returned by an earlier captured search call. You can override individual search parameters for evaluation, regression testing, or A/B comparisons of ranking changes.

Note: Replay is available for searches that produce a search session, such as bucket searches. The endpoint does not yet replay federated memory searches as a single logical query.

Re-runs a past search by search_id.

FieldTypeRequiredDefaultDescription
search_idstringyesID returned by a captured search call. Maximum 128 characters.
overrideobjectnonullOptional parameter overrides applied to the rerun. See Override fields.
include_originalbooleannofalseReturn the captured first-run results in the response.
FieldTypeDescription
top_kinteger (1–1000)Number of results to return.
filterobjectSearch filter object.
min_scorenumber (0.0–1.0)Minimum result score.
modestringSearch mode override.
rerankbooleanWhether to apply reranking.
expand_neighborsobjectNeighbor expansion parameters.
Terminal window
curl -X POST https://api.schift.io/v1/search/replay \
-H "Authorization: Bearer $SCHIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"search_id": "search_abc123",
"override": {
"min_score": 0.7,
"rerank": true
},
"include_original": true
}'
{
"original": {
"search_id": "search_abc123",
"query": "soccer rules offside",
"bucket_id": "bkt_xyz",
"created_at": "2026-04-30T12:34:56Z",
"result_count": 8,
"results": [
{
"id": "chunk-x",
"score": 0.91,
"text": "",
"metadata": { "rank": 1 }
}
]
},
"rerun": {
"search_id": "search_def456",
"results": [
{
"id": "chunk-x",
"score": 0.89,
"text": "A player is in an offside position if...",
"metadata": {}
}
],
"diff": {
"added": ["chunk-z"],
"removed": ["chunk-y"],
"shared": 5,
"rank_correlation": 0.83
}
}
}

Note: When include_original is true, the original result items contain id, score, and rank metadata only. The original chunk text is not stored in the search event ledger, so the text field is empty.

FieldTypeDescription
originalobjectSummary of the captured first run.
original.search_idstringOriginal search_id.
original.querystringQuery text from the original run.
original.bucket_idstringBucket searched in the original run.
original.created_atstring | nullISO 8601 timestamp of the original session.
original.result_countintegerNumber of results captured in the original run.
original.resultsarray | nullOriginal result items when include_original is true.
rerunobjectSummary of the new run.
rerun.search_idstringNew search_id for the rerun.
rerun.resultsarrayResult items from the rerun.
rerun.diffobjectDiff metrics comparing the two result sets.
FieldTypeDescription
addedarray of stringsIDs present in the rerun but not in the original.
removedarray of stringsIDs present in the original but not in the rerun.
sharedintegerNumber of IDs present in both result sets.
rank_correlationnumber | nullSpearman rank correlation over shared IDs. 1.0 means identical order; -1.0 means reversed. null when fewer than 2 shared IDs.

404 Not Found — the search_id does not exist for the organization.

{
"detail": "search_id not found for this org"
}

422 Unprocessable Entity — the captured session is missing required query or bucket information.

{
"detail": "Original search lacks query/bucket — replay not possible"
}

Only v1 is available for Search Replay. There is no deprecated version.

  • The original full request payload — including filter, top_k, and other parameters — is not yet persisted. An unmodified replay therefore runs with default search parameters, not bit-for-bit identical settings.
  • Future releases will persist the full BucketSearchRequest at session creation so unmodified replays are reproducible.