Tokens

Overview

Tokens are any query parameters that are not Summon-specific query parameters. Tokens can be used to replace all, or part, of Summon query parameter values or command arguments. One purpose of tokens is to make it simple to write query proxies. Query proxies can allow end-user-facing apps to have arbitrary query parameters, which can make URLs look neater in some instances. To specify a token to be replaced, use the notation ${tokenName} in any Summon query parameter value, or command argument.

Example - A query proxy for an author/title book search page

Query string as it looks on the proxy page:

  author=Jonathan+Swift&title=Gulliver's+Travels

Query string in Summon format:

  s.cmd=setSearchTerm(Author,Jonathan+Swift)+addSearchTerm(Title,Gulliver's+Travels)+addFacetValueFilters(ContentType,"Book")

Proxy simply appends the following string to the original query string:

  s.cmd=setTextQuery(Author\:\(${author}\))+addTextQuery(Title\:\(${title}\))+addFacetValueFilter(ContentType,Book)

Summon receives the following query:

  author=Jonathan+Swift&title=Gulliver's+Travels&s.cmd=setTextQuery(Author\:\(${author}\))+addTextQuery(Title\:\(${title}\))+addFacetValueFilters(ContentType,Book)

Try It