Command Parameter

Syntax

The syntax for the command parameter is:

s.cmd=<someCommand>[ <someCommand>]*

A query string may contain many s.cmd parameters, and each s.cmd parameter may contain may commands separated, by the space (' ') character. The order of s.cmd parameters within the query string and the order of commands within an s.cmd parameter are unimportant. Command names do not contain any special characters which would require escaping, but the following characters in the command arguments must be escaped: ,:\()${}


Function

The command parameter passes commands to the search api.

Example - Using the command parameter

This command clears all textQueries, searchTerms, textFilters, rangeFilters, facetValueFilters and paging,
then applies a textQuery of <span class="code">tropical rain forest</span> and requests ContentType facet counts:
   
  s.cmd=clearSearch()+setTextQuery(tropical+rain+forest)&s.cmd=addFacetField(ContentType,or,1,10)

Try It