do_search

Perform a search and return the matching resources.

Param1 * $search The search string in the standard ResourceSpace format.
Param2 $restypes A string of resource type IDs to include e.g. "1,2". Leave empty to return resources of all types.
Param3 $order_by A string indicating results order. Valid options are relevance, popularity, rating, date, colour, country, title, file_path, resourceid, resourcetype, titleandcountry, random, status. Leave empty for relevance ordering.
Param4 $archive The archive status of resources to return. 0=live assets (the default), 1=pending archive, 2=archived, 3=deleted, -1=pending review, -2 = pending submission.
Param5 $fetchrows Maximum number of rows to return. Leave blank to return all rows.
Param6 $sort Sort order, "asc"=ascending, "desc"=descending (default).

Dates

When performing searching that include dates the following formats should be considered

Where "datefieldname" is the name of the date field you wish to search on

If date ranges is being used

datefieldname:rangestart2019-01-01end2019-01-07
datefieldname:rangestart2019-01end2019-01-31
datefieldname:rangestart2019end2019-12-31

If date ranges is not being used

datefieldname:2019|01|01
datefieldname:2019|01|nn
datefieldname:2019|nn|nn
datefieldname:nnnn|01|nn
etc.

Return values

The resource results in JSON format. The parameters returned will depend on system configuration.

[
{"score":"0",
"ref":"38",
"resource_type":"1",
"has_image":"0",
"is_transcoding":"0",
"hit_count":"0",
"creation_date":"2016-08-09 14:00:05",
"rating":"",
"user_rating":"",
"user_rating_count":"",
"user_rating_total":"",
"file_extension":"jpg",
"preview_extension":"jpg",
"image_red":"",
"image_green":"",
"image_blue":"",
"thumb_width":"",
"thumb_height":"",
"archive":"0",
"access":"0",
"colour_key":"",
"created_by":"1",
"file_modified":"2016-08-09 14:00:05",
"file_checksum":"",
"request_count":"0",
"new_hit_count":"0",
"expiry_notification_sent":"0",
"preview_tweaks":"0|1",
"file_path":"",
"group_access":"",
"user_access":"",
"field12":"2016-08-09 12:59",
"field8":"Example Photo",
"field3":"Lebanon"}
]