action Parameter - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

The action parameter of a rule allows to define which action to perform on the query when it has been matched.

The following actions are available:

  • Add or remove a parameter from the query
  • Keep or remove matched query words
  • Add keywords after match

The type attribute is used to select the kind of action object using the following values:

  • addParameter,
  • removeParameter,
  • keepMatch,
  • removeMatch,
  • addKeywordAfterMatch.

Actions of type addParameter and removeParameter include a param attribute containing the parameter to add or remove, and a value attribute containing the value of the parameter.

Examples

{
"type": "addParameter",
"param": "afs:filter",
"value": "brand=\"$1\""
}

{
"type": "removeParameter",
"param": "afs:filter",
"value": "filter=true"
},

Actions of type keepMatch and removeMatch do not include any attribute.

Examples

{
"type": "removeMatch"
},

{
"type": "keepMatch"
}

An action of type addKeywordsAfterMatch includes a keyword attribute containing the keywords to add to the query.

Example

{
"type": "addKeywordsAfterMatch",
"keywords": "-keyword"
},