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) | Type | Required | Notes |
|---|---|---|---|---|
sdk | sdk | Nomad_SDK | yes | |
query | query | str | None | no | free-text across text fields |
filters | filters | list[dict] | None | no | e.g. [{"fieldName": "parentId", "operator": "Equals", "values": "<folder-uuid>"}] |
sort_fields | sortFields | list[dict] | None | no | e.g. [{"fieldName": "displayName", "sortType": "Ascending"}] |
size | size | int | None | no | e.g. 25 |
offset | offset | int | None | no | |
search_result_fields | searchResultFields | list[dict] | None | no | e.g. [{"name": "displayName"}] |
similar_asset_id | opts.similarAssetId | str | None | no | vector find-similar; overrides query+offset; needs vector search enabled |
min_score | opts.minScore | float | None | no | min relevance score for similar/LLM search; default ~0.65 |
use_llm_search | opts.useLlmSearch | bool | None | no | LLM/deep segment search instead of keyword |
search_text_fields | opts.searchTextFields | list[str] | None | no | scope free-text to specific indexed text fields (see enums.md) |
filter_binder | opts.filterBinder | int | None | no | 0=AND (default), 1=OR; also sets the default operator between free-text terms |
distinct_on_field_name | opts.distinctOnFieldName | str | None | no | collapse/dedup results on a field |
include_video_clips | opts.includeVideoClips | bool | None | no | return clip/segment-level rows for videos |
full_url_field_names | opts.fullUrlFieldNames | list[str] | None | no | compute signed full URLs for the listed fields (expensive) |
exclude_total_record_count | opts.excludeTotalRecordCount | bool | None | no | faster; omits totalItemCount |
include_internal_fields_in_results | opts.includeInternalFieldsInResults | bool | None | no | sent 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 whenlen(result["items"]) < sizeor you've coveredresult["totalItemCount"].
The result name/parent are nested:
result["items"][i]["identifiers"]["displayName"]and
["identifiers"]["parentId"]— not at the item top level. Seereference/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 ignoresqueryandoffsetand 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=Truewith aqueryruns 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"]restrictsqueryto specific
indexed text fields (e.g. transcripts/subtitles, EXIF, AI captions). Omit it to search all
text fields. Names are theSearchTextFieldsmembers inenums.md. - Operators beyond Equals: filters accept
Contains,Prefix,Like(wildcards*/?,
case-insensitive),NotEquals/NotContains/NotLike, and the rangesLessThan/
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.keywordto the
fieldName. Set"includeNull": trueon a filter to also match records missing the field.
Range andPrefixoperators are not supported against an array ofvalues(the API
returns 400). - AND/OR binding:
filter_binder=1ORs the filter clauses (default0ANDs 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=Truereturns clip/segment rows (and forces distinct onid);
full_url_field_names=["previewImageUrl"]computes signed URLs only for the listed fields
(expensive);exclude_total_record_count=TruedropstotalItemCountfor 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 carriestotalItemCountandhasItems.
Read nested fields directly:
result.items[i].identifiers.displayName/
.identifiers.parentId. The wrapper returns the object even with zero hits (items: []),
so guard only againstnull(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 ignoresquery/
offset; needs vector search enabled (else an empty result with a "Similar searching is not
enabled" message). - LLM / deep search:
{ useLlmSearch: true }with aqueryruns semantic search (clip-level
hits for video); paging is disabled in this mode. - Scope free-text:
{ searchTextFields: ["Transcripts"] }restrictsqueryto specific
indexed text fields (names are theSearchTextFieldsmembers inenums.md). - Operators beyond Equals / AND-OR / dedup / clips / URLs / speed: identical to the Python
component —Contains/Prefix/Like, ranges,.keywordexact match,includeNull,
filterBinder: 1for OR,distinctOnFieldName,includeVideoClips,fullUrlFieldNames,
excludeTotalRecordCount.
See also: Python ↔ JS naming map · Return shapes.
