afs:tag Qualifying Parameter - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.9
Category
Reference Guide

Role

afs:tag can be used to tag replies with the result of a boolean predicate. The parameter value must be of type "id":predicate where "id" is a user-specified identifier and predicate is a boolean predicate.

afs:tag has a behavior similar to afs:filter except that afs:filter discards replies where the predicate is evaluated to false, whereas afs:tag appends information to each reply. An afs:tag child element is added to each afs:reply. The afs:tag element has two attributes:

  • id stores the user specified identifier.
  • value stores the result of the predicate evaluation.

afs:tag also automatically creates a facet in the reply feed containing a summary of the tag distribution; the facet is determined by the combination of the producer attribute with the "tag" value, and the id attribute with the user specific identifier as a value.

Status

Optional. It may be used several times.

Example

afs:tag="cheap":price<50 dynamically appends a "cheap" facet for all the documents of the reply. This facet can take two values: true or false. The value is true if the document has the price facet and price<50 (price is lower than 50). Otherwise, the value is false.

...
<afs:facet layout="tree" type="bool" producer="tag" id="id">
<afs:node key="true" items="0"/>
<afs:node key="false" items="9"/>
</afs:facet>
...
<afs:reply>
...
<afs:tag id="id" value="false"/>
</afs:reply>
<afs:reply>
...
<afs:tag id="id" value="true"/>
</afs:reply>
...