MLCP 使用文档选择器导出选定文档
MLCP Export Selected Documents using document selector
我想使用基于 xpath 匹配的 MLCP 从 MarkLogic 导出选定的文档。
mlcp export -host localhost -port 8061 -username admin -password admin -mode local -output_file_path shiv -database shiv -output_type archive -document_selector '/companymetadata/companyCode=shiv'
这里我想导出所有符合 /companymetadata/companyCode=shiv
这个条件的文档,但是我收到以下错误
18/06/06 16:50:57 INFO contentpump.ContentPump: Job name: local_712261411_1
18/06/06 16:50:57 ERROR mapreduce.MarkLogicInputFormat: com.marklogic.xcc.exceptions.XQueryException: XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected QName_, expecting Rpar_
[Session: user=admin, cb=shiv [ContentSource: user=admin, cb=shiv [provider: address=localhost/127.0.0.1:8061, pool=1/64]]]
[Client: XCC/9.0-3, Server: XDBC/8.0-5.5]
in /eval, on line 4
expr:
18/06/06 16:50:57 ERROR mapreduce.MarkLogicInputFormat: Query: xquery version "1.0-ml";
import module namespace hadoop = "http://marklogic.com/xdmp/hadoop" at "/MarkLogic/hadoop.xqy";
xdmp:host-name(xdmp:host()),
hadoop:get-splits('', ''collection()/companymetadata/companyCode=shiv'','()'),
"REDACT",0,let $repf := fn:function-lookup(xs:QName('hadoop:get-splits-with-replica'),0)
return if (exists($repf)) then $repf() else ()
,0,"AUDIT",
let $f :=
fn:function-lookup(xs:QName('xdmp:group-get-audit-event-type-enabled'), 2)
return
if (not(exists($f)))
then ()
else
let $group-id := xdmp:group()
let $enabled-event := $f($group-id,("mlcp-copy-export-start", "mlcp-copy-export-finish"))
let $mlcp-start-enabled :=
if ($enabled-event[1]) then "mlcp-copy-export-start" else ()
let $mlcp-finish-enabled :=
if ($enabled-event[2]) then "mlcp-copy-export-finish" else ()
return ($mlcp-start-enabled, $mlcp-finish-enabled)
18/06/06 16:50:57 ERROR contentpump.LocalJobRunner: Error getting input splits:
18/06/06 16:50:57 ERROR contentpump.LocalJobRunner: com.marklogic.xcc.exceptions.XQueryException: XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected QName_, expecting Rpar_
[Session: user=admin, cb=shiv [ContentSource: user=admin, cb=shiv [provider: address=localhost/127.0.0.1:8061, pool=1/64]]]
[Client: XCC/9.0-3, Server: XDBC/8.0-5.5]
in /eval, on line 4
expr:
请帮我解决上面的错误,同时指导我在 MLCP 中使用 xpath。
在 http://docs.marklogic.com/guide/mlcp/export#id_89322 有一个使用 xpath 的例子,所以它看起来是可行的。我通常会建议您处理您的 xpath,以便它首先在查询控制台中工作,然后在 mlcp 中尝试。也许你想要
/companymetadata[companyCode = 'shiv']
我想使用基于 xpath 匹配的 MLCP 从 MarkLogic 导出选定的文档。
mlcp export -host localhost -port 8061 -username admin -password admin -mode local -output_file_path shiv -database shiv -output_type archive -document_selector '/companymetadata/companyCode=shiv'
这里我想导出所有符合 /companymetadata/companyCode=shiv
这个条件的文档,但是我收到以下错误
18/06/06 16:50:57 INFO contentpump.ContentPump: Job name: local_712261411_1
18/06/06 16:50:57 ERROR mapreduce.MarkLogicInputFormat: com.marklogic.xcc.exceptions.XQueryException: XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected QName_, expecting Rpar_
[Session: user=admin, cb=shiv [ContentSource: user=admin, cb=shiv [provider: address=localhost/127.0.0.1:8061, pool=1/64]]]
[Client: XCC/9.0-3, Server: XDBC/8.0-5.5]
in /eval, on line 4
expr:
18/06/06 16:50:57 ERROR mapreduce.MarkLogicInputFormat: Query: xquery version "1.0-ml";
import module namespace hadoop = "http://marklogic.com/xdmp/hadoop" at "/MarkLogic/hadoop.xqy";
xdmp:host-name(xdmp:host()),
hadoop:get-splits('', ''collection()/companymetadata/companyCode=shiv'','()'),
"REDACT",0,let $repf := fn:function-lookup(xs:QName('hadoop:get-splits-with-replica'),0)
return if (exists($repf)) then $repf() else ()
,0,"AUDIT",
let $f :=
fn:function-lookup(xs:QName('xdmp:group-get-audit-event-type-enabled'), 2)
return
if (not(exists($f)))
then ()
else
let $group-id := xdmp:group()
let $enabled-event := $f($group-id,("mlcp-copy-export-start", "mlcp-copy-export-finish"))
let $mlcp-start-enabled :=
if ($enabled-event[1]) then "mlcp-copy-export-start" else ()
let $mlcp-finish-enabled :=
if ($enabled-event[2]) then "mlcp-copy-export-finish" else ()
return ($mlcp-start-enabled, $mlcp-finish-enabled)
18/06/06 16:50:57 ERROR contentpump.LocalJobRunner: Error getting input splits:
18/06/06 16:50:57 ERROR contentpump.LocalJobRunner: com.marklogic.xcc.exceptions.XQueryException: XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected QName_, expecting Rpar_
[Session: user=admin, cb=shiv [ContentSource: user=admin, cb=shiv [provider: address=localhost/127.0.0.1:8061, pool=1/64]]]
[Client: XCC/9.0-3, Server: XDBC/8.0-5.5]
in /eval, on line 4
expr:
请帮我解决上面的错误,同时指导我在 MLCP 中使用 xpath。
在 http://docs.marklogic.com/guide/mlcp/export#id_89322 有一个使用 xpath 的例子,所以它看起来是可行的。我通常会建议您处理您的 xpath,以便它首先在查询控制台中工作,然后在 mlcp 中尝试。也许你想要
/companymetadata[companyCode = 'shiv']