search

Search assets/content with optional free-text, filters, and sorting.

search

Search assets/content with optional free-text, filters, and sorting.

Search the platform. Pass only what you need; None params are dropped from the request.
The endpoint is POST /api/{admin|portal}/search (chosen by apiType).

Safety class: A · API type: any · Min version:

📘

Confinement

Read-only. To scope to a folder, filter on parentId Equals .

Signatures

def search(sdk, query=None, filters=None, sort_fields=None, size=None, offset=None,
           search_result_fields=None, *, similar_asset_id=None, min_score=None,
           use_llm_search=None, search_text_fields=None, filter_binder=None,
           distinct_on_field_name=None, include_video_clips=None,
           full_url_field_names=None, exclude_total_record_count=None,
           include_internal_fields_in_results=None):
    """Run a search; return the result dict (or None). Scope to a folder via a
    parentId Equals filter. The keyword-only args expose the advanced modes
    (find-similar, LLM, text-field scoping, OR-binding, distinct, clips)."""
    return sdk.search(
        query, offset, size, filters, sort_fields, search_result_fields,
        similar_asset_id, min_score, exclude_total_record_count, filter_binder,
        full_url_field_names, distinct_on_field_name, include_video_clips,
        use_llm_search, include_internal_fields_in_results, search_text_fields)
export async function search(sdk, query = null, filters = null, sortFields = null,
                             size = null, offset = null, searchResultFields = null, opts = {}) {
    const { similarAssetId = null, minScore = null, useLlmSearch = null,
            searchTextFields = null, filterBinder = null, distinctOnFieldName = null,
            includeVideoClips = null, fullUrlFieldNames = null,
            excludeTotalRecordCount = null, includeInternalFieldsInResults = null } = opts;
    // Returns the result object (items: [] when empty) or null on failure.
    return await sdk.search(query, offset, size, filters, sortFields, searchResultFields,
        similarAssetId, minScore, excludeTotalRecordCount, filterBinder, fullUrlFieldNames,
        distinctOnFieldName, includeVideoClips, useLlmSearch, includeInternalFieldsInResults,
        searchTextFields);
}

Parameters

Parameter (Python)Parameter (JS)TypeRequiredNotes
sdksdkNomad_SDKyes
queryquerystr | Nonenofree-text across text fields
filtersfilterslist[dict] | Nonenoe.g. [{"fieldName": "parentId", "operator": "Equals", "values": "<folder-uuid>"}]
sort_fieldssortFieldslist[dict] | Nonenoe.g. [{"fieldName": "displayName", "sortType": "Ascending"}]
sizesizeint | Nonenoe.g. 25
offsetoffsetint | Noneno
search_result_fieldssearchResultFieldslist[dict] | Nonenoe.g. [{"name": "displayName"}]
similar_asset_idopts.similarAssetIdstr | Nonenovector find-similar; overrides query+offset; needs vector search enabled
min_scoreopts.minScorefloat | Nonenomin relevance score for similar/LLM search; default ~0.65
use_llm_searchopts.useLlmSearchbool | NonenoLLM/deep segment search instead of keyword
search_text_fieldsopts.searchTextFieldslist[str] | Nonenoscope free-text to specific indexed text fields (see enums.md)
filter_binderopts.filterBinderint | Noneno0=AND (default), 1=OR; also sets the default operator between free-text terms
distinct_on_field_nameopts.distinctOnFieldNamestr | Nonenocollapse/dedup results on a field
include_video_clipsopts.includeVideoClipsbool | Nonenoreturn clip/segment-level rows for videos
full_url_field_namesopts.fullUrlFieldNameslist[str] | Nonenocompute signed full URLs for the listed fields (expensive)
exclude_total_record_countopts.excludeTotalRecordCountbool | Nonenofaster; omits totalItemCount
include_internal_fields_in_resultsopts.includeInternalFieldsInResultsbool | Nonenosent as a query param; includes internal system fields

Returns

dict | None — {items: [...], totalItemCount, hasItems}. Names/parentId live under item['identifiers']. See return-shapes.md + enums.md.

Errors

  • 401 unauthenticated
  • 400 malformed search body (e.g. a range/Prefix operator against an array of values)

Notes

Real-world usage

