- any HTTP or HTTPS request:
<http-protocol>://<path> - a Solr request:
solr://COLLECTION_NAME/… - a Fusion service request:
extservice://SERVICE_NAME/<path>
<doc.docField> is replaced with the value of the field named docField for the document being processed.
Several types of responses are also supported:
- POJOs
- JSON
- XML
Call Parameters
In the Fusion UI, select include to display the fields for the call parameters (params in the REST API). Parameters are specified as key-value pairs:
The
uri, queryParams, headers, and entity values support template expressions, such as <doc.fieldName> for a field in the current document or <ctx.key> for a pipeline context value.
A multi-valued field returns all of its values, concatenated with no separator.
To use only the first value, use <first(doc.fieldName)>.
If a referenced field is missing from the document, the expression evaluates to an empty string.
If your stage configuration uses ${fieldName}, migrate it to template expressions:
- In the
uri,queryParams,headers, andentityvalues, replace each${fieldName}with<first(doc.fieldName)>. For example, change${url}to<first(doc.url)>.<first(...)>keeps the legacy behavior of using only the first value of a multi-valued field. For single-valued fields,<doc.fieldName>returns the same result. Don’t use${doc.fieldName}. That syntax looks for a field literally nameddoc.fieldName, which is treated as a missing field. - Replace every
${...}reference in a value at the same time. If a value contains a${...}reference, the stage doesn’t evaluate template expressions in that value. - Check how the stage should handle missing fields.
With
${fieldName}, a missing field inuriskips the call, a missing field inqueryParamsorheadersomits that entry, and a missing field inentitybecomes an empty string. With template expressions, a missing field becomes an empty string and the call still runs. To skip documents that don’t have the field, set the stage Condition to an expression such asdoc.hasField("url"). - Save the stage and confirm that the deprecation warning no longer appears in the logs.
queryParams could be constructed as follows:
<doc.prodName> is replaced with the value of the prodName field in the current document. If the current document contains “iPhone 6” as the value of ‘prodName’, the resulting query in this example will be a fielded search q=a_txt:iPhone 6.
Mapping Rules
The mappingRules property takes the following, specified as key-value pairs:- path. an XPath expression. It is assumed that this expression always returns a node list, and each returned node is processed separately and its converted value is added to a multi-valued field.
- target. the name of the target field in the current document where the value(s) will be stored.
- append. if true, values extracted from the RPC response will be appended to the target multi-valued field. When this is false, the default, existing values in the target field will be discarded and replaced with the values from the RPC response.
- xml. if true, the extracted DOM nodes will be separately serialized to XML and the resulting XML-formatted text will be added to the target field. When this is false, the default, the extracted DOM nodes will be flattened and converted to a list of fields. Field names in this case will correspond to XML element names, dot-separated, and element attributes will be represented as fields with @attributeName suffix.