I have the following situation in MarkLogic. I have a database with a large number of documents which each hold hundreds of fields. Now let's say, that for one of the fields I want to retrieve all the values from a large set of documents (using cts:search). What are my options?
Obviously, I could use a range index here. However, when I am exploring my dataset this would mean that I have to apply range indexes to all my fields, which seems.... overkill. In addition, I am perfectly fine with each query taking a little while.
So I have tried to run a simple cts:search query: cts:search(//Cost, cts:collection-query("myCollection)). This function returns the value (and element) of the element I am interested in and works just fine when I am looking for less than 10k documents. However, when I am exploring a set with 1m documents I get an XDMP-EXPNTREECACHEFULL error which suggests that MarkLogic is actually opening all the documents before retrieving the XML node and returning it to my query-console.
Is there any way to change this query so that it at leasts returns a result?
I have tried running unfiltered searches and using xdmp:eval to isolate the transaction, but so far no result.