I am using MLCP(Marklogic Content Pump) for copying content from one database to another. In this i'm using -query_filter option and its value is a cts:query in XML serialized format of a set of cts:element-range-query wrapped in cts:and-query :
<cts:and-query xmlns:cts="http://marklogic.com/cts">
<cts:element-range-query operator=">">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2000-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
<cts:element-range-query operator="<">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2016-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
</cts:and-query>
Now, the above query returns valid result when executed on ML Qconsole, but when passed in -query_filter option of MLCP, it gives the error saying 'Invalid attribute value character '<' .
The version of Marklogic and MLCP is 8.0-5.
On further digging into this I observed that the issue is only when the operator value is less than '<'
Note: I have configured a valid range-index on the database for the element "released-on".
MarkLogic encourages the use of options files when using a cts query serialized as XML, because special characters can be interpreted by the underlying OS on the command line.
My first guess would be to try creating a file, say, options.txt
with the content:
--query_filter
<cts:and-query xmlns:cts="http://marklogic.com/cts">
<cts:element-range-query operator=">">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2000-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
<cts:element-range-query operator="<">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2016-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
</cts:and-query>
(You may have to make all the XML fit on the same line of that file though)
and then invoke MLCP with
mlcp.sh -options_file options.txt ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With