Hi Danny,
As to your first question, I don’t know so someone else will have to chime in.
But, so I understand better, are you thinking of doing something like this
(using the XPath expression from my previous example)?
/*:mets[property::prop:last-modified[.>(fn:current-dateTime()-xs:dayTimeDuration("P1D"))]]
(FWIW, the above worked, but, anecdotally, and even though both tests took 2
seconds according to the MLCP output, it did appear to be a tad slower than
explicitly declaring yesterday’s date in the XPath expression; I am using a
small dataset after all.)
-document_selector only accepts an XPath expression. It’s used as the
cts:search expression.
All the best,
Kevin
From: Danny Sinang <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Friday, January 23, 2015 at 11:21 AM
To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] Can MLCP use an input query ?
Hi Kevin,
Thanks for the sample MLCP call.
Performance-wise though, won't the XPATH expression perform real slow (compared
to my XQSync INPUT_QUERY), especially if I have a dynamically computed
predicate (like when you compute for one day ago) ?
Will -document_selector accept FLWOR statements ?
Regards,
Danny
On Fri, Jan 23, 2015 at 11:58 AM, Kevin Ford
<[email protected]<mailto:[email protected]>> wrote:
Hi Danny,
Try using the –document_selector option. It seemed to do the trick in a small
test based on your use case and sample xquery. You’ll have to figure out the
$date-one-day-ago before invoking it.
Example:
mlcp.sh export -host localhost -port 7003 -username kefo -password admin -mode
local -output_file_path export/ -document_selector
'/*:mets[property::prop:last-modified[.>xs:dateTime("2015-01-23T09:55:22-06:00")]]’
HTH,
Kevin
From: Danny Sinang <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Thursday, January 22, 2015 at 9:26 AM
To: general
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] Can MLCP use an input query ?
We're considering using MLCP to replace XQSync and it seems MLCP is up to the
job except that it doesn't accept an INPUT_QUERY parameter.
In XQSync, we use the following query to fetch all docs whose last-modified
property is older than 1 day.
INPUT_QUERY=declare variable $date-one-day-ago := fn:current-dateTime() -
xs:dayTimeDuration("P1D"); for $d in cts:search(/, cts:and-query( (
cts:not-query(cts:directory-query('/events/', 'infinity')),
cts:properties-query(cts:element-range-query(xs:QName("prop:last-modified"),
">", $date-one-day-ago)) ) ) ) let $uri := xdmp:node-uri($d) order by $uri
return $uri
But in MLCP, it appears the only way to selectively choose which docs to copy
would be by copying entire collections, directories, or by specifying an XPATH
expressions - none of which allow me to use a query.
Is there a workaround for this ?
Regards,
Danny
_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general