Search is by far the most-used call. Common patterns:

  • Scope to a folder's direct contents: filters=[{"fieldName": "parentId", "operator": "Equals", "values": "<folder-id>"}].
  • Only top-level folders of one content type: combine
    {"fieldName": "contentDefinitionId", "operator": "Equals", "values": "<cd-id>"},
    {"fieldName": "assetType", "operator": "Equals", "values": 1},
    {"fieldName": "topLevelFolder", "operator": "Equals", "values": "true"} (AND-combined).
  • Fetch one record by id: filters=[{"fieldName": "uuidSearchField", "operator": "Equals", "values": "<asset-id>"}] — the id-lookup pattern the portal uses.
  • Select returned fields (dotted): search_result_fields=[{"name": "identifiers.displayName"}, {"name": "identifiers.assetType"}].
  • Page: size=<pageSize>, offset=<zero-based>; stop when len(result["items"]) < size or you've covered result["totalItemCount"].

The result name/parent are nested: result["items"][i]["identifiers"]["displayName"] and
["identifiers"]["parentId"] — not at the item top level. See reference/return-shapes.md.

Advanced modes

The worked recipes live in
recipes/search-patterns.md; the field/operator tables in reference/enums.md.

  • Find-similar (vector): similar_asset_id="<id>" returns the items most similar to
    that asset, ranked by relevance. It ignores query and offset and only works when
    the deployment has vector search enabled — otherwise the result carries a "Similar
    searching is not enabled for this asset" message and no items. Tune the cut-off with
    min_score (default ~0.65).
  • LLM / deep search: use_llm_search=True with a query runs semantic search; for video
    deployments it searches segments and returns clip-level hits. Results are ranked by score
    and paging is disabled for this mode.
  • Scope free-text: search_text_fields=["Transcripts"] restricts query to specific
    indexed text fields (e.g. transcripts/subtitles, EXIF, AI captions). Omit it to search all
    text fields. Names are the SearchTextFields members in enums.md.
  • Operators beyond Equals: filters accept Contains, Prefix, Like (wildcards */?,
    case-insensitive), NotEquals/NotContains/NotLike, and the ranges LessThan/
    GreaterThan/LessThanEquals/GreaterThanEquals (work on dates/numbers; dates in UTC
    YYYY-MM-DDTHH:MM:SS.SSSZ). For a strict exact match on a string, append .keyword to the
    fieldName. Set "includeNull": true on a filter to also match records missing the field.
    Range and Prefix operators are not supported against an array of values (the API
    returns 400).
  • AND/OR binding: filter_binder=1 ORs the filter clauses (default 0 ANDs them); it also
    flips the default operator between free-text query terms to OR.
  • Dedup / clips / URLs / speed: distinct_on_field_name="masterId" collapses duplicates;
    include_video_clips=True returns clip/segment rows (and forces distinct on id);
    full_url_field_names=["previewImageUrl"] computes signed URLs only for the listed fields
    (expensive); exclude_total_record_count=True drops totalItemCount for a faster query.

Real-world usage

Same patterns as the Python component (filters are identical JSON):

  • Folder contents: filters: [{ fieldName: "parentId", operator: "Equals", values: "<folder-id>" }].
  • Top-level folders of one type: AND contentDefinitionId Equals <cd-id>, assetType Equals 1, topLevelFolder Equals "true".
  • By id: filters: [{ fieldName: "uuidSearchField", operator: "Equals", values: "<asset-id>" }].
  • Returned fields (dotted): searchResultFields: [{ name: "identifiers.displayName" }].
  • Paging: pass size/offset; the result carries totalItemCount and hasItems.

Read nested fields directly: result.items[i].identifiers.displayName /
.identifiers.parentId. The wrapper returns the object even with zero hits (items: []),
so guard only against null (request failure).

Advanced modes

Pass advanced options via the trailing opts object; semantics match the Python component.
Worked recipes live in recipes/search-patterns.md; field/operator tables in
reference/enums.md.

  • Find-similar (vector): search(sdk, null, null, null, null, null, null, { similarAssetId: "<id>", minScore: 0.7 }) returns items most similar to that asset and ignores query/
    offset
    ; needs vector search enabled (else an empty result with a "Similar searching is not
    enabled" message).
  • LLM / deep search: { useLlmSearch: true } with a query runs semantic search (clip-level
    hits for video); paging is disabled in this mode.
  • Scope free-text: { searchTextFields: ["Transcripts"] } restricts query to specific
    indexed text fields (names are the SearchTextFields members in enums.md).
  • Operators beyond Equals / AND-OR / dedup / clips / URLs / speed: identical to the Python
    component — Contains/Prefix/Like, ranges, .keyword exact match, includeNull,
    filterBinder: 1 for OR, distinctOnFieldName, includeVideoClips, fullUrlFieldNames,
    excludeTotalRecordCount.

See also: Python ↔ JS naming map · Return shapes.