Skip to end of metadata
Go to start of metadata

Change to Custom Field Search

As of Razuna 1.8.2 the search custom field values has changed. See the search in custom field section below!

 

Search API

 

Search and finding assets

Method

Method Name

Returns

searchassets

Record set

Input Parameter

Parameter

Description

Type

Required

Sample Input

(Dates are in European format)

api_key

A valid api key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

 

searchfor

The search entry. Same search syntax as in Search and Find Assets applies.

String

yes

Your search term.
You can use the same search syntax as within Razuna.
Please see Search and Find Assets 

 

show

What kind of assets to show

String

no

all = All assets (default)
img = Images only
vid = Videos only
doc = Documents only
aud = Audios only

 

doctype

Filters the doc type. Only applies if "show" is set to "doc"!

String

no

empty = All doc types (default)
pdf = PDF
xls = Excel
doc = Word
other = All other types

 
datecreateSearch for files creation dateStringnoExample: 2012-11-08 or 20121108Razuna 1.6
Hosted Edition 11.11.2012 
datechangeSearch for files modification/changed dateStringnoExample: 2012-11-08 or 20121108Razuna 1.6
Hosted Edition 11.11.2012
datecreaterangeSearch for files created within the given date rangeStringnoExample: 20150601 TO 20150701Razuna 1.7.5
Hosted Edition 19.07.2015
datechangerangeSearch for files modified within the given date rangeStringnoExample: 20150601 TO 20150701Razuna 1.7.5
Hosted Edition 19.07.2015
folderidWhen a folderid is being used, the search will only include results within this folder.Stringno489427894Razuna 1.6
Hosted Edition 25.11.2012 
sortbyOption to sort results (see sample)StringnoSort is according to the following values:
name = filename (default)
sizedesc = size descending
sizeasc = size ascending
dateadd = create date descending
datechanged = change date descending 
Razuna 1.6
Hosted Edition 06.03.2013 
availableShow all files that are fully processed and availableStringno1 (default) = is processed
0 = not processed

Razuna 1.6

Hosted Edition 01.09.2013

startrowThe row to start at. Will return results from this row on.
Example: In order to get the next 25 results you would start from row 26!
Numberno1 = defaultRazuna 1.7.5
Hosted Edition 15.04.2015
maxrowsMaximum of records to return in the search.Numberno25 = default

Razuna 1.7.5

Hosted Edition 15.04.2015

showrenditionsOption to include renditions in the returning data loadbooleannotrue (default)
false

Razuna 1.7.5

Hosted Edition
06.05.2015

dbdirectSet this to "true" to query the database directly.
This also supports the "search for" parameter. But it will only search in the filename. Additionally, it supports the LIKE search. To do so you need to use "%". 
NOTE: Doesn't work with "show" and "doctype" parameters.
Stringnofalse (default)
true
Razuna 1.6
Hosted Edition 01.09.2013
datecreateparam
(can only be used in combination with dbdirect!)
SQL Parameter to use for getting recordsStringno>, <, =>, =<, between, etc.Razuna 1.6
Hosted Edition 13.12.2012
datecreatestart
(can only be used in combination with dbdirect!)
The start date and timeStringnoFormat has to be "yyyy-mm-dd 00:00:00".
Example: 2012-12-11 17:00:00

Razuna 1.6
Hosted Edition 13.12.2012

