I have a multi-terabyte Production database (MarkLogic 9.0-8, RedHat) that I need to add 2 new element range indexes to. Before I can execute the change, I need to get an estimate of the number of documents that will be impacted by the re-index to ensure my maintenance window is sufficient to avoid performance impacts. Will the following code provide me with what I am needing?
xquery version "1.0-ml";
xdmp:estimate(cts:search(fn:doc(), cts:word-query("someTimestamp")));
xdmp:estimate(cts:search(fn:doc(), cts:word-query("someString")));
Instead of a word-query I'd rather count the fragments containing the elements of your two new element range indexes using a element-query.
xdmp:estimate(
cts:search(fn:doc(),
cts:element-query(xs:QName("your-index-element"), (cts:and-query(())))
)
)
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