Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: ltollesonThe emit * takes the fields that are part of the input (meta-data) and does not take into account that you have overridden the value of DOC unless you specifically tell the emit.
Here are a couple of examples of ways to override the value of the field DOC.
EXAMPLE 1 - Create a variable with the same name as the input field
DOC = DOC.str()
emit *
override emit DOC as DOC
EXAMPLE 2 - Create a variable with a different name from the input field.
I prefer to use a variable name that is different from the field name. This keeps me from confusing the field name from a variable name
tempDOC = DOC.str()
emit *
override emit tempDOC as DOC
EXAMPLE 3
Instead of changing the fields type in a FILTER node, you can simple use DOC.str() in the key of the X-REF node. This only changes the type for use by the node. It does not change the type in the meta-data. It also reduces the number of required nodes.