Commands

Overview

Commands are similar to parameters and provide access to all the same functionality that the parameters do, but they have some distinct advantages. Commands give the Search API one piece of information that direct parameters do not: the action being performed. When the API receives a request via parameters only, all it can do is interpret that request directly. The API must assume that the client has applied all search logic -- such as paging, did you mean (DYM), and facet paging -- correctly. When the API receives a request via a command, it has the information it needs to make some intelligent decisions about search logic.

Commands allow the Search API to provide uniform search logic to all clients across different platforms and implementations, without needing to distribute any client code. Using commands reduces client-side search logic and URL-manipulation code. This makes it easier to learn how to use the API, and keeps developers thinking about the business logic specific to their application rather than the internal implementation details of search logic. Commands are also more efficient because the server needs to parse and interpret the query string when it executes a search. This is a perfect time to apply search logic directly to the search, and doesn't require any additional parsing or assembly steps. If search logic is performed on the client side instead, then the client needs to perform the extra steps of parsing the query, applying logic and re-assembling a new query, before it is sent to the API.

Because commands are not guaranteed to be received by the API in any specific order, a natural order is applied to commands. Commands will always be executed in the order they appear in the Quick Reference list.

For more details on specific commands, see the Topics list on the left, and the Quick Reference list.


A Use Case

Assume that an end user does a search via two search terms, author and title. DYM is enabled on the original search, and there are several facet fields specified. When the user receives their results, they page through several facet-value options, click through to page two (for which the client simply sends a new request with s.pn=2, and forgets to disable DYM). Then the client clicks on a facet value to be applied as a filter.

At this point, the correct search logic would be to disable DYM, set page number to one, set all facet-field page numbers to one, and add the facet-value filter. A naive client implementation may simply append one new s.fvf parameter to the existing query string, and send that as the new query. This would appear wrong to the end user, since the result set would completely change, and they would not be directly entering anything that would need spelling correction, yet they could end up on page two of the result set, with spelling corrections coming back, drilled down to pages of facet fields that don't provide any limiting values for the current query.

If the client appended s.cmd=addFacetValueFilter(...) to the existing query instead of appending an s.fvf parameter directly, the API would have detected what the client was doing and applied all of the above-mentioned search logic automatically. The results would make sense to the end user, and the client wouldn't have to do any additional URL manipulation.

