The IngestTest
action instructs CFS to ingest data for testing purposes. You can use this action to perform tests on a small volume of data and verify the output from the import process.
IngestTest
is similar to the Ingest
action, but has the following differences which make it suitable for testing:
IngestTest
is a synchronous action, and the document data is returned in the ACI response.updates
and removes
action parameters like you can with the Ingest
action).Any writer tasks that have been configured (IdxWriter
, XmlWriter
, JsonWriter
, CsvWriter
, SqlWriter
) are disabled.
is_test
is set to true
. You can use this variable in your Lua scripts to prevent certain parts of your scripts from running when you use the IngestTest
action./action=IngestTest [&config=<base64_encoded_config>] &adds=<adds_xml>
The IngestTest
action takes the following parameters:
Parameter Name | Description |
---|---|
config
|
An optional base64 encoded configuration file. If this parameter is set, then the HPE CFS configuration file is ignored and the encoded configuration options are used instead. |
adds | An XML string containing the documents to be ingested by CFS. You can specify any combination of document content, metadata, and source files. HPE recommends that you restrict use of the IngestTest action to small numbers of documents. |
The following command is an example IngestTest
action. The config
action parameter contains a base64 encoded configuration that runs a single Lua post task (script.lua
):
/action=IngestTest &config=W0ltcG9ydFRhc2tzXQpQb3N0MD1MdWE6c2NyaXB0Lmx1YQ== &adds=<adds><add><document><reference>MyRef</reference> <xmlmetadata><type>file</type></xmlmetadata></document> <source filename='test.txt' lifetime='permanent'/></add></adds>
You must URL encode the action before you can send it to CFS.
The example action above runs a single Lua post-import task (script.lua
). If you use the following script:
function handler( document ) document:setFieldValue("LUA_CALLED", "true") return true; end
...the response to the action is:
<autnresponse xmlns:autn="http://schemas.autonomy.com/aci/"> <action>INGESTTEST</action> <response>SUCCESS</response> <responsedata> <documents> <document> <reference>MyRef</reference> <xmlmetadata> <Content-Type>text/plain</Content-Type> <DocumentAttributes>0</DocumentAttributes> <DocumentClass>1</DocumentClass> <DocumentSize>16</DocumentSize> <DocumentType>2</DocumentType> <DRECHILDCOUNT>0</DRECHILDCOUNT> <DREFILENAME>test.txt</DREFILENAME> <DREORIGINALNAME>test.txt</DREORIGINALNAME> <DREROOTFAMILYREFERENCE>MyRef</DREROOTFAMILYREFERENCE> <DREROOTFAMILYREFERENCE_ID>d4811c706f1b17ed6c13a5c2da1abf0d</DREROOTFAMILYREFERENCE_ID> <FAMILYSORT>d4811c706f1b17ed6c13a5c2da1abf0d-0</FAMILYSORT> <FileAccessedTime>1384861016</FileAccessedTime> <FileCreatedTime>1384861016</FileCreatedTime> <FileImportedTime>1384861319</FileImportedTime> <FileModifiedTime>1384861040</FileModifiedTime> <ImportMagicExtension>txt</ImportMagicExtension> <ImportOriginalEncoding>ASCII</ImportOriginalEncoding> <ImportVersion>2</ImportVersion> <InfoFlag>0</InfoFlag> <ISFILEFILTERABLE>1</ISFILEFILTERABLE> <KeyviewVersion>10200</KeyviewVersion> <LUA_CALLED>true</LUA_CALLED> <type>file</type> <UUID>d4811c706f1b17ed6c13a5c2da1abf0d</UUID> <VersionNumber>0</VersionNumber> </xmlmetadata> <pages content="test.txt content"/> </document> </documents> <logging> <log time="2013-11-19T11:41:59" level="30" message="Starting Import Service"/> <log time="2013-11-19T11:41:59" level="30" message="ImportService configured to use 1 threads"/> <log time="2013-11-19T11:41:59" level="30" message="Temporary files will be stored in: temp"/> <log time="2013-11-19T11:41:59" level="30" message="Importing [MyRef]"/> <log time="2013-11-19T11:41:59" level="30" message="Detected encoding as ASCII [MyRef]"/> </logging> </responsedata> </autnresponse>
If the action specifies multiple documents, or processes a container file, the response will contain multiple <document>
elements.
|