Query Expansion Parameter

Syntax

The syntax for the query expansion parameter is:

s.exp=<boolean>

A query string may contain only one s.exp parameter. The use of this parameter also requires the use of the s.l parameter. The default value of this parameter is false, but should be set to true for all queries. When the user wants to turn this feature off, the parameter would then be set to false.


Function

The query expansion parameter toggles the synonym mapping of user queries on and off.

Example - Using the s.exp parameter

This query string causes the user's query to be expanded with matching synonyms in the search results:
 
  s.q=heart+attack&s.exp=true&s.l=en

Response

{
   "queryExpansion" : {
      "isExpanded" : "true",
      "searchTerms" : [ "search", "term", "list" ]
   }
}


Try It