avoiding XDMP-EXPNTREECACHEFULL and loading document

前端 未结 2 1018
我在风中等你
我在风中等你 2021-01-18 01:36

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

相关标签:
2条回答
  • 2021-01-18 02:01

    For general information about this error, see the MarkLogic knowledge base article on XDMP-EXPNTREECACHEFULL

    0 讨论(0)
  • 2021-01-18 02:04

    When you want to export large quantities of XML from MarkLogic, the best technique is to write the query so that results can stream, avoiding the expanded tree cache entirely. It is a very different style of coding, though: you'll have to avoid strong typing of any kind, and refactor your code to remove FLWOR expressions. You won't be able to test any of the code in cq or qconsole, either.

    Take a look at http://blakeley.com/blogofile/2012/03/19/let-free-style-and-streaming/ for some tips on how to get there. At a minimum the code sample you posted would have to become:

    doc(cts:uri-match('products/documents/*.xml'))
    

    In passing I would try to rework that to avoid the *.xml part, because it will be slower than needed. Maybe something like this?

    cts:search(
      collection(),
      cts:directory-query('products/documents/', 'infinity'))
    

    If you need to test for something more than the directory, you could add a cts:and-query with some cts:element-query test.

    0 讨论(0)
提交回复
热议问题