Search Configuration
An index is configured by three things, all of which can be set when it is created and changed afterwards:
| Setting | Purpose |
|---|---|
features | What is searchable: which models run over the content, or which existing tag tracks are indexed. |
aggregation | How tags are grouped into the documents that get searched. |
search_config | The default behavior when searching the index. |
Set on creation with Create an index:
POST /vector_search/indexes/<index_qid> HTTP/1.1
Host: ai-04.contentfabric.io
Authorization: Bearer <token>
Content-Type: application/json
{
"qids": ["<qid1>", "<qid2>"],
"features": ["scene_description", "celeb"],
"aggregation": "shot",
"search_config": {
"rerank_level": "document",
"clips_min_duration_seconds": 15,
"clips_max_duration_seconds": 45
}
}
Features
A feature is one searchable field. In the common case it is just the name of a tagger model: adding it starts that model on every content in the index and indexes the tags it produces. Alternatively you may pass a json object for advanced configuration.
"features": [
"scene_description",
{"name": "celeb", "params": {"model_params": {"thres": 0.7}}},
{"name": "captions", "tracks": ["subtitles_en", "subtitles_es"]}
]
| Field | Type | Description |
|---|---|---|
name | string | The field name, which is a tagger model name unless tracks is given. See List available models. |
params | object | Tagger overrides for this model, accepting whatever the tagger's per-job overrides section accepts. Mutually exclusive with tracks. |
tracks | string[] | Existing tagstore tracks to index under name, instead of running a model. Nothing is tagged for you, so you are responsible for these tracks existing. |
Multiple tracks under one name are grouped into a single search field.
Changing features
- Add:
POST /indexes/{index_id}/features - Remove:
DELETE /indexes/{index_id}/features/{feature}— the index stops searching over it and the model stops running on contents added later. Tags already written are left alone. - List:
GET /indexes/{index_id}/features— every field the index searches over, with its sources and tagger overrides.
Changing contents
The set of contents is managed the same way, with POST /indexes/{index_id}/contents and DELETE /indexes/{index_id}/contents/{qid}. Contents added to an index are tagged with its features automatically.
Aggregation
Aggregation defines the video time-range segments over which we search. It defaults to "shot", which runs shot detection on the content and groups tags by shot boundary — for most content there is nothing to configure here.
When a segmentation model is used, the indexer creates aggregated documents for each of its segments: all configured tags overlapping that segment are grouped into a single textual document, along with the content's fabric-level field data.
What's the point?
Aggregating gives us rich contextual information for a scene that can be used to answer complex queries which might span across different fields. For example a query like: "Jennifer Lawrence talks with a mechanic in No Hard Feelings" could match 3 separate fields for cast/celebrity, visual scene description, and film title.
Fixed time buckets
Instead of a segmentation model, aggregation may be set to a fixed interval in whole seconds like "10s" or "15s". Tags are then grouped into contiguous, fixed-width windows of that duration. This is useful when shot boundaries are not a meaningful unit for your content.
"aggregation": "10s"
Search Defaults
search_config overrides the defaults for the clip search arguments, so callers don't have to specify them on every request. Update it with PATCH /indexes/{index_id}/search_config, which merges in only the options you supply.
PATCH /vector_search/indexes/<index_qid>/search_config HTTP/1.1
Host: ai-04.contentfabric.io
Authorization: Bearer <token>
Content-Type: application/json
{
"rerank_level": "document",
"rerank_user_query": true
}
| Option | Type | Default | Description |
|---|---|---|---|
clips_min_duration_seconds | number | — | Minimum clip duration in seconds. |
clips_max_duration_seconds | number | — | Maximum clip duration in seconds. |
rerank_level | string | "tag" | How much context to give the reranker: "chunk", "tag", or "document", in increasing order. |
rerank_user_query | bool | false | Embed the user's original query for the semantic search instead of the decomposed semantic component. |
disable_reranking | bool | false | Skip reranking entirely and leave results in order of vector similarity. |
rewriter_prompt | string | — | Instructions for an LLM that rewrites the query before the rest of the pipeline runs. Empty skips the rewrite step. |
For detailed explanations of these arguments, consult the clip search API docs.