1
votes

I want to export a binary (PPTX) file stored in MarkLogic to my local file system. Is it possible to export a document stored in a URI through MLCP EXPORT?

There are millions of documents stored in the same directory - so MLCP EXPORT with -directory_filter option is of no use. The export operation begins and errored out with "RequestException instantiating ResultItem 141931: Time limit exceeded".

This is my options file

-host
marklogic-dev-server
-port
9014
-username
pk
-password
pk
-directory_filter
/openxml2/
#-query_filter
#doc("/openxml2/doc-uri.pptx")
-output_type
archive
-output_file_path
/Users/pk/marklogic/
-compress
true````
1

1 Answers

1
votes

MLCP by default will export the document in it's native format:

Use the mlcp export command to export documents in their original format as files on the native filesystem or HDFS. For example, you can export an XML document as a text file containing XML, or a binary document as a JPG image.

Use the mlcp export command to export documents in their original format as files on the native filesystem or HDFS. For example, you can export an XML document as a text file containing XML, or a binary document as a JPG image. There are a number of different ways to limit the documents exported by MCLP. You should be able to use -query_filter, -query_options or -document_selector to select the file by itself.

Alternatively, you can add the document to a new collection, and use -collection_filter. This is ok for a small number of documents, but not advisable for a larger set, as adding a collection to a large number of documents can be resource intensive.