VOID expressions return no value but are used to
perform other work. The
VOID IMPORT_PROP expression imports a property value from
a specified file.
Typically, files containing property values were created using the
complementary expression
VOID EXPORT_PROP. Another typical use of
IMPORT_PROP is to read a document body created by
VOID RETRIEVE_URL. (This is useful for HTML
pre-processing with a spider.)
The property to import can be specified in either one of the following ways:
Use the
PROP_NAMEexpression node to specify the name of the property to import. The current value of the property is the file name. The current value is replaced with the value read from the file. All properties with a given name are affected in this mode.Use a
STRINGexpression to generate the name of the file to import. Typically, the file name is generated using aSTRING DIGESTof the Endeca.Identifier property. If this expression is present, then one property can be imported per record. This expression generates a different file name for each record. Existing values are untouched.
The following expression nodes modify
IMPORT_PROP. Several of these nodes are the same as
those used to identify the property during export in
EXPORT_PROP.
URL- Specifies the URL that files are imported from. This value may be either an absolute path or a path relative to the location ofPipeline.epx.PREFIX- Specifies any prefix used in the file name to remove. This value often corresponds to the value ofPREFIXin theVOID EXPORT_PROPexpression.REMOVE_FILES- Specifies whether to delete files, after importing their property values. When set toTRUE, the files are deleted. The default value isFALSE.ENCODING- Specifies the encoding that should be used during import. If desired, this encoding may be overriden byENCODING_PROP.ENCODING_PROP- Specifies the name of the property containing the encoding. TheRETRIEVE_URLexpression creates this property with a default property name ofEndeca.Document.Encoding.ENCODING_ID_BYTES- Specifies the number of bytes used to identify the encoding. This value defaults to its maximum of 1 MB and can be reduced if necessary to optimize performance.
See the
EXPRESSION element for DTD and attribute information.
This example imports properties Prop1 and Prop2 from the props directory. After importing, the expression deletes the files.
<EXPRESSION TYPE="VOID" NAME="IMPORT_PROP"> <EXPRNODE NAME="PROP_NAME" VALUE="Prop1"/> <EXPRNODE NAME="PROP_NAME" VALUE="Prop2"/> <EXPRNODE NAME="URL" VALUE="props"/> <EXPRNODE NAME="PREFIX" VALUE="out."/> <EXPRNODE NAME="REMOVE_FILES" VALUE="TRUE"/> </EXPRESSION>

