Guides

Advanced Search Options

Search for exact match

To search for exact match for a word, enclose the word in double quotes " and escape the double quotes as shown in the examples.

For example,

  • to search for ABC 123, you need to search for "ABC 123" (the double quote escaped format is "\"ABC 123\"")

Search for words with special characters

+ - && | | ! ( ) { } [ ] ^ " ~ * ? : \ / are special characters in the search query. To search for a word that contains special characters you should enclose the word in double quotes.

For example,

  • to search for a+b, enclose the word in double quotes like "a+b"
  • to search for ABC-123, provide the search word as "ABC-123"

Search using Custom Schema Fields

FileSpin supports searching on custom schema fields defined as searchable in Custom Asset Schema. You can provide search criteria for custom schema via a JSON as below:-

This search with below schema_criteria will return with all assets whose schema ID is 1 and which contain "john" in the "name" field.

{
  "schema_criteria": {
    "data_schema_id": 1,
    "fields": {
      "name": "john"
    }
  }
}
KeyValueDescription
data_schema_idJSONAsset Data Schema ID to search on. Mandatory if schema_criteria is given
fieldsJSON(optional) Field name and the search value

Custom Schema search with AND, OR and wildcards

Custom Schema search supports AND, OR and wildcards with certain limitations.

  • AND and OR cannot be used together in the same search criteria.
  • Search criteria can contain upto 5 AND or OR operators.
  • * wildcard can only be used in suffix of search terms like test*, image*.

Examples

  • to search and retrieve assets that contain for john or dan in a custom field called customerName, use "customerName":"john OR dan"
  • to search and retrieve assets that contain the term john in the custom field called customerName, use "customerName":"john"
  • to search and retrieve assets that contain the term john or johny or johnny in a custom field called customerName, use "customerName":"john*"

Notes & tips on Search API

  • To search for exact string match, quote the search string, e.g. "\"my exact search string\"". This will search for the exact string "my exact search string".
  • Custom Schema Fields search using "schema_criteria" can be used in combination with other standard search parameters such as keyword, content_type, sort_by, etc.
  • Rules for searching words with special characters and exact match apply to custom schema fields as well.
  • Search results are sorted by relevance by default. You can sort the results by other supported sort fields such as upload_time, file_size, etc. using the sort_by parameter.
  • Search conditions are additive. FileSpin applies AND when searching for more than one condition, e.g. if you provide keyword and content_type, the search will return files that match both the keyword and content type.
  • Do not pass empty string value for a field in search query. Instead, remove this field from the search condition.