Query options

Learn how to construct queries and explore the search criteria you can use in the query parameter

The Search API is a powerful and flexible tool that allows you to combine a wide variety of search criteria with operators. This page explains how to construct query criteria so you can search for exactly what you need. This page also lists the standard search criteria available in Orange Logic.

Custom fields that are searchable can also be included as search criteria. Use the List Criteria endpoint to get a list of criteria specific to your environment.

Query construction

You can use criteria and search terms in the query parameter to describe the attributes of the assets you need. Criteria are the metadata fields, Tags, and other information about assets hosted in Orange Logic. Search terms are an asset’s specific information related to each criterion, such as words, phrases, categories, or the tags applied to that asset. Queries are included in the Search API in the format criterion:search_term. For example, let’s say you want to find all assets with “London” in the title. The criterion is Title, the search term is London, and your query parameter is Title:London.

You can use operators to specify two search terms for one criterion with the syntax criterion1:search_term1 [Operator] search_term2. Alternatively, you can use the syntax criterion1:search_term1 [Operator] criterion1:search_term2 to get the same result. For example, suppose you want to find all assets with "London" and "Bridge" in the title. The criterion is title and the search terms are London and Bridge. You could write the query parameter as either Title:London AND Bridge or Title:London AND Title:Bridge.

To combine multiple criteria in one Search API call, use operators to add criteria to the query in the format criterion1:search_term1 [Operator] criterion2:search_term2. For example, if you want to find only images with "London" in the title, the criteria are DocType and Title. Your query parameter is DocType:Image AND Title:London.

ℹ️

