我正在嘗試使用 mlcp.bat 使用 URI 提取以下檔案:/category/[2014] xxx.xml
這是與引數一起使用的 mlcp 命令:
mlcp.bat export -host localhost -port 8000 -username admin -password admin -mode local -database database-content -output_file_path C:/mlcp/bin/xmlexport -document_selector '/CaseReport/Metadata[id="16594-SSP-M"]' -indented true
執行上述命令后,沒有提取任何檔案 :( 下面是 mlcp 輸出:
INFO contentpump.ContentPump: Job name: local_320491878_1
INFO mapreduce.MarkLogicInputFormat: Fetched 1 forest splits.
INFO mapreduce.MarkLogicInputFormat: Made 2 split(s).
INFO contentpump.LocalJobRunner: completed 0%
INFO contentpump.LocalJobRunner: com.marklogic.mapreduce.MarkLogicCounter:
INFO contentpump.LocalJobRunner: ESTIMATED_INPUT_RECORDS: 35722
INFO contentpump.LocalJobRunner: INPUT_RECORDS: 0
INFO contentpump.LocalJobRunner: OUTPUT_RECORDS: 0
INFO contentpump.LocalJobRunner: Total execution time: 26 sec
== 更新 == 這是帶有 uri /category/[2014] xxx.xml 的 XML 檔案內容的前 3 行
<?xml version="1.0" encoding="UTF-8"?>
<CaseReport xlink:type="extended" category="unreported" neutralcitation="[2014] xxx" year="" volume="" series="" pageno="" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:exslt="http://exslt.org/common">
<Metadata id="16594-SSP-M">
uj5u.com熱心網友回復:
該-document_selector選項要求您指定將從資料庫中選擇檔案的 XPath。您正在提供檔案的 URI。
相反,使用-query_filter并指定一個使用cts:document-query()該 URI 進行選擇的查詢:cts:document-query("/category/[2014] xxx.xml")
這是該查詢序列化為 XML的示例:
-query_filter
<cts:document-query xmlns:cts="http://marklogic.com/cts"><cts:uri>/category/[2014] xxx.xml</cts:uri></cts:document-query>
這是該查詢序列化為 JSON的示例:
-query_filter
{"documentQuery":{"uris":["/category/[2014] xxx.xml"]}}
為了避免命令列上的查詢出現引號和轉義問題,最好將此選項放入選項檔案中,然后將該-option_file選項與檔案路徑一起使用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/525017.html
