People often ask me about integrating with MarkLogic. Had an interesting one today from a partner asking for code for re-usable query terms. In this post I describe what I’ve created with links to the code…
I’ve created a Github repository here I intend to add information to with little gems of code samples:-
These samples are linked to a sandbox REST server in MarkLogic. There are several provided:-
CreateCustomSearchOptions – Defines and persists to the server a named set of Search Options. These can be defined by an admin user (typically), or as search defaults by any user, and referred to in subsequent searches
CustomSearchOptions – Uses the search options along with a structured search (awesome API in V6!) to find all animals with a kingdom value of ‘bird’
GetDocumentElements – Uses XPath to extract specific nodes from a document on the server (saves a lot of DOM/SAX work)
GetDocumentProperties – Fetches a document’s properties document (also XML) and lists all properties. Also shows best practice in how to load a known, named property.
If you find these useful please let me know!