Search
Runs a search for assets.
Defined in: search.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Search(search, pageSize, pageIndex, sortField, sortDirection, verbose, FILTERS, fields)
Runs a search and displays the asset info for each result
|
Class Detail
Search(search, pageSize, pageIndex, sortField, sortDirection, verbose, FILTERS, fields)
Runs a search and displays the asset info for each result
- Parameters:
- search
- a JSON search object to execute. search = { "conjunction":"or", "criteria": [ { "fieldId":"http://purl.org/dc/elements/1.1/ subject", "condition":"cont", "value":"newValue" } ] }
- pageSize Optional, Default: 100
- the number of assets to give in the response
- pageIndex Optional, Default: 0
- the index of the page to return
- sortField Optional
- the namespace of the desired field ex "record_id" or "http://purl.org/dc/elements/1.1/ subject"
- sortDirection Optional
- "ASC" or "DESC". the order in which the sortFiled should be applied
- verbose Optional, Default: false
- Setting this to true will collect a variety of default values for each asset.
- FILTERS Optional
- Filtering can be applied to the "id", "name", "path", "height", "width", "bytes", "lastModified", "mimeType", and "resolver" properties if verbose=true.
- fields Optional
- An array of field id's to collect the values for each asset
- Returns:
- [{AssetData}, ... ]
Supported Search Conditions- Container Fields
- cont
- not_cont
- not
- null
- cont_part
- not_cont_part
- Integer Fields
- not
- null
- eq
- ne
- le
- lt
- ge
- gt
- anyval
- notchanged
- Hierarchy Fields
- not
- null
- eq
- ne
- cont
- not_cont
- anyval
- notchanged
- Date Fields
- not
- null
- eq
- ne
- le
- lt
- ge
- gt
- between
- anyval
- notchanged
- Other Fields
- not
- null
- eq
- ne
- beg
- not_beg
- end
- not_end
- cont
- not_cont
- bulkIs
- bulkStart
- all
- any
- phrase
- wo
- anyval
- notchanged
English Translations- ne = Does not equal
- lt = Less than
- le = Less than or equal to
- gt = Greater than
- ge = Greater than or equal to
- between = Between
- cont = Contains
- not_cont = Does not contain
- beg = Begins with
- not_beg = Does not begin with
- end = Ends with
- not_end = does not end with
- null = is null
- not = is not null
- bulkIs = Bulk is
- bulkStart = Bulk Starts with
- cont_part = Contains partial value
- not_cont_part = Does not contain partial value
- anyval = Any value
- all = All words
- any = Any Words
- phrase = Has Exact phrase
- wo = Without word
A search for assets where the Dublin Core Keywords field contains the value "newValue" /wf/restapi/v2/search Parameters: fields = ["http://purl.org/dc/elements/1.1/ subject"] search = { "conjunction":"or", "criteria": [ { "fieldId":"http://purl.org/dc/elements/1.1/ subject", "condition":"cont", "value":"newValue" } ] } Response: [ { "id": 201628187, "fields": { "http://purl.org/dc/elements/1.1/ subject": [ "newValue", "newValue" ] } }, ]
A search for assets where the Dublin Core Keywords field contains the value "newValue" or "check" /wf/restapi/v2/search Parameters: fields = ["http://purl.org/dc/elements/1.1/ subject"] search = { "conjunction":"or", "criteria": [ { "fieldId":"http://purl.org/dc/elements/1.1/ subject", "condition":"cont", "value":"newValue" }, { "fieldId":"http://purl.org/dc/elements/1.1/ subject", "condition":"cont", "value":"check" } ] } Response: [ { "id": 201629260, "fields": { "http://purl.org/dc/elements/1.1/ subject": [ "check", "1", "2" ] } }, { "id": 201628187, "fields": { "http://purl.org/dc/elements/1.1/ subject": [ "newValue", "newValue" ] } } ]
Include a quick search with the search object /wf/restapi/v2/search Parameters: quickSearch=apple verbose=true search = { "conjunction":"AND", "criteria":[ { "fieldId":"file_name", "condition":"ne", "value":"__easter_egg__" } ] } Response: [ { "id": 201631733, "name": "apple.jpeg", "path": "apple.jpeg", "height": 240, "width": 210, "bytes": 40335, "lastModified": 1518701186000, "mimeType": "image/jpeg", "previews": { "thumbnail": "http://10.31.210.2:55555/servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363331373333", "viewex": "http://10.31.210.2:55555/servlet/jb.view?table=viewex&col=viewex&id=pe_323031363331373333", "downloadUrl": "http://10.31.210.2:55555/servlet/dload?id=201631733" } } ]