marklogic

xquery api to upload data from marklogic to amazon s3

大憨熊 提交于 2019-12-02 01:18:29
I have a requirement to save files to amazon S3 from my xquery, instead of storing it locally in my marklogic server box (using xdmp:save right now). Is there an xquery api to upload this file to S3 from my xquery? If you are running MarkLogic on an EC2 instance, then the solution is there already.. S3 is treated like a native filesystem, so using xdmp:save("S3://bucket/..." bla) works. But you need to fill in your credentials in the admin panel. Docs are here: https://docs.marklogic.com/guide/ec2/managing#id_98406 Note that you can even store forests on S3 as well (but not with journalling

Unable to create MarkLogic scheduled tasks from within CPF action module

こ雲淡風輕ζ 提交于 2019-12-02 00:56:05
I have a MarkLogic database with Content Processing Framework (CPF) installed and the CPF pipeline is such that: Whenever a document is inserted then it grabs the value of execution-date from the document and schedule a task for that time. Example: Sample document: <sample> <execution-date>2014-10-20T12:29:10</execution-date> </sample> when inserted triggers the CPF action module which reads the value of execution-date field and creates a scheduled task to be executed on the time read from execution-date field. Following is the XQuery code snippet from the CPF action module that creates the

How to build a simple search application in Marklogic?

无人久伴 提交于 2019-12-01 23:42:42
问题 I want to build a simple search application in Marklogic but I don't want to use Application Builder. I want to write my own .xqy files. I want to take input from user say First Name, Last Name & Address. The user can search by First Name, or Last Name or Address. He can also search by entering all the three fields or can also leave three fields blank. In that case (blank) all the records should be returned. How can I build such application in Marklogic with search facility on specific nodes

How to build a simple search application in Marklogic?

旧城冷巷雨未停 提交于 2019-12-01 21:18:40
I want to build a simple search application in Marklogic but I don't want to use Application Builder. I want to write my own .xqy files. I want to take input from user say First Name, Last Name & Address. The user can search by First Name, or Last Name or Address. He can also search by entering all the three fields or can also leave three fields blank. In that case (blank) all the records should be returned. How can I build such application in Marklogic with search facility on specific nodes of xml like First Name, Last Name etc. grtjn I suggest you take a look at the search:search

What are in memory elements in marklogic?

二次信任 提交于 2019-12-01 17:19:07
I have couple of documents on which xdmp:node-replace() over certain elements doesnot work. There are some other set of documents which are almost similar to the ones that has problem but xdmp:node-replace works perfectly fine on them. Tried all possibilities that could have gone wrong but in vain. Read some where that xdmp:node-replace function does not work on ' in memory elements '. So in order to verify whether the issue is with ' in memory elements ', I want to know what exactly it is. Any light on it would be of great help Anything constructed within a query is an in-memory element. For

avoiding XDMP-EXPNTREECACHEFULL and loading document

怎甘沉沦 提交于 2019-12-01 17:06:57
I am using marklogic 4 and I have some 15000 documents (each of around 10 KB). I want to load the entire content as a document ( and convert the total documents to a single csv file and output to HTTP output stream for downloading). While I load the documents this way: let $uri := cts:uri-match('products/documents/*.xml') let $doc := fn:doc ($uri) The xpath has some 15000 xmls. So fn:doc throws an error XDMP-EXPNTREECACHEFULL . Is there any workaround for this? I cannot increase tree cache size in admin console because the number of xml files in products/documents/*.xml may increase. Thanks.

What are in memory elements in marklogic?

落爺英雄遲暮 提交于 2019-12-01 16:58:14
问题 I have couple of documents on which xdmp:node-replace() over certain elements doesnot work. There are some other set of documents which are almost similar to the ones that has problem but xdmp:node-replace works perfectly fine on them. Tried all possibilities that could have gone wrong but in vain. Read some where that xdmp:node-replace function does not work on ' in memory elements '. So in order to verify whether the issue is with ' in memory elements ', I want to know what exactly it is.

How to unencode escaped XML with xQuery

て烟熏妆下的殇ゞ 提交于 2019-12-01 16:56:42
I have a variable in xQuery of type xs:string with the value of an encoded HTML snippet (the content of a twitter tweet). It looks like this: Headlines-Today • AP sources: <b>Obama</b> pick for Justice post withdraws : News - Rest Of World - <a href=" http://shar.es/mqMAG">http://shar.es/mqMAG</a&gt ; When I try to write this out in an HTML block, I need the string to be unescaped so that the HTML snippet will be interpreted by the browser. Instead the string is getting written out as is and the browser is rendering it as just text (so you see <a href="blah.... ). Here's how I'm writing out

How to unencode escaped XML with xQuery

孤街醉人 提交于 2019-12-01 15:31:32
问题 I have a variable in xQuery of type xs:string with the value of an encoded HTML snippet (the content of a twitter tweet). It looks like this: Headlines-Today • AP sources: <b>Obama</b> pick for Justice post withdraws : News - Rest Of World - <a href="http://shar.es/mqMAG">http://shar.es/mqMAG</a> When I try to write this out in an HTML block, I need the string to be unescaped so that the HTML snippet will be interpreted by the browser. Instead the string is getting written out as is and the

avoiding XDMP-EXPNTREECACHEFULL and loading document

核能气质少年 提交于 2019-12-01 15:06:01
问题 I am using marklogic 4 and I have some 15000 documents (each of around 10 KB). I want to load the entire content as a document ( and convert the total documents to a single csv file and output to HTTP output stream for downloading). While I load the documents this way: let $uri := cts:uri-match('products/documents/*.xml') let $doc := fn:doc ($uri) The xpath has some 15000 xmls. So fn:doc throws an error XDMP-EXPNTREECACHEFULL . Is there any workaround for this? I cannot increase tree cache