You add a Modifying Script manipulator to a data source on the Edit page of CAS Console. The manipulator runs an inline BeanShell script that modifies Endeca records.
Before you begin, you must enable the script. See Enabling script manipulators for more information.
The example script, provided in the Script Source field, adds a property to each record being crawled and then logs that addition. You can modify the inline script as appropriate for your acquisition.
The manipulator has access to the methods in the
Record
and
PropertyValue
classes (i.e.
com.endeca.itl.record.Record
and
com.endeca.itl.record.PropertyValue
). For details
about the methods in these classes, see the CAS Record Store API Reference
(Javadoc) installed in
CAS\<version>\doc\recordstore-javadoc
. The
manipulator also has access to the methods in the
Logger
class in
org.slf4j.Logger
. Other classes may be imported as
necessary.
To add a Modifying Script manipulator to a data source:
On the Data Sources page, click a data source name to access its acquisition steps.
The Manipulator Settings page displays.
In Manipulator Name, specify a unique name for the manipulator to distinguish it from other manipulators in the data source.
You can specify a name with alphanumeric characters, underscores, dashes, and periods. All other characters are invalid for a name.
In Script Source, modify the inline BeanShell script as appropriate for your data source.
The manipulator displays on the Acquisition Steps list.