Search query for MediaAssetFile entity
This search with the parameter "query" for MediaAssetFile entity is available since the 8.0.03 Hotfixes 1
The report "bySearch" for the entity MediaAssetFile provides searching and finally result listing of the data entity MediaAssetFile. Its specific parameter "mediaQuery" is used to search the result directly with the search fields defined in Media Manager, while the specific parameter "query" is for the usual search with the Field entity defined in PIM repository, just like other general objects in system.
This chapter introduces the report "bySearch" with the parameter "query".
Currently it is only supported by PIM Core with Media Manager and the data access is not per PIM database, but per the connector API.
-
Retrieve all media asset files whose filename contain "test"
Retrieve all media asset files which belong to a category or its child categories
Retrieve all media asset files whose version is greater or equals 2
Retrieve all media asset files who are changed on the 2015-11-12 or later
Retrieve all media asset files whose medias type equals "images"
Retrieve all media asset files whose english memo contains "test"
Retrieve all media asset files whose name start with "test" or whose english memo equals "test"
Syntax for query
The syntax for the search with the parameter "query" is same as the other general objects in PIM, please visit the following page for the corresponding information REST Search Query Language.
While the data access of the search query is not per PIM database, but per the connector API, there are several limitations by search with the parameter "query":
Search value is always case insensitive, it means that upper and lower case differences will be ignored, so that the result from "equals" is same as the one from "equalsIC", also for "contains" and "containsIC", "startsWith" and "startsWithIC".
Search with mixed language in one query is not allowed. For example, a search with combination of the different language specifical attributes like following is not possible:
ILLEGAL REST CALL
iIlegal REST call with mixed languagecurl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttributeLang.Memo(English) startsWith "test" or MediaAssetFileAttributeLang.Memo(German) startsWith "test"&fields=MediaAssetFile.Identifier
The following table indicates search information for all searchable MediaAssetFile fields defined in repository
ENTITY FIELD |
OPERATOR |
CONTENT |
Example search content |
Notice |
MediaAssetFile.Identifier |
=, != / <>, equals(IC), contains(IC), startsWith(IC), in, is empty |
Media asset file identifier (STRING ) |
D1100010561 |
|
MediaAssetFileAttribute.Categories |
=, != / <>, equals(IC) |
|
|
|
MediaAssetFileAttribute.Filename |
=, != / <>, equals(IC), contains(IC), startsWith(IC), in, is empty |
File name(String) |
test.jpg |
|
MediaAssetFileAttribute.Resolution |
=, != / <>, <, <=, <, >=, equals |
Resolution value (INTEGER ) |
100 |
|
MediaAssetFileAttribute.ColorDepth |
=, != / <>, <, <=, <, >=, equals |
Color depth value (INTEGER ) |
24 |
|
MediaAssetFileAttribute.ColorSpace |
=, != / <>, equals(IC), contains(IC), startsWith(IC), in, is empty |
Color space value (STRING ) |
RGB |
|
MediaAssetFileAttribute.ColorProfile |
=, != / <>, equals(IC), contains(IC), startsWith(IC), in, is empty |
Color profile value (STRING ) |
sRGB |
|
MediaAssetFileAttribute.Version |
=, != / <>, <, <=, <, >=, equals |
Version value (INTEGER ) |
2 |
|
MediaAssetFileAttribute.CreationDate |
=, != / <>, <, <=, <, >=, equals |
Creation date value (DATETIME ) |
2011-10-21T10:00:00 |
Only the date of the search content is considered for search, time information will be ignored. |
MediaAssetFileAttribute.LastModified |
=, != / <>, <, <=, <, >=, equals |
Last modified value (DATETIME ) |
2011-10-21T10:00:00 |
Only the date of the search content is considered for search, time information will be ignored. |
MediaAssetFileAttribute.Type |
=, != / <>, equals(IC), in |
Only the following string values are allowed:
|
images |
The allowed search contents are the labels of the Media Manager Enum MediaDataTypes whose id and the detailed medias type name are stored as Class for this entity field in PIM. E.g. a search with the "query=MediaAssetFileAttribute.Type = images" may return media asset files with field value "2#####JPEG" and "2#####Graphics Interchange Format", in which "2" is the id of the MediaDataTypes enum entry, "JPEG" and "Graphics Interchange Format" are detailed medias type names. |
MediaAssetFileAttribute.State |
=, equals, is empty |
entry of Enum.MediaAssetFileState |
"Job is finished" 2 |
|
MediaAssetFileAttribute.Status |
=, equals |
entry of Enum.MediaAssetFileStatus |
Free |
|
MediaAssetFileAttribute.Finished |
=, equals |
True |
True |
|
MediaAssetFileAttribute.InProgress |
=, equals |
True |
False |
|
MediaAssetFileAttributeLang.Name |
=, != / <>, equals(IC), contains(IC), startsWith(IC), in, is empty |
Name value (STRING) |
nameTest |
|
MediaAssetFileAttributeLang.Memo |
=, != / <>, equals(IC), contains(IC), startsWith(IC), is empty |
Name value (STRING) |
memoTest |
|
Property Field of Boolean type |
=, equals |
True |
True |
|
Property Field of Text type |
=, != / <>, equals(IC), contains(IC), startsWith(IC), in, is empty |
Text value (STRING) |
test |
|
Property Field of Integer type |
=, != / <>, <, <=, <, >=, equals, in |
Integer value (INTEGER ) |
2 |
|
Property Field of Decimal type |
=, != / <>, <, <=, <, >=, equals |
Decimal value (DECIMAL) |
11.0 |
|
Property Field of Date type |
=, != / <>, <, <=, <, >=, equals |
Date value (DATE) |
2016-05-03 |
|
Property Field of SelectionList type |
=, equals |
entry of the corresponding enumeration (STRING) |
one |
|
Property Field of MultiSelectionList type |
=, equals, contains |
entry of the corresponding enumeration (STRING) |
First |
|
Property Field of Long Text type |
=, != / <>, equals(IC), contains(IC), startsWith(IC), is empty |
Long text value (STRING) |
long test test |
Examples
Retrieve all media asset files whose filename contain "test"
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttribute.Filename contains test&fields=MediaAssetFile.Identifier,MediaAssetFileAttribute.Filename
The following JSON object is returned:
{
"cacheId"
:
"20160204_110314_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
79
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
79
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"911000107072"
,
"label"
:
"Media asset file 911000107072"
},
"values"
: [
"D11000107072"
,
"test2.png"
]
},
...
]
}
Retrieve all media asset files which belong to a category or its child categories
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttribute.Categories = "0099%"&fields=MediaAssetFile.Identifier,MediaAssetFileAttribute.Filename, MediaAssetFileAttribute.Categories
The following JSON object is returned:
{
"cacheId"
:
"20160204_172920_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
191
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
100
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"911000100111676"
,
"label"
:
"Media asset file 911000100111676"
,
"entityId"
:
2500
},
"values"
: [
"D11000100111676"
,
"test1.jpg"
,
[
"009900020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#####testFolder#####/test2/testFolder#####2#####false"
]
]
},
{
"object"
: {
"id"
:
"911000100112015"
,
"label"
:
"Media asset file 911000100112015"
,
"entityId"
:
2500
},
"values"
: [
"D11000100112015"
,
"test2.jpg"
,
[
"009900010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#####Odie#####/test1/New category/Odie#####3#####false"
]
]
},
...
]
}
Retrieve all media asset files whose version is greater or equals 2
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttribute.Version >= 2&fields=MediaAssetFile.Identifier,MediaAssetFileAttribute.Version
The following JSON object is returned:
{
"cacheId"
:
"20160204_173549_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
650
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
100
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"911000107070"
,
"label"
:
"Media asset file 911000107070"
,
"entityId"
:
2500
},
"values"
: [
"D11000107070"
,
"2"
]
},
{
"object"
: {
"id"
:
"9110001070102"
,
"label"
:
"Media asset file 9110001070102"
,
"entityId"
:
2500
},
"values"
: [
"D110001070102"
,
"4"
]
},
...
]
}
Retrieve all media asset files who are changed on the 2015-11-12 or later
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttribute.LastModified >= 2015-11-12T10:00:00&fields=MediaAssetFile.Identifier,MediaAssetFileAttribute.LastModified
The following JSON object is returned:
{
"cacheId"
:
"20160204_173754_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
181
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
100
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"911000100112281"
,
"label"
:
"Media asset file 911000100112281"
,
"entityId"
:
2500
},
"values"
: [
"D11000100112281"
,
"2015-11-12T18:59:56:623+0100"
]
},
{
"object"
: {
"id"
:
"911000100112290"
,
"label"
:
"Media asset file 911000100112290"
,
"entityId"
:
2500
},
"values"
: [
"D11000100112290"
,
"2015-11-13T12:44:44:543+0100"
]
},
...
]
}
Retrieve all media asset files whose medias type equals "images"
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttribute.Type = images&fields=MediaAssetFile.Identifier,MediaAssetFileAttribute.Filename, MediaAssetFileAttribute.Type
The following JSON object is returned:
{
"cacheId"
:
"20160204_174021_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
7535
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
100
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"91100010561"
,
"label"
:
"Media asset file 91100010561"
,
"entityId"
:
2500
},
"values"
: [
"D1100010561"
,
"background.jpg"
,
"2#####JPEG"
]
},
{
"object"
: {
"id"
:
"91100010702"
,
"label"
:
"Media asset file 91100010702"
,
"entityId"
:
2500
},
"values"
: [
"D1100010702"
,
"joerg_bundesjogi_2.png"
,
"2#####Portable Network Graphics"
]
},
...
]
}
Retrieve all media asset files whose english memo contains "test"
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttributeLang.Memo(English) contains "test"&fields=MediaAssetFile.Identifier,MediaAssetFileAttributeLang.Memo(English), MediaAssetFileAttributeLang.Memo(German)
The following JSON object is returned:
{
"cacheId"
:
"20160204_174304_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
5
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
5
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"911000107063"
,
"label"
:
"Media asset file 911000107063"
,
"entityId"
:
2500
},
"values"
: [
"D11000107063"
,
"test"
,
"no"
]
},
{
"object"
: {
"id"
:
"91100010701194"
,
"label"
:
"Media asset file 91100010701194"
,
"entityId"
:
2500
},
"values"
: [
"D1100010701194"
,
"memo_engtest"
,
"memo_ger"
]
},
...
]
}
Retrieve all media asset files whose english property field(of MultiSelectList type) contains "First"
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttributeLang.MetaDataMultiSelectionList(en) contains "First"&fields=MediaAssetFile.Identifier,MediaAssetFileAttributeLang.MetaDataMultiSelectionList(en),MediaAssetFileAttributeLang.MetaDataMultiSelectionList(de)
The following JSON object is returned:
{
"cacheId"
:
"20160204_174522_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
11
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
11
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"91100010702"
,
"label"
:
"Media asset file 91100010702"
,
"entityId"
:
2500
},
"values"
: [
"D1100010702"
,
[
"Second"
,
"First"
],
[
"Fuenfte"
,
"Dritte"
,
"Zweite"
]
]
},
{
"object"
: {
"id"
:
"911000107066"
,
"label"
:
"Media asset file 911000107066"
,
"entityId"
:
2500
},
"values"
: [
"D11000107066"
,
[
"First"
,
"Third"
],
[]
]
},
...
]
}
Retrieve all media asset files whose name start with "test" or whose english memo equals "test"
curl -u rest:heiler -H
"Accept: application/json"
-X GET http:
//localhost:1512/rest/V1.0/list/MediaAssetFile/bySearch?query=MediaAssetFileAttribute.Filename startsWith "test" or (MediaAssetFileAttributeLang.Memo(en) = test )&fields=MediaAssetFile.Identifier, MediaAssetFileAttribute.Filename,MediaAssetFileAttributeLang.Memo(en)
The following JSON object is returned:
{
"cacheId"
:
"20160204_175436_0"
,
"entityIdentifier"
:
"MediaAssetFile"
,
"totalSize"
:
47
,
"startIndex"
:
0
,
"pageSize"
:
100
,
"rowCount"
:
47
,
"columnCount"
:
0
,
"columns"
: [],
"rows"
: [
{
"object"
: {
"id"
:
"911000107063"
,
"label"
:
"Media-Asset-Datei 911000107063"
,
"entityId"
:
2500
},
"values"
: [
"D11000107063"
,
"garfield_and_odie.jpg"
,
"test"
]
},
{
"object"
: {
"id"
:
"911000107072"
,
"label"
:
"Media-Asset-Datei 911000107072"
,
"entityId"
:
2500
},
"values"
: [
"D11000107072"
,
"test2.png"
,
"memo"
]
},
...
]
}