Note

  • You cannot use the query parameter multiple times in the same request. To combine multiple criteria, separate them with operators.
  • Correct syntax: [https://www.mangovations.com/API/search/v3.0/search?query=keyword:LondonANDDocType:Image&fields=SystemIdentifier&format=JSON]
  • Incorrect syntax:
    [https://www.mangovations.com/API/search/v3.0/search?query=keyword:Londonquery=DocType:Image&fields=SystemIdentifier&format=JSON]

The following sections provide more details and many examples that demonstrate how to combine query criteria and search terms.

Query operators

You can combine values within the same criterion, or across different criteria, with the operators listed in the following table.

Query OperatorDescriptionExample
ANDTo specify multiple criteria that must be true to satisfy a search, separate search criteria with AND.

You can use a space instead of AND because AND is the default operator.
Keyword:vacation AND beach

Keyword:vacation beach

These queries are equivalent and return all assets that are tagged with both vacation and beach.
ORTo specify multiple criteria that satisfy a search, separate search criteria with OR.keyword:vacation OR beach returns assets tagged with either vacation or beach.
NOTTo exclude a criterion, separate search criteria with NOT.

To exclude additional criteria, use NOT with AND or OR:
AND NOT
OR NOT
Keyword:beach NOT vacation returns assets tagged with beach that are not tagged with vacation.

Keyword:beach NOT vacation AND NOT sunset returns assets tagged with beach that are not tagged with either vacation or sunset.

Keyword:beach NOT vacation OR NOT sunset returns assets tagged with beach that are not tagged with vacation or are not tagged with sunset

Order of operations

Operators in our search have different priorities. If you don’t specify how the system should complete a query, operators are prioritized in this order: NOT > AND > OR. This order of operations applies to each search term, regardless of the criterion they’re applied to. For example, the query keyword:sun AND day OR daylight AND title:vacation returns assets that are tagged with both sun and day and assets with both the daylight tag and vacation in the title. This is because Orange Logic uses the default order of operations, which prioritizes the AND operator over the OR operator.

You can use sets of parentheses to override the default order and perform advanced searches on query criteria and search terms. For example, let’s say you want to search for assets that:

  • Have the sun tag.
  • Have either day or daylight as a tag.
  • Have vacation in the title.

One query you can use to get this result is: keyword:sun AND (day OR daylight) AND title:vacation. Here, the parentheses tell Orange Logic to consider the operation in the parentheses before the other operations.

To get the result you want, your search must include parentheses. For example, if you change the query order and write keyword:sun AND title:vacation AND keyword:day OR daylight, Orange Logic reads the query as keyword:(sun AND title:vacation AND keyword:day) OR daylight and returns assets that are tagged with sun and day and that have vacation in the title, as well as assets that are tagged with daylight.

Date and time operators

You can use operators with date and date-time criteria, such as MediaDate or CreateDate, to search both inclusive and exclusive date or date-time intervals. Some fields only support date criteria, and some support date-time criteria.

By default, for both date and date-time criteria, the date is specified in the format YYYY-MM-DD. Year (YYYY) is required, and month (MM) and day (DD) are optional. If the date is specified as YYYY-MM, Orange Logic returns results from the entire month. If the date is specified as YYYY, Orange Logic returns results from the entire year.

By default, date-time criteria is specified in the format YYYY-MM-DDTHH.MM.SS, where T is a placeholder that indicates time, HH is hours, MM is minutes, and SS is seconds.

ℹ️

Note

You can change the date-time format with the datetime parameter.

Date-time OperatorDescriptionExample
:Searches for the exact date specified.MediaDate:2024-12-31 returns assets dated December 31, 2024.

MediaDate:1955 returns assets dated from January 1 to December 31, 1955 (inclusive).
>Searches for dates after the specified date, excluding the specified date.MediaDate>2000-12-01 returns assets with a date after December 1, 2000 (excluding assets dated December 1, 2000).
>:Searches for dates on or after the specified dateMediaDate>:2000-12-01 returns assets with a date after December 1, 2000 (including assets dated December 1, 2000).
<Searches for dates prior to the specified date, excluding the date specified.MediaDate<1995 returns assets with a date prior to January 1, 1995 (excluding assets dated January 1, 1995).
<:Searches for dates on or prior to the specified date.MediaDate<:1995 returns assets with a date prior to January 1, 1995 (including assets dated January 1, 1995).
Search one or more date ranges

You can use query operators (AND, OR, NOT) to combine date operators so that you can search one or more date ranges.

For example, the query MediaDate>:2023-12-30 AND MediaDate<:2024-01-02 returns assets created from December 30, 2023 through January 2, 2024, which means it returns assets created on four dates: December 30, 2023; December 31, 2023; January 1, 2024; and January 2, 2024. In the following example call, the following special characters are percent-encoded:

  • The colon (:) is percent-encoded as %3A.
  • The greater-than sign (>) is percent-encoded as %3A.
  • The less-than sign (<) is percent-encoded as %3C.
curl -X 'GET' \
  'https://mangovations.com/API/Search/v4.0/Search?query=MediaDate%3E%3A2023-12-30%20AND%20MediaDate%3C%3A2024-01-02&sort=1&fields=path_TR1&fields=SystemIdentifier&pagenumber=1&format=JSON' \
  -H 'accept: application/json'

In contrast, the query MediaDate>2012-12-30 AND MediaDate<2013-01-02 returns assets created after December 30, 2023 and before January 2, 2024, which means it returns assets created on two dates: December 31, 2023 and January 1, 2024.

Query criteria

Orange Logic offers many standard search criteria, and your organization can also customize metadata fields to make them searchable.

Standard search criteria

The most commonly used criteria are listed in the following table:

CriteriaDescriptionExamples
DocTypeThe asset type. Can take the values: Image, Video, Audio, Multimedia (Other, such as PDF, MS documents, design files, etc.), Album (Virtual Folder), Story (Folder).DocType:Audio returns audio assets.

DocType:Story returns folder assets.

DocType:Video OR Image returns video or image assets.

DocType:Video OR DocType:Image returns video or image assets.
DocSubType The asset subtype. Can take the values present in your system. Use spaces to separate words in the subtype.DocSubType:Video segment returns video assets of the video segment subtype.
PathAn asset’s Path. If a path has special characters , you must use quotes around it.

If you need to search for all assets within an entire folder structure, use the ParentFolderIdentifier criterion.

Notes:

- You can use a wildcard (*) to return all assets in a given path. However, Orange Logic does not currently support using wildcards with Paths that include reserved characters or that include quoted strings.
- Additionally, calls that include wildcards are resource intensive. For the best performance, use the ParentFolderIdentifier criterion.
Path:Library/Designs/Diagrams returns the "Diagrams" folder.

Path:"Library/Designs/Diagrams & Graphics" returns the "Diagrams & Graphics" folder.

Path:Library/Designs/Icons/Mini-Icons.psd returns the "Mini-icons.psd" file

Path:Library/Designs/* returns all of the assets in the "California" folder.

Path:"Library/Designs/Diagrams & Graphics/*" does not return results because wildcard search is not supported for quoted strings.
PurposeAn asset’s Visibility Class. (Visibility Classes were called “purposes” in older versions of Orange Logic.)Purpose:Public returns assets with the "Public" Visibility Class.
TextFree-text search on any searchable fields that allow free-text searches, such as title, description, and keywords.

Exact-match search on any searchable fields that allow exact-match searches. Use quotation marks to search for exact text.

Search results only include fields that have the “Include in freetext search” or “Searchable with exact match” settings activated. Go to the Metadata fields article to learn more about search settings.
Text:red flower Monet returns assets with “red” and “flower” and “Monet” in the title, description, tags, and other free-text searchable fields.

Text:"red flower in a vase painted by Claude Monet" returns assets with the exact phrase in the title, description, and other exact-match searchable fields.
PhotographerThe name in the asset’s "Photographer" field. Use the format FirstName LastName.Photographer:Anna Morado returns assets with the Photographer Anna Morado.
ArtistThe name in the asset’s "Artist" field. Use the format FirstName LastName.Artist:Will Hudson returns assets by the Artist Will Hudson.
KeywordTags applied to an asset.

You can specify the Tag Type in parentheses after the tag. If no Tag Type is specified, Orange Logic returns assets with any Tag Type.
Keyword:beach AND vacation returns assets tagged with beach and vacation.

Keyword:orange returns all assets tagged with orange regardless of the Tag Type.

Keyword(Common):orange AND NOT Keyword(Color):orange returns assets tagged with the “orange” tag in the common Tag Type but not assets tagged with the “orange” tag in the color Tag Type.
NativeKeywordTags assigned directly to an asset, and not inherited by the tag tree.

We do not recommend using this criteria except for tagging images.
NativeKeyword:France returns assets that have the France tag because it was added directly to that asset.

For example, let’s say that Paris is a narrow term of France. Images tagged with Paris but not France would not appear in the NativeKeyword search for France.
RecordIDAn asset’s Media Encrypted Identifier, or RecordID.

This criterion is available beginning in Orange Logic London.
RecordID:2RBKT7U02C8J returns the asset with the Media Encrypted Identifier 2RBKT7U02C8J.

MediaEncryptedIdentifier:2RBKT7U02C8J returns the asset with the Media Encrypted Identifier 2RBKT7U02C8J.
SystemIdentifierAn asset’s unique, Orange Logic-generated System Identifier. In the user interface this is often called the Unique identifier.SystemIdentifier:OLSI8597 returns the asset with the system identifier OLSI8597.
MediaNumberAn asset’s Media Number. Media Number field labels vary by organization. For example, some organizations call them “Picture Number,” ”Package Number,” “Accession Number,” or “URN.” Contact your administrator to learn what your organization calls the Media Number field.MediaNumber:OLKAFA22-04 returns the asset with the Media Number OLKAFA22.
ColorAssets that are in color (true) or are in black and white (false).Color:True returns assets that have color; does not return black and white assets
OrientationAsset orientation. Can be Landscape, Portrait, or Square.Orientation:Landscape OR Square returns assets that have landscape or square orientations.
OriginalSubmissionNumberThe original submission number.OriginalSubmissionNumber:OLST25 returns the asset with the original submission number OLST25.
ParentFolderIdentifierA folder’s Unique Identifier.ParentFolderIdentifier:CTLSTO117374 returns all assets in a folder’s hierarchy.
MediaDateAn asset’s original creation date (not the date the Media was imported into the database).

Use date operators to narrow your search.
MediaDate>2023-12-30 AND MediaDate<2024-01-02 returns assets created on 2 dates: December 31, 2023 and January 1, 2024.
CreateDateThe date or date-time that an asset’s record was created in the Orange Logic database. Use date operators to narrow your search.CreateDate>:2023-12-30T06.00.00 CreateDate<:2023-13-30T12.00.00 returns assets added to Orange Logic between December 30, 2023 at 6am and December 30, 2023 at 12pm.
EditDateThe full precision global edit date, which is the date or date-time the record was last edited in the database.

Use date-time operators to narrow your search. Beginning in Orange Logic Irvine, you can also use milliseconds.
EditDate>:2023-12-30T06.00.00 EditDate<:2023-13-30T12.00.00 returns assets last edited in Orange Logic between December 30, 2023 at 6am and December 30, 2023 at 12pm.

EditDate:2023-12-30T06.00.00.067 returns assets edited 67 milliseconds after 6am on December 30, 2023.
Participant("Role")The users or Groups that are currently assigned to a specific Role on an asset.

The search term text can be the Name, Email, or Unique Identifier of the Contact, Title, or Group.

The role text can be either the Role’s label or the Role’s Unique Identifier.

This criterion is only available if your organization has Orange Workflows.
participant("Watcher"):("Anna Morado") returns assets on which Anna Morado is assigned as a watcher.

participant("Supervisor"):("[email protected]") returns assets on which the user with the email address [email protected] is assigned as the Supervisor .

participant("Assigned to"):("Marketing") returns assets on which the “Marketing” Group has the “Assigned to” role.

participant(VN9ND000000138028):("Marketing") returns assets on which the “Marketing” Group is assigned the Role with a Unique ID of VN9ND000000138028.
FileextensionAn asset’s file extension.Fileextension:jpg returns assets with the file extension jpg.
TitleA free-text search of an asset’s title.Title:Parliament returns assets whose titles contain the word parliament.

Search within a folder structure

When possible, you should increase your search efficiency by using precise criteria to narrow your search. For example, the criterion ParentFolderIdentifiertakes the unique identifier of a folder and narrows your search to the specified folder’s entire folder structure.

For example, let’s say you want to find all of the images of islands from your organization’s television show “Dream Vacation Destinations.” These images are located in many season subfolders within the Dream Vacation Destinations folder, which has a unique ID of CTLSTO117374. To find all of these images, you use the ParentFolderIdentifier criterion to specify that the search should encompass the entire folder structure within the “Dream Vacation Destinations” folder with the query ParentFolderIdentifier:CTLSTO117374 and title:islands AND keywords:islands.

⚠️

Caution

  • You can also use a wildcard (*) search to search for assets within the Path criterion. However, this method is less efficient than using ParentFolderIdentifier and is not recommended.
    • Wildcard searches cannot be used with quoted text. Paths that contain reserved strings (and, or, &, &&, |, ||) must be surrounded by quotes, so it is not currently possible to do a wildcard search with a quoted Path criterion.
  • Wildcard searches on criteria other than the Path criterion yield unexpected results, and are not recommended.

Custom searchable fields

You can add fields to the available search criteria or make fields available to search in the text criterion with the search-related checkboxes in the Create / Edit fields window.

Metadata fields as search criteria

Any metadata fields that are “searchable individually” in your organization’s DAM can be searched by entering with the field’s Namespace and title as a search criterion in the query parameter. For example, let’s say an administrator at Mangovations creates a searchable text field called Vendors in the Marketing Namespace. She selects the Searchable individually checkbox.

Searchable individually checkbox

Searchable individually checkbox

You can search this field’s information using marketing.Vendors as the criterion. New metadata fields must be indexed and may not appear immediately.

Some metadata fields have the Searchable Individually setting activated by default. For more information, go to the Searchable Individually article.

🎓

Insight: Namespace

A Namespace is a category that lets you group similar fields. For example, if you have many departments with their own Asset Subtypes and metadata fields, you might want to categorize fields based on departments. Additionally, default (“Core”) fields in Orange Logic have the CoreField Namespace. You can view a field’s namespace in its settings.

Field namespace

Images Namespace

For more information, go to the Namespaces article.

Parse multi-valued fields

Search API v4.0 parses custom, multi-valued fields to their original type instead of returning all values as one string.

For example, let’s say a “Content Usage” field contains three possible values:

  • Social media, videos, webinars
  • Live streams
  • Print

Search API v4.0 splits this field into its three possible values.

ℹ️

Note

Search API v4.0 is available beginning in Orange Logic London. Earlier Orange Logic releases use Search API v3.0.