Documentation

Asset Repository query syntax

Asset repository allows you to create queries that enable the easier and more efficient content search. The rules for creating queries are described below.

Search terms

When you enter a word into the search field, Asset Repository By default, all metadata fields (including the one defined by the user) are checked for a query match and only full words are tested (with the exception of the file name). For instance, the "exam" query will return assets with the file name "exam.png" or from the lesson "math exam", but not from the "example lesson".

AND operator

When multiple words in the query are seperated either by spaces only, or by the AND operator, the query will match all assets that contain all words (not necessarily in the same field). For example:

test1 AND test2

or

test1 test2

will return all assets containing both test1 and test2.

All AND operators have to have statements on both sides, otherwise an error will occur.

Quotation marks

If a sequance of words is placed inside the quotation marks, they will be treated as a whole. The query will only match assets that contain the entire sequence, and not just individual words.

All quotes have to be closed, otherwise an error will occur.

Fields

You can test values in specific fields by using the following syntax:

field_name=value

field_name:value

Both are valid and have the same result – they return all assets containing the term "value" in the filed "field_name". The valid field names are listed below:

Field name Description
file_name Name of the file, including extension. In case of pages, page title is used.
owner Username of the asset's owner
lesson Content title
publication Publication title
project Project title
content_type Specifies the type (e.g. "image") and format (e.g. "png") of the file.

User defined metadata

When testing values of user defined metadata, replace all spaces in field names with the low dash ( "_" ). For example, a query returning all assets that contain the term "test" in the field "Custom metadata" would be:

Custom_metadata=test

OR operator

You can use the OR operator if you wish to find assets containing at least one of the specified values. For example:

test1 OR test2

will return all assets containing either "test1" or "test2" in one of their fields. It should be noted that OR statements are resolved before AND statements. The following query:

test1 AND test2 OR test3

will return all assets that contain both "test1" and either "test2" or "test3" (so, "test1 test2", "test1 test3" and "test1 test2 test3", but not "test2 test3").

All OR operators have to have statements on both sides, otherwise an error will occur.

NOT operator

You can use NOT operator to find all assets that do not contain a specific statement. For example:

NOT test1

will return all assets that do not contain "test1".

All NOT operators have to be followed by a statement, otherwise an error will occur.

Brackets

You can place parts of your query in brackets in order to control the order in which the statements are resolved. For example:

(test1 AND test2) OR test3

will return all assets containing either "test3" or both "test1" and "test2". Without the brackets, the "test2 OR test3" statement would be resolved before "test1 AND test2", possibly resulting in a different set of assets.

All brackets have to be closed, otherwise an error will occur.