...
You can get configure how you will get the metadata out of the text or metadata by setting script flags. For example, you can receive the metadata as _doc, _metadata, or as full text.
Also, when iterating over a JSON array each item in the array is passed into the ScriptEngine and is made accessible via an object named: _iterator.
Examples:
_doc.metadata
Code Block |
---|
"city": "$SCRIPT( return _doc.metadata.location[0].citystateprovince.city; )", |
_metadata
Code Block |
---|
"contentMetadata": [ {
"fieldName": "email_meta",
"script": "var x=_metadata._FILE_METADATA_[0].metadata;x;",
"scriptlang": "javascript",
"flags": "m" |
iterator
Code Block |
---|
var make = _iterator.make;
var model = _iterator.model;
var year = _iterator.year;
|
For more information about using javascript to get metadata and for detailed examples and descriptions, see Content metadata, Manual text transformation.
...
You can use javascript to create entities and associations by calling the metadata using the $SCRIPT and $FUNC scripting conventions.For example, When document metadata iterates over a JSON array each item in the array is passed into the ScriptEngine and is made accessible via an object named: _iterator.
For more information about using javascript to create entities and associations, see Manual entities, Manual association of entities.
...