marklogic

Marklogic query based on values of multiple attributes of the same element

倾然丶 夕夏残阳落幕 提交于 2019-12-23 12:14:00
问题 I have the following xmls: sample1.xml <root> <subjectInfo> <subject id="001"/> <subject id="002" role="cross"/> </subjectInfo> </root> sample2.xml <root> <subjectInfo> <subject id="002"/> <subject id="001" role="cross"/> </subjectInfo> </root> I am searching for the documents where value of id attribute of subject is "001" but role (if it's there) of the same subject element is not "cross".So, In my example the result should contain sample1.xml and not sample2.xml I thought the following

How to query a graph of documents of different types at once in Marklogic?

独自空忆成欢 提交于 2019-12-23 04:52:56
问题 Background I'm using NoSql database supporting graphs for the first time. It is a huge medical application handling thousands of patients. It is a greenfield project and we as a team are struggling with our persistence layer. We don't know how relationships should be represented and if we should use Triples to handle queries involving huge amount of data. We are using Java API . Data structure Imagine that there are 3 types of JSON documents in our Marklogic database: Patient, Event, File

MarkLogic 8 - sort-order by path-index

情到浓时终转凉″ 提交于 2019-12-22 05:28:13
问题 Is sort-order by path-index already supported in ML 8? I want to achieve similar to the below: <options xmlns="http://marklogic.com/appservices/search"> <sort-order collation="http://marklogic.com/collation/en/S1/EO/CU/MO" type="xs:string" direction="ascending"> <path-index>attritbutes//name</path-index> </sort-order> </options> If not, is there a way to achieve this? I have several elements with the same name from different parent nodes or from the root element so I can't use just <options

search:search() vs cts:search() in MarkLogic

喜欢而已 提交于 2019-12-21 17:02:40
问题 I have read about cts:search() and search:search() separately but could not figure out the exact difference between them. It says cts:search() ultimately uses search:search() . Can anyone illustrate in detail the scenario where one should go for cts:search() and for search:search() .This is not in relation to some particular project work where I need to implement this but in general. Thanks! 回答1: Also worth mentioning are the: Client REST API, which basically exposes the Search API as an HTTP

How Can I use Apache to load balance Marklogic Cluster

耗尽温柔 提交于 2019-12-21 16:21:35
问题 Hi I am new to Marklogic and Apache. I have been provided task to use apache as loadbalancer for our Marklogic cluster of 3 machines. Marklogic cluster is currently running on Linux servers. How can we achieve this? Any information regarding this would be helpful. 回答1: You could use mod_proxy_balancer. How you configure it depends what MarkLogic client you would like to use. If you would like to use the Java Client API, please follow the second example here to allow apache to generate

MarkLogic Node.js Sort on “last-modified”

拟墨画扇 提交于 2019-12-14 03:55:08
问题 I want to sort the documents by metadata property " last-modified ". I have already created element-range-index on "last-modified" and also enabled option " maintain last modified " in Admin Panel for the database.But, when I run below statement in Node.js return db.documents.query( qb.where().orderBy(qb.sort("last-modified")).slice(from, length)).result(); I am getting below error. Please help? Error { [Error: query documents: response with invalid 400 status] message: 'query documents:

MarkLogic - java heap space error while importing with mlcp

Deadly 提交于 2019-12-14 02:32:05
问题 Marklogic version : 9.0-6.2 mlcp version: 9.0.6 I am trying to import XML file into marklogic using MLCP uisng below code. #!/bin/bash mlcp.sh import -ssl \ -host localhost \ -port 8010 \ -username uname \ -password pword \ -mode local \ -input_file_path /data/testsource/*.XML \ -input_file_type documents \ -aggregate_record_namespace "http://new.webservice.namespace" \ -output_collections testcol \ -output_uri_prefix /testuri/ \ -transform_module /ext/ingesttransform.sjs The code is running

Using predicates on a large database?

三世轮回 提交于 2019-12-14 01:20:59
问题 I have a 50,000,000 document database that I'd like to write to a file the base-uri's for each document. Running the entire 50,000,000 is too long running (query times out). So, I thought I'd use predicates to break the database into more manageable batches. So, I tried the following to get a handle on its performance: for $i in ( 49999000 to 50000000 ) return fn:base-uri( /mainDoc[position()=$i] ) But, performance was very slow for these 1000 base uris. In fact, the query timed out. I tried

Marklogic scheduled backups failing

北城余情 提交于 2019-12-13 17:30:56
问题 We are currently using scheduled backups to have daily database backups. We are observing many problems in taking backups from past few days. The backup process executes for several hours but didn't get completed. We also had a look at the logs, but there is nothing mentioned for scheduled backup. We have following questions - By any means, can we make it more consistent and stop such things? Is there a way to get some kind of notification/email after the certain time if scheduled backup isn

MarkLogic 9 cts.parse not parsing queries correctly

梦想的初衷 提交于 2019-12-13 15:59:34
问题 I am working on a web-based search application using MarkLogic 9. I have a query building interface that allows users to enter strings into textboxes that correspond to particular JSON properties of the documents in the db. The idea was that the user could enter the search terms exactly as the cts.parse (I use server side javascript, not XQuery) expects them, so that their searches could be arbitrarily complex and I would not have to deal with parsing the queries myself. However after doing