marklogic

Managed document not working in MarkLogic 10 after xdmp:document-insert

守給你的承諾、 提交于 2019-12-11 15:52:33
问题 First time manage document using dls:document-insert-and-manage Update the same document using xdmp:document-insert Document get lost from the dls latest version collection cts:search(/scopedIntervention/id , dls:documents-query()) First time manage document <scopedIntervention> <id>someId12345</id> <scopedInterventionName> First Name </scopedInterventionName> <forTestOnly> true </forTestOnly> <inactive> true </inactive> </scopedIntervention>)``` **Document inserted with versioning** Verify

JavaScript Multi-statement Transaction in Marklogic

喜欢而已 提交于 2019-12-11 15:27:11
问题 I wanted to write a multi-statement transaction in server-side JavaScript in marklogic. What I wanted to achieve is, do an update transaction and then write a query statement which queries for the updated document and confirm that the update is visible within the transaction and finally do a rollback. By doing the rollback, I wanted to confirm that the update made within the transaction is not visible outside the transaction and it is visible within the transaction. I wrote a code both in

Marklogic Wrong count and Facet result Xquery

本小妞迷上赌 提交于 2019-12-11 15:23:38
问题 Calling search:search doesn't return expected facet result counts. Below are two example files and the code I used. Page1.xml <pages xmlns="http://marklogic.com/docs"> <page> <elementNode>data1</elementNode> <textNode>text1</textNode> </page> <page> <elementNode>data2</elementNode> <textNode>text2</textNode> </page> <page> <elementNode>data3</elementNode> <textNode>text3</textNode> </page> <page> <elementNode>data4</elementNode> <textNode>text4</textNode> </page> </pages> Page2.xml <pages

Clustering of nodes (MarkLogic)

喜夏-厌秋 提交于 2019-12-11 14:57:38
问题 I am currently attempting to create a cluster on MarkLogic and would like to ask if is there a need for a license to create the cluster? I managed to get Machine B to connect to Machine A but it begins a "Restarting MarkLogic Server to load new group configurations" and results in an error "ERROR: too many loops!". I have tested with pinging and opening of the admin page via port 8001 from one machine to the other. Both database is empty and do not have any type of license. For now I know

Marklogic - How to assign dynamic variable in Xquery

房东的猫 提交于 2019-12-11 14:44:07
问题 I have tried below mentioned XQuery . declare variable $path as xs:string :="D:\Mongo\"; let $uri :="/MJ/1932/Vol1/Part1/387.xml" let $x := fn:normalize-space(fn:replace($uri,"/"," ")) for $i in fn:tokenize($x, " ") let $j := fn:concat($path,$i) return($j) Actual output D:\Mongo\MJ D:\Mongo\1932 D:\Mongo\Vol1 D:\Mongo\Part1 D:\Mongo\387.xml Expected output D:\Mongo\MJ D:\Mongo\MJ\1932 D:\Mongo\MJ\1932\Vol1 D:\Mongo\MJ\1932\Vol1\Part1 D:\Mongo\MJ\1932\Vol1\Part1\387.xml Please Suggest me , how

Traversing a Json Node using Javascript in marklogic?

早过忘川 提交于 2019-12-11 14:33:28
问题 I want to traverse a JSON Node which is like this (i.e./node.json) { "One": { "Name": "One", "Country": "US" }, "Two": { "State": "kentucky" }, "Three": { "Element1": "value1", "Element2": "value2", "Element3": "value3", "Element4": "value4", so on ... } } Updated My Usecase : I tried to run a CORB job with below configurations Transform.xqy (Where I am keeping all the elements in an array) var name = fn.tokenize(URI, ";"); const node = cts.doc(name); var a= node.xpath("/One/*"); var b= node

How to insert a constructed XML nodes in XQuery?

梦想与她 提交于 2019-12-11 14:17:58
问题 I want to insert a node using below code but if i will rerun the code i don't want my node to be repeated twice- let $doc := fn:doc("abc.xml") (: abc.xml looks like-- <root> <value1>somevalue</value1> <value2>somevalue</value2> <value3>somevalue</value3> <value4>somevalue</value4> <value5>Australia</value5> <value6>India</value6> <value7>USA</value7> <value8>somevalue</value8> <value9>somevalue</value9> <value10>somevalue</value10> </root> :) let $element := element Root{ element A{"A"},

SPARQL Geospatial Queries (MarkLogic)

不羁的心 提交于 2019-12-11 14:17:43
问题 Carrying on from a previous question here. Where it was noted that avoiding fn:doc() should be avoided in SPARQL queries. However, for geospatial queries aside from the code shown below I am unable to find an alternative solution. I have also used this query and it's runtime is really slow. For bigger set of data it will hit the 1 hour timeout. Hence, I would like to ask if there is a better way in implementing Geospatial queries for SPARQL? Is it possible to use GEOSPARQL with PREFIX spatial

Default Schema Values in MarkLogic

狂风中的少年 提交于 2019-12-11 13:16:42
问题 I'm trying to insert a document via xdmp:document-insert() before that is called I am validating the document against it's respective schema via validate strict { $xml } and using that output in the insert call. However the output of the validate call does not include the default value specified in the schema. Simplified schema: <xs:schema> <xs:complexType name="fields-type" abstract="false" mixed="false"> <xs:sequence minOccurs="1" maxOccurs="1"> <xs:element default="Faulkner" maxOccurs="1"

MarkLogic, java API. Get search results sorted

断了今生、忘了曾经 提交于 2019-12-11 10:01:53
问题 Sorry, this might be a stupid question, but I wasn't able to find this in MarkLogic's docs: I'm selecting all items from some collection and would like to get the newest first. So I'm looking for some ability to get search results sorted. I saw it's possible via XQuery but wasn't able to find this in Java API. So, to summarize, my questions are: Is it possible to get search results via Java API sorted by "lastModifyTime" (as I understood - it's some auto created / updated field)? Is it