Skip to main content
Moment Group stage merging frame-level intervals into consolidated video moments
The Moment Group stage takes frame-level or chunk-level documents with temporal metadata and merges contiguous intervals into consolidated video moments (time ranges), grouped by parent object. Instead of returning individual frames that matched a query, you get precise start/end time ranges pinpointing where in a video the match occurs.
Stage Category: REDUCE (Merges intervals into moments)Transformation: N frame/chunk documents → M consolidated moments per parent video

When to Use

When NOT to Use

Requirements

  • Input documents must have temporal intervals — either query_chunks with start_ms/end_ms (attached by feature_search preprocessing) or document-level time fields.
  • The parent_field must exist on the documents so results can be grouped by source video/object.
Text query vs file query — pick the right time_field. The default time_field: "query_chunks" is only populated when you search with a file input (via query preprocessing). For a plain text query, the matched video segments carry top-level start_time/end_time — set time_field: "start_time" (the stage derives the end field by swapping startend). Leaving query_chunks with a text query yields empty moments — the most common silent failure here. See the Video Moment Localization recipe.

Parameters

Configuration Examples

Output Schema

Annotated Mode (default)

In annotated mode, the best-scoring document per parent is preserved with a moments array attached:

Moments-Only Mode

In moments_only mode, standalone moment documents are emitted:

Moment Object Fields

Performance

Common Pipeline Patterns

Video Search with Moment Localization

The canonical use case: search across video frames, then consolidate matches into seekable moments.

Moment Extraction with Reranking

Search, rerank for precision, then group into moments:

Error Handling

  • Temporal - Time-window aggregations with drift detection
  • Group By - Group documents by any field value
  • Aggregate - Statistical aggregations
  • Deduplicate - Remove duplicate documents