action clarify_v1search { label: "Search bundles" description: "Searches the bundles and returns a list of matching bundles, along with what matched and where for each bundle.

query is used to search for text in the audio and metadata. It uses a simple query language similar to Google. At its simplest, it can be a space separated list of words (ex. open voice) which will find all bundles matching all the words. To search for a phrase, put it in quotes (ex. \"open source\") You can exclude bundles that contain a word by putting a minus (hyphen) in front of the word (ex. -opaque) To search for one word or another, use OR (in uppercase) between the words (ex. pizza OR pasta). As an alternative to OR, you can use | (pipe character). A full query could look something like: restaurant \"little italy\" pizza OR pasta -mushrooms

query_fields is used to specify what data in a bundle the query will search. It can contain one or more of insights.spoken_words, metadata fields, and/or bundle fields. Multiple values can be either an array of strings or a comma or space separated single string. By default (if the query_fields param is not included in a request or is a single empty string) all data will be searched.

query_fieldsBundle data searched
*all dataThis is the default value.
insights.spoken_words[spoken words]All audio tracks are searched.
fieldnamemetadata.fieldnameYour custom metadata field. Wildcard metadata.* searches all metadata fields.
bundle.fieldnamebundle.fieldnameThe searchable bundle fieldnames are name, id, external_id, created and updated. Wildcard bundle.* searches all bundle fields

As an example, suppose you have metadata fields name and description that you would like to search and other metadata fields you don't want to search. You also want to search the audio words, so you could specify query_fields = "insights.spoken_words, name, description".

filter is used to limit the search results according to specific criteria based on metadata and bundle values. It uses an expression syntax similar to Javascript boolean expressions. An expression is made up of zero or more terms joined by logical operators with each term having a field, a comparison operator, and a literal value. Parentheses can be used to logically group terms.

A filter term is of the form: field-name comparison-operator literal-value where:

field-name is a metadata field or bundle.name, bundle.id, bundle.external_id, bundle.created, or bundle.updated.

comparison-operator is ==, <, >, <=, >=, or !=

literal-value is a number (integer or decimal), boolean true or false, or a string with either double quotes (\") or single quotes (').

Logical operators between terms (and groups of terms) can be && (logical AND), || (logical OR). A logical NOT is ! and can be placed before a term (or group of terms.)


An example filter expression (assuming you have used metadata fields category and tag):


category==\"music\" && (tag == \"soft\" || tag == \"smooth\") && tag != \"jazz\" && bundle.created > \"2014-03-15T00:00:00.0Z\"


language parameter specifies the language of the words in the search query. This value is used for word-stemming etc. while searching text. Regardless of what you set for this parameter, all your bundles will be searched, no matter what language content they contain. Supported languages: en, en-UK, en-US, es, fr.

After getting the initial list, use the first, next, prev link relations to get more bundles in the list. Note that next will not be available at the end of the list and prev will not be available at the start of the list. A maximum of limit items will be returned. If the results are exactly one page neither prev nor next will be available.

The embed parameter specifies link relations to embed in the results. For link relations that are curies (ex. \"clarify:metadata\"), you may simply use the base name (ex. \"metadata\").

" provider: clarify method: GET path: "/v1/search" encoding: json input: { type: "object" properties: { embed: { type: "string" } filter: { type: "string" } iterator: { type: "string" } language: { type: "string" } limit: { type: "string" } query: { type: "string" } query_fields: { type: "string" } } additionalProperties: false } output: { type: "object" additionalProperties: true } }