datecreatestop
(can only be used in combination with dbdirect!)
The end date and time (used if you want to search with BETWEENStringno

Format has to be "yyyy-mm-dd 00:00:00".
Example: 2012-12-11 17:00:00

Razuna 1.6
Hosted Edition 13.12.2012

datechangeparam
(can only be used in combination with dbdirect!)
SQL Parameter to use for getting recordsStringno>, <, =>, =<, between, etc.Razuna 1.6
Hosted Edition 13.12.2012
datechangestart
(can only be used in combination with dbdirect!)
The start date and timeStringnoFormat has to be "yyyy-mm-dd 00:00:00".
Example: 2012-12-11 17:00:00

Razuna 1.6
Hosted Edition 13.12.2012

datechangestop
(can only be used in combination with dbdirect!)
The end date and time (used if you want to search with BETWEEN)Stringno

Format has to be "yyyy-mm-dd 00:00:00".
Example: 2012-12-11 17:00:00

Razuna 1.6
Hosted Edition 13.12.2012

Field search

As mentioned the search via API supports the same syntax as the search within Razuna. In other words you can search generally as just providing a search term (example: "audrey hepurn") or provide a more field like search. The field search especially allows you to search for words in "keywords, "description", "labels", etc. Example: labels:myLabel or keywords:audrey.

 

Output Value

Name

Description

Sample Output

Response

A result code with the status of the login. If the result is 0 the method was successful.

0

totalassetscount

How many assets are in this folder

8

calledwithThe search term you called with method withAudrey Hepurn

list of fields

the list of fields of each asset

see sample output

Updates

As of Razuna 1.6 (hosted edition since 11.11.2012) the search additionally returns the create and change dates of each record.
As of Razuna 1.6 (hosted edition since 16.12.2012) the search also returns the collection id(s) the file might be in in the column "colid"

Remember to always encode your URL parameters!

 

REST: Sample request

REST: Sample request with multiple search criteria (showing only images and renditions)

REST: Sample request for getting files within a given date range

 

REST: Sample request search within a date range and the dbdirect method

Sample Output

Output format

Remember you can adjust the output dynamically. The API returns JSON by default. For record sets it defaults to a ROW based set, if you need COLUMNS simply append "&__BDQUERYFORMAT=column" to your call. In case, you need JSONP you want to append "&__BDRETURNFORMAT=jsonp&callback=?". In order to retrieve XML (WDDX) you simply need to append "&__BDRETURNFORMAT=wddx".

Search for Labels

Since Razuna 1.5 there is also the option to search for labels. Since the search API depends on the search within Razuna you can also leverage the label search within the API. In order to do so, you simply do a field search as in:

In this example; "Labels" is the field and "Animals" is the label. Simply add this to the searchtext as in any other search and it would looks like this:

Remember to escape any paramater so the searchtext would actually be encoded and be "&searchtext=labels%3A(Animals)".

As in any other search you might want to combine many labels in your search. As an example, I would have an asset taged with "Animals" and "Animals/Big Animals". In this case, we would "AND" them all together and combine them into a field search as in:

Again, you need to encode the URL as in this example it would be "&searchtext=labels%3A(Animals)%2C(Animals+big+animals)". You only need to URL encode characters outside the "()"!

Search for Custom Fields

 

Razuna 1.8.2

As of Razuna 1.8.2 the search for custom field values has changed!

With Razuna 1.8.2 the custom field ID do NOT contain any "-" anymore and you would write the search value attached to the ID. Additionally, there is no need to include the "+" anymore.

To search for a value in a custom field you would do this:

If you need to search for more than one value in the same custom field, you would do this:

The above assumes that the custom field has the value "audrey hepurn". The value do not need to be next to each other!

The same applies if you have a one custom field value that consists of two words and you, say a drop down menu with the option "fast car". Razuna's search engine treats both words as separate entries, thus in order to find all files with the value "fast car" you would have to issue the search as in the example shown above.

 

Just as with Labels you have the option to integrate custom fields in your search since Razuna 1.5.

As custom fields can be dynamically created within Razuna or the API, you will need to know the custom field ID to search against. (You can grab the ID within Razuna or by querying the Custom Fields API). Once you now the field ID you add the ID and your value together and execute the search. As in:

In this example, we assume that my custom field ID is "255F307E-AE5A-4E66-AD2F6BBE81D0541C" and the value I'm looking for is "audrey". Again, just like with any other search, you need to add this to your API call as in:

NOTE: You NEED to combine them with () in order for the search to work properly. In order to search for many custom field value you can combine the search like this:

As of Razuna 1.7.5 the select multiple field is available. In order to search for multiple values in in a custom field you simply "+" the values in your API call:

 

 

 

Remember to always encode your URL parameters! Example: customfieldvalue%253A(%252BF3013F39-D493-4D06-A44A04C5145D3AC7%2520%252B048001213364)

 

As you can see, the search allows for some very powerful ways to query your storage store within Razuna and only retrieve the assets you need within your application. Now, with the power of the above examples we are sure you can come up with some very useful methods to add Razuna to your existing application stack.

Indexing/rebuilding the search index

Availability

This API method is available since the 1.6 release (hosted platform as of September 2013)

The below API method gives you the option to trigger the indexing of all files not indexed yet, triggering indexing of individual files (re-index) or trigger a full re-build (indexing of all files in your library).

Method

Method Name

Returns

searchIndex

Status

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

assetid

The id of the asset or a list of id's (delimited with a ",")

String

yes

Possible values are:
assetid = single assetid or list of assetids
all = rebuild search index

Output Value

Name

Description

Sample Output

Response

A result code with the status. If the result is 0 the method was successful.

0

message

Message of the result

see sample output

REST: Sample Request

Sample Output

 

 

 

 

/global/api2/search.cfc?method=searchassets&api_key=54592180-7060-4D4B-BC74-2566F4B2F943
&searchfor=batman*&dbdirect=true&datecreatestart=2012-12-11 17:00:00&datecreatestop=2012-12-12 17:00:00&datecreateparam=between
  • No labels