marklogic

Using Transform Module during MLCP Ingestion to MarkLogic

北战南征 提交于 2019-12-01 13:54:30
I am trying to implement envelope pattern when i am ingesting documents through MLCP My transform Module is like this : function envelope(content, context) { var transformed ={}; transformed.Metadata = { "Created" : "Time"}; transformed.Source = content.value; content.uri = fn.concat("/transformed/",content.uri); content.value = transformed; }; exports.transform = envelope; My MLCP Command is like this mlcp.bat import -host localhost -port 8000 -username admin - password admin -mode local -input_file_path D:\Marklogic\abcd.csv -input_file_ty pe delimited_text -document_type json -transform

Timeout for a loop in XQuery MarkLogic

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 12:19:35
I have a big collection of about 1 million documents, in MarkLogic (version 9), with below structure: <File> <Id></Id> <ModifiedAt></ModifiedAt> <Author></Author> <Title></Title> </File> And I need to iterate through entire collection and to replace space from ModifiedAt with T for all documents Example of document: <File> <Id>12121</Id> <ModifiedAt>2011-06-08 14:29:29.000</ModifiedAt> <Author>Test</Author> <Title>Test</Title> </File> Field ModifiedAt should become: 2011-06-08T14:29:29.000 The code looks like: for $doc in fn:collection('File') return xdmp:node-replace($doc/File/ModifiedAt,

Timeout for a loop in XQuery MarkLogic

萝らか妹 提交于 2019-12-01 10:33:41
问题 I have a big collection of about 1 million documents, in MarkLogic (version 9), with below structure: <File> <Id></Id> <ModifiedAt></ModifiedAt> <Author></Author> <Title></Title> </File> And I need to iterate through entire collection and to replace space from ModifiedAt with T for all documents Example of document: <File> <Id>12121</Id> <ModifiedAt>2011-06-08 14:29:29.000</ModifiedAt> <Author>Test</Author> <Title>Test</Title> </File> Field ModifiedAt should become: 2011-06-08T14:29:29.000

Escaping curl command in Windows

删除回忆录丶 提交于 2019-12-01 05:45:27
问题 I'm trying to run a curl command from the command line in Windows, but for the life of me I can't figure out how I'm supposed to escape it. I'm executing this: C:\WINDOWS\system32>curl --anyauth --user user:password -X POST -d "{\"rest-api\":{\"name\":\"BizSimDebug3\"}}" -H "Content-type: application/xml" http://localhost:8002/v1/rest-apis And I'm getting this: <rapi:error xmlns:rapi="http://marklogic.com/rest-api"> <rapi:status-code>400</rapi:status-code> <rapi:status>Bad Request</rapi

Replacing strings in various XML files

老子叫甜甜 提交于 2019-11-29 16:00:51
Given the following xml file with the knowledge that the structure and contents can change: <something> <parent> <child>Bird is the word 1.</child> <child>Curd is the word 2.</child> <child>Nerd is the word 3.</child> </parent> <parent> <child>Bird is the word 4.</child> <child>Word is the word 5.</child> <child>Bird is the word 6.</child> </parent> </something> I would like a way to use xquery (and even xslt) to replace all instances of a supplied string with another. For example, replace the word "Bird" with "Dog". Therefore the results would be: <something> <parent> <child>Dog is the word 1

Install Marklogic centos virtualbox vm

自作多情 提交于 2019-11-29 12:16:08
I recently set up a CentOS 6.4 basic LAMP server (no GUI) in a pre-built Virtualbox image, and then followed the installation guide/steps for MarkLogic. When I attempt install with rpm -i /tmp/MarkLogic-8.0-1.x86_64.rpm , MarkLogic states that it cannot find libc.so.6, however when I run the command whereis libc.so.6 , the shell responds with /lib64/libc.so.6 I would make a symbolic link I suppose, but I'm not sure where MarkLogic is expecting that file to be. Does anyone have experience installing MarkLogic on Centos6 and how to verify the install is working properly? While ML gave some good

Pattern or Format Match in XQuery MarkLogic

▼魔方 西西 提交于 2019-11-28 11:42:40
问题 I am looking for given string, it has to be in *(*) format, * should not have space, no two words before ( . I am searching MarkLogic DB to see if given column value is in [^\s]+\((?!\s)[^()]+(?<!\s)\) format, if not replace it with this format. I am still stuck at fetching data, and could not write the query to update I am searching DB as let $query-opts := cts:search(doc(), cts:and-query(( cts:directory-query(("/xyz/documentData/"),"1"), cts:element-query( xs:QName("cd:clause"), (: <clause>

Install Marklogic centos virtualbox vm

房东的猫 提交于 2019-11-28 06:00:37
问题 I recently set up a CentOS 6.4 basic LAMP server (no GUI) in a pre-built Virtualbox image, and then followed the installation guide/steps for MarkLogic. When I attempt install with rpm -i /tmp/MarkLogic-8.0-1.x86_64.rpm , MarkLogic states that it cannot find libc.so.6, however when I run the command whereis libc.so.6 , the shell responds with /lib64/libc.so.6 I would make a symbolic link I suppose, but I'm not sure where MarkLogic is expecting that file to be. Does anyone have experience

Updating counter in XQuery

时光毁灭记忆、已成空白 提交于 2019-11-27 03:54:35
问题 I want to create a counter in xquery. My initial attempt looked like the following: let $count := 0 for $prod in $collection let $count := $count + 1 return <counter>{$count }</counter> Expected result: <counter>1</counter> <counter>2</counter> <counter>3</counter> Actual result: <counter>1</counter> <counter>1</counter> <counter>1</counter> The $count variable either failing to update or being reset. Why can't I reassign an existing variable? What would be a better way to get the desired