Query Syntax

Overview

The query syntax for DeepSearch is similar to the syntax of search engines, where a user can additionally specify how to interpret the query (or part of it) by providing “prefixes”.

A query consists of a single line of text for which DeepSearch returns a number of results. The score for each asset is computed as a combination of name, tag matches, and similarity to the input query in the AI embedding space. Here are some search examples:

  • Query: white car

../../_images/ngsearch_query_syntax_white_car.png
  • Query: watermelon

../../_images/ngsearch_query_syntax_watermelon.png

Query filtering

As described in the previous section DeepSearch takes into account tag and name matches, when scoring the indexed assets. You can augment the queries with additional filters to narrow down the search to a specific type of asset (e.g., ones created after a certain date or by a specific user, etc.). To achieve this, additional information in the query string must be in one of the following forms:

  • prefix:<one word>

  • prefix:”<multiple words>”

In this example, the prefix is a single identifier without spaces, representing the filter type (e.g., “tag”, “name”, “created_by”, “modified_after”, etc. Refer to the Available Prefixes section below for a complete list of supported prefixes).

Single query may contain multiple entries with prefixes in which case the effect of each individual filter (i.e. prefixed entry) will be combined. For example:

This will filter assets that have USD extension and are created by my-user@my-company.com user and then sort these results by positioning formula one cars first (text query).

The effect of prefixes can also be reversed, by adding a “-” in front of them, for example:

  • “formula 1 car” -name:”benetton”

This will sort the result by positioning the formula one cars first (text query), but remove those that have “benetton” in their name.

OR Syntax

As explained in the previous section, you can use prefixes to filter query results. If you want to filter results based on any of the conditions for a given prefix (OR behavior), separate the conditions of that prefix with commas. For example, the following query selects the files with extension usd or jpg and sorts them by similarity with the concept of basket:

basket ext:usd,jpg

Note

Don’t use spaces around the comma. Otherwise, you will split the query.

When you search for substrings containing spaces or commas, the search expression needs to be enclosed in double quotes:

name:"name, with comma",test

This query matches assets that have either “name, with comma” or “test” (or both) in their name.

Warning

There is no way to OR filters with different prefixes, only conditions for the same prefix.

Wildcards

Below are examples of how Wildcards can be used in searches.

Supported Wildcards

Wildcard

Description

Example

*

Matches any number of any characters

name:ca*t may find “cart” and “catapult” assets

?

Matches any single character

name:b?t may find “bat” and “bot” assets

Note

You can use multiple wildcards in a single, prefixed query. For example, name:c?a*r may find “chair” and “character” assets.

Supported Prefixes

Prefix

Example

name

name:sp*rt c?r

ext

ext:usd*

path

path:/p?th/to/my/aw?s*me/*lder

The default query also supports wildcards, but only to match asset names. For example, car matches assets based on a combination of their name, AI, and tag. car* matches assets that have car* in their name (equivalent to name:car*).

Available Prefixes

Prefix

Description

image

Image-based similarity search

description

AI-driven text-based search

name

Filters search results by the asset file name (partial matching is supported)

ext

Filters search results by the asset file extension (e.g., ext:usd)

path

Filters search results by the full path (e.g., path:/Path/to/my/Project)

tag

Filters search results by a specific tag (e.g., tag:car)

created_after

Filters search results that are newer than a specific date (e.g., created_after:2022-01-01)

created_before

Filters search results that are older than a specific date (e.g,. created_before:2022-01-01)

modified_after

Filters search results that are modified after a specific date (e.g., modified_after:2022-01-01)

modified_before

Filters search results that are modified before a specific date (e.g., modified_before:2022-01-01)

larger_than

Filters search results that are larger than a given size (e.g., larger_than:"4MB")

smaller_than

Filters search results that are smaller than a given size (e.g., smaller_than:"4KB")

created_by

Filters search results that are created by a provided user (e.g., created_by:user-name@my-company.com)

modified_by

Filters search results that are modified by a provided user (e.g., modified_by:user-name@my-company.com)

max

Limits the number of results returned from the search service (default: 32)