Characters may be escaped with the backslash ('\') character. For all command arguments, the following characters must be escaped: ,:\()${}.

Some special characters may need to be escaped for command arguments that hold Lucene-style query syntax. Characters that may need to be escaped include: +-&|!(){}[]^"~*?:\. Lucene special characters only need to be escaped if their special meaning was not intended. If Lucene escaping is needed it must be performed before regular argument escaping.

Example - Building queries via commands

Start with a blank query and ask for ContentType facet field:

  Append:

    s.cmd=addFacetField(ContentType,or,1,10)

  Which becomes:

    s.ff=ContentType%2Cor%2C1%2C10

Search for documents with author of Jonathan Swift and title of Gulliver's Travels:

  Append:

    s.cmd=addTextQuery(Author\:\(Jonathan+Swift\))+addTextQuery(Title\:\(Gulliver's+Travels\))

  To make:

    s.ff=ContentType%2Cor%2C1%2C10&s.cmd=addTextQuery(Author\:\(Jonathan+Swift\))+addTextQuery(Title\:\(Gulliver's+Travels\))

  Which becomes:

    s.q=Title%3A%28Gulliver%27s+Travels%29&s.q=Author%3A%28Jonathan+Swift%29&s.ff=ContentType%2Cor%2C1%2C10

Move to next page:

  Append:

    s.cmd=nextPage()

  To make:

    s.q=Title%3A%28Gulliver%27s+Travels%29&s.q=Author%3A%28Jonathan+Swift%29&s.ff=ContentType%2Cor%2C1%2C10&s.cmd=nextPage()

  Which becomes:

    s.q=Title%3A%28Gulliver%27s+Travels%29&s.q=Author%3A%28Jonathan+Swift%29&s.ff=ContentType%2Cor%2C1%2C10&s.pn=2

Move to next facet-field page:

  Append:

    s.cmd=nextFacetPage(ContentType)

  To make:

    s.q=Title%3A%28Gulliver%27s+Travels%29&s.q=Author%3A%28Jonathan+Swift%29&s.ff=ContentType%2Cor%2C1%2C10&s.pn=2&s.cmd=nextFacetPage(ContentType)

  Which becomes:

    s.q=Title%3A%28Gulliver%27s+Travels%29&s.q=Author%3A%28Jonathan+Swift%29&s.ff=ContentType%2Cor%2C2%2C10&s.pn=2

Apply ContentType facet-value filter of "Book":

  Append:

    s.cmd=addFacetValueFilter(ContentType,Book)

  To make:

    s.q=Title%3A%28Gulliver%27s+Travels%29&s.q=Author%3A%28Jonathan+Swift%29&s.ff=ContentType%2Cor%2C2%2C10&s.pn=2&s.cmd=addFacetValueFilter(ContentType,Book)

  Which becomes:

    s.q=Title%3A%28Gulliver%27s+Travels%29&s.q=Author%3A%28Jonathan+Swift%29&s.ff=ContentType%2Cor%2C1%2C10&s.fvf=ContentType%2CBook%2C

Notice that s.pn is removed, resetting the paging, and the ContentType facet field has been reset to page 1.

Try It





Facet Field Commands

Add Facet Field Command

Syntax

The syntax for the add facet field command is:

addFacetField(<facetField>, <combineMode>[, <pageNumber or whiteList>, <pageSize>])

The default value for pageNumber is 1, if unspecified. The default value for pageSize is 10, if unspecified.

A whiteList has the form value1:value2:.... It specifies a set of values that are to be included in the facet counts even if their counts are not in the top pageSize, provided only that their counts are non-zero.

Function

The add facet field command adds the facet field, and then it calls clearAllFacetPaging().

Example - Using the add facet field command

This add facet field command adds a new facet field for SubjectTerms and it resets paging on the ContentType facet field:

  s.ff=ContentType,or,2,15&s.cmd=addFacetField(SubjectTerms,and)

Try It


Example - Using the add facet field command with a white list

This command adds a new facet field for SubjectTerms and specifies that 5 values should be returned, including "education" provided that its count is non-zero:

  s.cmd=addFacetField(SubjectTerms,and,education,5)

Try It


Add Range Facet Field Command

Syntax

The syntax for the add range facet field command is:

addRangeFacetField(<facetField>, <minValue>:<maxValue>[:<inclusive>][, <minValue>:<maxValue>[:<inclusive>]]*)

The default value for inclusive is true, if unspecified.


Function

The add range facet field command adds the range facet field, and then it calls clearAllFacetPaging().

Example - Using the add range facet field command

This add range facet field command adds a new range facet field for several ranges in the PublicationDate field,
and it resets paging on the ContentType facet field:

  s.pn=3&s.ff=ContentType,or,2,15&s.cmd=addRangeFacetField(PublicationDate,1971:1980,1981:1990,1991:2000,2001:2010)

Try It


Clear All Facet Fields Command

Syntax

The syntax for the clear all facet fields command is:

clearAllFacetFields()

This command takes no arguments.


Function

The clear all facet fields command removes all facet fields from the request.

Example - Using the clear all facet fields command

This clear all facet fields command removes facet fields and leaves everything else in the query:

  s.pn=3&s.ps=10&s.q=bullfrog&s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and&s.cmd=clearAllFacetFields()

Try It


List Facet Values Command

Syntax

The syntax for the list facet values command is:

listFacetValues(<facetField>, <combineMode>)

There are no defaults for the listFacetValues command.


Function

The list facet values command adds the facet field, and then it calls clearAllFacetFields() setPageSize(0) setHighlighting(false) addFacetField(<facetField>, <combineMode>, 1, 100).

Example - Using the list facet values command

This list facet values command lists facet values for SubjectTerms:

  s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and,1,10&s.cmd=listFacetValues(SubjectTerms,and)

Try It


Remove Facet Field Command

Syntax

The syntax for the remove facet field command is:

removeFacetField(<facetField>)

There are no defaults for the removeFacetField command.


Function

The remove facet field command removes the indicated facet field, and then it calls clearAllFacetPaging().

Example - Using the remove facet field command

This remove facet field command removes the facet field for SubjectTerms and it resets paging on the ContentType facet field:

  s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and&s.cmd=removeFacetField(SubjectTerms)

Try It


Facet Value Filter Commands

Add Facet Value Filters Command

Syntax

The syntax for the add facet value filters command is:

addFacetValueFilters(<facetField>, <value>[: <negated>][, <value>[: <negated>]]*)

The default value for negated is false, if unspecified.


Function

The add facet value filters command adds the facet value filters, and then it calls clearAllPaging().

Example - Using the add facet value filters command

This add facet value filters command adds a new facet value filter ContentType Book,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.cmd=addFacetValueFilters(ContentType,Book:false)

Try It


Add Facet Value Group Filter Command

Syntax

The syntax for the add facet value group filter command is:

addFacetValueGroupFilter(<facetField>, <combineMode>, <value>[, <value>]*)

There are no defaults for the addFacetValueGroupFilter command.


Function

The add facet value group filter command adds the facet value group filter, and then it calls clearAllPaging().

Example - Using the add facet value group filter command

This add facet value group filter command adds a new facet value group filter for education or literature,
and it resets paging on the SubjectTerms facet field and page number:

  s.pn=3&s.ff=SubjectTerms,and,2,15&s.cmd=addFacetValueGroupFilter(SubjectTerms,or,education,literature)

Try It


Clear All Facet Value Filters Command

Syntax

The syntax for the clear all facet value filters command is:

clearAllFacetValueFilters()

This command takes no arguments.


Function

The clear all facet value filters command removes all facet value filters from the request, and then it calls clearAllPaging().

Example - Using the clear all facet value filters command

This clear all facet value filters command removes facet value filters, resets paging, and leaves everything else in the query:

  s.pn=3&s.ps=10&s.q=surgery&s.fvf=ContentType,Book&s.fvf=SubjectTerms,north+america&s.cmd=clearAllFacetValueFilters()

Try It


Negate Facet Value Filter Command

Syntax

The syntax for the negate facet value filter command is:

negateFacetValueFilter(<facetField>[, <value>])

The default value for value is all values, if unspecified.


Function

The negate facet value filter command negates the facet value filter specified if a value is present. If no value is present and only a facet field is given then all facet value filters for that facet field will be negated. After negating facet value filters, this command calls clearAllPaging().

Example - Using the add facet value filter command

This negate facet value filter command negates all ContentType facet value filters,
and negates the north america SubjectTerms facet value filter,
and it resets paging on the facet fields and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and,2,15&s.fvf=ContentType,Book
  &s.fvf=ContentType,Journal+Article&s.fvf=SubjectTerms,north+america&s.fvf=SubjectTerms,u.s
  &s.cmd=negateFacetValueFilter(ContentType)+negateFacetValueFilter(SubjectTerms,north+america)

Try It


Remove Facet Value Filter Command

Syntax

The syntax for the remove facet value filter command is:

removeFacetValueFilter(<facetField>[, <value>])

The default value for value is all values, if unspecified.


Function

The remove facet value filter command removes the facet value filter specified if a value is present. If no value is present and only a facet field is given then all facet value filters for that facet field will be removed. After removing facet value filters, this command calls clearAllPaging().

Example - Using the remove facet value filter command

This remove facet value filter command removes all ContentType facet value filters,
and removes the north america SubjectTerms facet value filter,
and it resets paging on the facet fields and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and,2,15&s.fvf=ContentType,Book
  &s.fvf=ContentType,Journal+Article&s.fvf=SubjectTerms,north+america&s.fvf=SubjectTerms,u.s
  &s.cmd=removeFacetValueFilter(ContentType)+removeFacetValueFilter(SubjectTerms,north+america)

Try It


Remove Facet Value Group Filter Command

Syntax

The syntax for the remove facet value group filter command is:

removeFacetValueGroupFilter(<id>[, <value>])

The default value for value is all values, if unspecified.


Function

The remove facet value group filter command removes the value specified if a value is present. If no value is present and only an id is given then the entire facet value group filter will be removed. After removing specified value or group filter, this command calls clearAllPaging().

Example - Using the remove facet value group filter command

This remove facet value group filter command removes entire facet value group filter 1,
and removes the north america value from facet value grou pfilter 2,
and it resets paging on the facet fields and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and,2,15&s.fvgf:1=ContentType,or,Book,Journal
  &s.fvgf:2=SubjectTerms,or,north+america,u.s
  &s.cmd=removeFacetValueGroupFilter(1)+removeFacetValueGroupFilter(2,north+america)

Try It


Set Facet Value Filters Command

Syntax

The syntax for the set facet value filters command is:

setFacetValueFilters(<facetField>, <value>[: <negated>][, <value>[: <negated>]]*)

The default value for negated is false, if unspecified.


Function

The set facet value filters command adds the facet value filters, replacing any existing facet value filters, and then it calls clearAllPaging().

Example - Using the set facet value filters command

This set facet value filters command adds a new facet value filter ContentType Book,
and it removes the existing facet value filter SubjectTerms north america,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.fvf=SubjectTerms,north+america&s.cmd=setFacetValueFilters(ContentType,Book:false)

Try It


Global Commands

Clear All Command

Syntax

The syntax for the clear all command is:

clearAll()

This command takes no arguments.


Function

The clear all command blanks the query.

Example - Using the clear all command

This clear all command removes everything in the query:

  s.pn=3&s.ps=10&s.q=civil&s.fvf=ContentType,Book&s.fq=law&s.cmd=clearAll()

Try It


Clear Search Command

Syntax

The syntax for the clear search command is:

clearSearch()

This command takes no arguments.


Function

The clear search command calls clearAllTextQueries() clearAllSearchTerms() clearAllTextFilters() clearAllRangeFilters() clearAllFacetValueFilters() clearAllPaging(), resetting the search, but leaving all other parameters like params, page size and facet fields intact.

Example - Using the clear search command

This clear search command clears all search elements but leaves params page size and facet fields intact:

  s.pn=3&s.ho=true&s.ps=10&s.q=foreign&s.ff=ContentType,Book&s.fvf=ContentType,Book&s.fq=trade+economy&s.cmd=clearSearch()

Try It


Set Debugging Command

Syntax

The syntax for the set debugging command is:

setDebugging(<boolean>)

There are no defaults for the setDebugging command.


Function

The set debugging command enables or disables debugging mode.

Example - Using the set debugging command

This set debugging command enables debugging:

  s.cmd=setDebugging(true)

Try It


Set Did You Mean Command

Syntax

The syntax for the set did you mean command is:

setDidYouMean(<boolean>)

There are no defaults for the setDidYouMean command.


Function

The set did you mean command can be used to override the default for whether did you mean suggestions are enabled or not.

Example - Using the set did you mean command

This set did you mean command disables did you mean:

  s.q=calculus&s.cmd=setDidYouMean(false)

Try It


Set Highlight Delimiters Command

Syntax

The syntax for the set highlight delimiters command is:

setHighlightDelimiters(<startValue>, <endValue>)

There are no defaults for the setHighlightDelimiters command.


Function

The set highlight delimiters command sets the start and end highlight delimiters for highlighting in the response document fields.

Example - Using the set highlight delimiters command

This set highlight delimiters command sets the start highlight delimiter to <b> and the end highlight delimiter to </b>:

  s.pn=3&s.ff=ContentType,or,2,15&s.q=philosophy&s.cmd=setHighlightDelimiters(<b>,</b>)

Try It


Set Highlighting Command

Syntax

The syntax for the set highlighting command is:

setHighlighting(<boolean>)

There are no defaults for the setHighlighting command.


Function

The set highlighting command enables or disables highlighting in the response document fields.

Example - Using the set highlighting command

This set highlighting command disables highlighting:

  s.pn=3&s.ff=ContentType,or,2,15&s.q=art+history&s.cmd=setHighlighting(false)

Try It


Set Holdings Only Command

Syntax

The syntax for the set holdings only command is:

setHoldingsOnly(<boolean>)

There are no defaults for the setHoldingsOnly command.


Function

The set holdings only command enables or disables holdings only mode, and then it calls clearAllPaging().

Example - Using the set holdings only command

This set holdings only command enables holdings only,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.q=art+history&s.cmd=setHoldingsOnly(true)

Try It


ID Query Commands

Set Fetch IDs

Syntax

The syntax for the set fetch ids command is:

setFetchIDs(<FETCH_ID>,<FETCH_ID>,<FETCH_ID>)

Note: No more than 100 records can be added per query.


Function

The set fetch ids command is to be used when needing to retrieve one or many records by ID.

Paging Commands

Clear All Facet Paging Command

Syntax

The syntax for the clear all facet paging command is:

clearAllFacetPaging()

This command takes no arguments.


Function

The clear all facet paging command sets all facet field page numbers to 1.

Example - Using the clear all facet paging command

This clear all facet paging command sets facet field page numbers to 1:

  s.pn=3&s.ps=10&s.q=treefrog&s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and,3,20&s.cmd=clearAllFacetPaging()

Try It


Clear All Paging Command

Syntax

The syntax for the clear all paging command is:

clearAllPaging()

This command takes no arguments.


Function

The clear all paging command sets the page number to 1, and then it calls clearAllFacetPaging()

Example - Using the clear all paging command

This clear all paging command sets the page number to 1 and all facet field page numbers to 1:

  s.pn=3&s.ps=10&s.q=mathematics&s.ff=ContentType,or,2,15&s.ff=SubjectTerms,and,3,20&s.cmd=clearAllPaging()

Try It


Go To Facet Page Command

Syntax

The syntax for the go to facet page command is:

goToFacetPage(<facetField>, <pageNumber>)

There are no defaults for the goToFacetPage command.


Function

The go to facet page command sets the page number for a given facet.

Example - Using the go to facet page command

This go to facet page command sends the SubjectTerms facet field to page 3:

  s.ff=SubjectTerms,and,1,15&s.cmd=goToFacetPage(SubjectTerms,3)

Try It


Go To Page Command

Syntax

The syntax for the go to page command is:

goToPage(<pageNumber>)

There are no defaults for the goToPage command.


Function

The go to page command sets the page number, and then it calls clearAllFacetPaging().

Example - Using the go to page command

This go to page command sets the page number to 2 and all facet field page numbers to 1:

  s.pn=4&s.ff=SubjectTerms,and,3,15&s.cmd=goToPage(2)

Try It


Move Facet Page Command

Syntax

The syntax for the move facet page command is:

moveFacetPage(<facetField>, <pageDelta>)

There are no defaults for the moveFacetPage command.


Function

The move facet page command calls goToFacetPage(<facetField>, facetField.pageNumber + <pageDelta>).

Example - Using the move facet page command

This move facet page command changes the SubjectTerms facet field page number to 5:

  s.ff=SubjectTerms,and,2,15&s.cmd=moveFacetPage(SubjectTerms,3)

Try It


Move Page Command

Syntax

The syntax for the move page command is:

movePage(<pageDelta>)

There are no defaults for the movePage command.


Function

The move page command calls goToPage(query.pageNumber + <pageDelta>).

Example - Using the move page command

This move page command changes the page number to 5 and sets all facet field page numbers to 1:

  s.pn=7&s.ff=SubjectTerms,and,2,15&s.cmd=movePage(-2)

Try It


Next Facet Page Command

Syntax

The syntax for the next facet page command is:

nextFacetPage(<facetField>)

There are no defaults for the nextFacetPage command.


Function

The next facet page command calls moveFacetPage(1).

Example - Using the next facet page command

This next facet page command changes the SubjectTerms facet field page number to 6:

  s.ff=SubjectTerms,and,5,15&s.cmd=nextFacetPage(SubjectTerms)

Try It


Next Page Command

Syntax

The syntax for the next page command is:

nextPage()

This command takes no arguments.


Function

The next page command calls movePage(1).

Example - Using the next page command

This next page command changes the page number to 8 and sets all facet field page numbers to 1:

  s.pn=7&s.ff=SubjectTerms,and,2,15&s.cmd=nextPage()

Try It


Previous Facet Page Command

Syntax

The syntax for the previous facet page command is:

previousFacetPage(<facetField>)

There are no defaults for the previousFacetPage command.


Function

The previous facet page command calls moveFacetPage(-1).

Example - Using the previous facet page command

This previous facet page command changes the SubjectTerms facet field page number to 4:

  s.ff=SubjectTerms,and,5,15&s.cmd=previousFacetPage(SubjectTerms)

Try It


Previous Page Command

Syntax

The syntax for the previous page command is:

previousPage()

This command takes no arguments.


Function

The previous page command calls movePage(-1).

Example - Using the previous page command

This previous page command changes the page number to 6 and sets all facet field page numbers to 1:

  s.pn=7&s.ff=SubjectTerms,and,2,15&s.cmd=previousPage()

Try It


Remove Facet Paging Command

Syntax

The syntax for the remove facet paging command is:

removeFacetPaging(<facetField>)

There are no defaults for the removeFacetPaging command.


Function

The remove facet paging command sets the page number to 1 for the given facet.

Example - Using the remove facet paging command

This remove facet paging command sets the SubjectTerms facet field page number to 1:

  s.ff=SubjectTerms,and,2,15&s.cmd=removeFacetPaging(SubjectTerms)

Try It


Set Facet Page Size Command

Syntax

The syntax for the set facet page size command is:

setFacetPageSize(<facetField>, <pageSize>)

There are no defaults for the setFacetPageSize command.


Function

The set facet page size command sets the page size for the given facet, and then it calls removeFacetPaging(<facetField>).

Example - Using the set facet page size command

This set facet page size command changes the SubjectTerms facet field page size to 5,
and sets SubjectTerms page number to 1:

  s.ff=SubjectTerms,and,2,15&s.cmd=setFacetPageSize(SubjectTerms,5)

Try It


Set Page Size Command

Syntax

The syntax for the set page size command is:

setPageSize(<pageSize>)

There are no defaults for the setPageSize command.


Function

The set page size command sets the page size, and then it calls clearAllPaging().

Example - Using the set page size command

This set page size command changes the page size to 4,
and it resets paging on the facet fields and page number:

  s.pn=5&s.ff=SubjectTerms,and,2,15&s.cmd=setPageSize(4)

Try It


Range Filter Commands

Add Range Filter Command

Syntax

The syntax for the add range filter command is:

addRangeFilter(<fieldName>, <minValue>:<maxValue>[:<inclusive>])

The default value for inclusive is true, if unspecified.


Function

The add range filter command adds the range filter, and then it calls clearAllPaging().

Example - Using the add range filter command

This add range filter command adds a new range filter for PublicationDate,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.cmd=addRangeFilter(PublicationDate,1971:1980)

Try It


Clear All Range Filters Command

Syntax

The syntax for the clear all range filters command is:

clearAllRangeFilters()

This command takes no arguments.


Function

The clear all range filters command removes all range filters from the request, and then it calls clearAllPaging().

Example - Using the clear all range filters command

This clear all range filters command removes range filters, resets paging, and leaves everything else in the query:

  s.pn=3&s.ps=10&s.q=geography&s.fvf=ContentType,Book&s.rf=PublicationDate,1971:1980&s.cmd=clearAllRangeFilters()

Try It


Remove Range Filter Command

Syntax

The syntax for the remove range filter command is:

removeRangeFilter(<fieldName>[, <minValue>:<maxValue>[:<inclusive>]])

The default value for the range is all ranges, if unspecified.


Function

The remove range filter command removes the range filter specified if a field name and range are present. If no range is present and only a field name is given then all range filters for that field will be removed. After removing range filters, this command calls clearAllPaging().

Example - Using the remove range filter command

This remove range filter removes the 1991 to 2000 range filter,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.rf=PublicationDate,1991:2000&s.cmd=removeRangeFilter(PublicationDate,1991:2000)

Try It


Set Range Filter Command

Syntax

The syntax for the set range filter command is:

setRangeFilter(<fieldName>, <minValue>:<maxValue>[:<inclusive>])

The default value for inclusive is true, if unspecified.


Function

The set range filter command adds the range filter, replacing any existing range filters, and then it calls clearAllPaging().

Example - Using the set range filter command

This set range filter command adds a new range filter for PublicationDate,
and removes the old range filter for PublicationDate,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.rf=PublicationDate,1991:2000&s.cmd=setRangeFilter(PublicationDate,1971:1980)

Try It


Sort Commands

Reverse Sort Order Command

Syntax

The syntax for the reverse sort order command is:

reverseSortOrder()

This command takes no arguments.


Function

The reverse sort order command reverses the sort order, and then it calls clearAllPaging().

Example - Using the reverse sort order command

This reverse sort order command reverses the sort order,
and it resets paging on the facet fields and page number:

  s.pn=3&s.ps=10&s.ff=ContentType,or,3,15&s.sort=PublicationDate:asc&s.cmd=reverseSortOrder()

Try It


Set Sort By Relevancy Command

Syntax

The syntax for the set sort by relevancy command is:

setSortByRelevancy()

This command takes no arguments.


Function

The set sort by relevancy command removes the sort order, and then it calls clearAllPaging().

Example - Using the set sort by relevancy command

This set sort by relevancy command removes the sort order,
and it resets paging on the facet fields and page number:

  s.pn=3&s.ps=10&s.ff=ContentType,or,3,15&s.sort=PublicationDate:desc&s.cmd=setSortByRelevancy()

Try It


Set Sort Command

Syntax

The syntax for the set sort command is:

setSort(<fieldName>:<sortOrder>[, <fieldName>:<sortOrder>]*)

There are no defaults for the setSort command.


Function

The set sort command sets the sort order for the results, and then it calls clearAllPaging().

Example - Using the set sort command

  This set sort command sets the sort order to author ascending,
  and removes the sort order of date descending,
  and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.sort=PublicationDate:desc&s.cmd=setSort(PublicationDate:asc)

Try It


Text Filter Commands

Add Text Filter Command

Syntax

The syntax for the add text filter command is:

addTextFilter(<filterQuery>)

There are no defaults for the addTextFilter command. Lucene escaping applies to this command. Characters that may need to be escaped include: +-&|!(){}[]^"~*?:\. Special characters only need to be escaped if their special meaning was not intended. Regular argument escaping must be applied after Lucene escaping.


Function

The add text filter command adds the text filter, and then it calls clearAllPaging().

Example - Using the add text filter command

This add text filter command adds a new text filter for zoology,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.cmd=addTextFilter(zoology)

Try It


Clear All Text Filters Command

Syntax

The syntax for the clear all text filters command is:

clearAllTextFilters()

This command takes no arguments.


Function

The clear all text filters command removes all text filters from the request, and then it calls clearAllPaging().

Example - Using the clear all text filters command

This clear all text filters command removes text filters, resets paging, and leaves everything else in the query:

  s.pn=3&s.ps=10&s.q=policy&s.fvf=ContentType,Book&s.fq=trade+economy&s.cmd=clearAllTextFilters()

Try It


Remove Text Filter Command

Syntax

The syntax for the remove text filter command is:

removeTextFilter(<filterQuery>)

There are no defaults for the removeTextFilter command.


Function

The remove text filter command removes the text filter, and then it calls clearAllPaging().

Example - Using the remove text filter command

This remove text filter command removes the text filter for zoology,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.fq=zoology&s.cmd=removeTextFilter(zoology)

Try It


Set Text Filter Command

Syntax

The syntax for the set text filter command is:

setTextFilter(<filterQuery>)

There are no defaults for the setTextFilter command. Lucene escaping applies to this command. Characters that may need to be escaped include: +-&|!(){}[]^"~*?:\. Special characters only need to be escaped if their special meaning was not intended. Regular argument escaping must be applied after Lucene escaping.

Function

The set text filter command adds the text filter, replacing any existing text filters, and then it calls clearAllPaging().

Example - Using the set text filter command

This set text filter command adds a new text filter for zoology,
and removes the text filter for anthropology,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.fq=anthropology&s.cmd=setTextFilter(zoology)

Try It


Text Query Commands

Add Text Query Command

Syntax

The syntax for the add text query command is:

addTextQuery(<textQuery>)

There are no defaults for the addTextQuery command. Lucene escaping applies to this command. Characters that may need to be escaped include: +-&|!(){}[]^"~*?:\. Special characters only need to be escaped if their special meaning was not intended. Regular argument escaping must be applied after Lucene escaping.


Function

The add text query command adds the text query, and then it calls clearAllPaging().

Example - Using the add text query command

This add text query command adds a new text query for records with title containing african mammals,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.cmd=addTextQuery(Title\:\(african+mammals\))

Try It


Clear All Text Queries Command

Syntax

The syntax for the clear all text queries command is:

clearAllTextQueries()

This command takes no arguments.


Function

The clear all text queries command removes all text queries from the request, and then it calls clearAllPaging().

Example - Using the clear all text queries command

This clear all text queries command removes text queries, resets paging, and leaves everything else in the query:

  s.pn=3&s.ps=10&s.q=foreign&s.fvf=ContentType,Book&s.fq=trade+economy&s.cmd=clearAllTextQueries()

Try It


Remove Text Query Command

Syntax

The syntax for the remove text query command is:

removeTextQuery(<textQuery>)

There are no defaults for the removeTextQuery command.


Function

The remove text query command removes the text query, and then it calls clearAllPaging().

Example - Using the remove text query command

This remove text query command removes the text query for titles with african mammals,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.q=Title:(african+mammals)&s.cmd=removeTextQuery(Title\:\(african+mammals\))

Try It


Set Text Query Command

Syntax

The syntax for the set text query command is:

setTextQuery(<textQuery>)

There are no defaults for the setTextQuery command. Lucene escaping applies to this command. Characters that may need to be escaped include: +-&|!(){}[]^"~*?:\. Special characters only need to be escaped if their special meaning was not intended. Regular argument escaping must be applied after Lucene escaping.


Function

The set text query command adds the text query, replacing any existing text queries, and then it calls clearAllPaging().

Example - Using the set text query command

This set text query command adds a new text query for records with title containing african mammals,
and removes the text query for polar bears,
and it resets paging on the ContentType facet field and page number:

  s.pn=3&s.ff=ContentType,or,2,15&s.q=polar+bears&s.cmd=setTextQuery(Title\:\(african+mammals\))

Try It