Tuesday, 16 February 2010

Marklogic: Notes on Collations

This is going to be an evolving post. In the meantime, using cq or DQ, something like this will return the uri of the default collation:

Some other useful MarkLogic encoding tools include url-encode:

And url-decode:

Both techniques could be used in a situation where you're sending characters that would require encoding/decoding using xdmp:get-request-field.

codepoints-to-string will return an xs:string from a series of unicode codepoints (as an example taken from the API docs):

Friday, 12 February 2010

MarkLogic: Creating a Merge Blackout Specification

Brief note on the creation of a recurring merge blackout spec for MarkLogic 4.1-4

An important note is that just using xs:time will stick with GMT (Zulu) time. This means the blackout will be an hour out-of-step. As we want to observe BST:

Can be tested using cq or - if you prefer: dq http://sourceforge.net/projects/mldq/ and should return the merge specification as an xml node. Once you have that, you can do something like this:

After that, go to your MarkLogic admin interface > Databases > dbname > Merge Policy and you should see the new changes.

On a final note about timezones, you can always extract the timezone offset from the system's current dateTime by doing this: