marklogic corb run is generating one file for each uri

23 Views Asked by At

I am trying extract report from Marklogic but for each uri I am getting one document.

java -cp marklogic-xcc-10.0.10.jar:marklogic-corb-2.5.6.jar -DXCC-CONNECTION-URI=xcc://user:pw@host:5008 -DPROCESS-MODULE=/corb/transform-docs.xqy -DTHREAD-COUNT=2 -DURIS-MODULE=/corb/get-uris.xqy -DPROCESS-TASK=com.marklogic.developer.corb.ExportToFileTask -DEXPORT-FILE-NAME=/reports/testfile.csv com.marklogic.developer.corb.Manager

MarkLogic version - 10.x

In the process module I am just returning string value.

I want to generate one output file only, which should have all of the returned uris.

1

There are 1 best solutions below

0
Mads Hansen On

If you want to write all of the output to a single doc, then you should use the ExportBatchToFileTask instead of ExportToFileTask.

The description listed in the PROCESS-TASK

  • com.marklogic.developer.corb.ExportBatchToFileTask Generates a single file, typically used for reports. Writes the data returned by the PROCESS-MODULE to a single file specified by EXPORT-FILE-NAME. All returned values from entire CoRB will be streamed into the single file.

  • com.marklogic.developer.corb.ExportToFileTask Generates multiple files. Saves the documents returned by each invocation of PROCESS-MODULE to a separate local file within EXPORT-FILE-DIR where the file name for each document will be the based on the URI.

So, configure the ExportBatchToFileTask:

PROCESS-TASK=com.marklogic.developer.corb.ExportBatchToFileTask

instead of ExportToFileTask.