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