Before you upgrade to 5.0-1
November 03, 2011 at 08:47 AM | categories: Mark Logic | View CommentsAs usual, back up everything. I haven't seen any data loss myself, but it is your data so be careful.
If you have made any changes to Docs (port 8000) or App Services (8002), the app-services portion of the upgrade won't happen (but the rest of the server will be fine). If you want to use the new monitoring services, you want that part of the upgrade to happen.
The fix is to revert your changes to ports 8000 and 8002. If you have repurposed either port for cq, you may want to go into cq and export all any *local* sessions before changing anything. Local sessions in cq are tied to local browser storage, which is tied to host and port, so you will lose access to them if you change the cq port. Not many folks seem to use cq's local sessions, but I thought I'd mention it. Whether you use cq on those ports or not, make sure port 8000 has root
Docs/ and 8002 has root Apps/ or Apps/appbuilder/ - you can see these checks in Admin/lib/upgrade.xqy, function check-prereqs-50.
If
upgrade.xqy decides not to upgrade your App Services configuration, it will log a message "Skipping appservices upgrades, prerequisites not met." at level "error". The rest of the server will function correctly, but you won't get the appservices part of 5.0.Rebalancing for CoRB
November 01, 2011 at 08:50 PM | categories: XQuery, Mark Logic | View CommentsMarkLogic 5.0 - First Look
November 01, 2011 at 12:24 PM | categories: XQuery, Mark Logic | View CommentsThis is also a good time to double-check your free disk space, since reindexing uses extra disk space. Some of that space won't be released when reindexing finishes, either. For example, one of my forests looked like this:
You can purge those deleted fragments by forcing a merge of the forest, or of the entire database. After doing this, my forest used less disk space.
This new release is stricter about unquoted attributes. With previous releases this would generally work, even though the XQuery 1.0 Recommendation requires quoted attribute values:
<test a={xdmp:random()}/>
Now it throws an
XDMP-UNEXPECTED error. Quote the attribute value correctly, and the problem is fixed.
<test a="{xdmp:random()}"/>
I'm looking forward to learning more about the 5.0 release, but so far it looks good.
Yet another search parser - XQYSP
October 24, 2011 at 01:19 PM | categories: XQuery, Mark Logic | View CommentsXQYSP takes a slightly different approach than the Search API or the older lib-parser.xqy, both of which returned cts:query items. Instead, XQYSP returns an abstract syntax tree (AST) as XML. It is up to you, the caller, to transform that AST into a cts:query. That is a little more work for you, but adds a lot of flexibility at the same time. Most of the tasks that used to go into lib-parser-custom.xqy can now be implemented without changing the parser itself. To make it easier to get started, though, I have provided sample code to generate a query from an AST. I hope it is useful.
XQUT - Unit Testing in Pure XQuery
September 13, 2011 at 04:06 PM | categories: XQuery, Mark Logic | View CommentsI was working on a couple of pure XQuery projects that needed unit testing. While I could have integrated with JUnit or another existing framework, I really wanted something simple that I could run directly from cq. Hence XQUT.
XQUT will usually be invoked like this:
The cq app server should point to the code you are testing,
so that your test suite can import libraries. The eval root is
different: it is the location of the XQUT code, so that you only need
one copy of XQUT. The external variable SUITE is an XML
test suite. A simple test suite might look like this:
The XML is fairly simple. Under the root suite
element we have one or more unit elements, each
representing a test. The test XQuery can be defined as the lexical
value of the element, or as its expr child. The result
can be defined by a result attribute or element.
For more sophisticated tests, you can
add xsi:type attributes and sequences
of result elements. You can also use an
optional environment element to import libraries, define
variables, and define namespace prefixes. If you
add setup elements, these will be evaluated before any
tests. The test
suite for XQUT itself contains more examples.




