I have a collection (ABR) with 1.5 million documents
I want to create a custom flow to process these documents; however, in the 1st instance, I only want the flow to process 10 documents so I can test and assess my custom code.
In the past (prior v5) I would do this with 2 lines
let uriCollection = cts.uris(null, null, cts.collectionQuery("ABR"))
fn.subsequence(uriCollection, 0, 10)
Now in version 5 you place this search in the custom flow.
If I select the Source Type as Collection and selecting Source collection as ABR and run all is well. However, I like to incrementally build the JavaScript as it is not my strength and secondly I just like building things incrementally.
In theory, I should be able to put:
fn.sequence(cuts.uris(null,null,cts(collectionQuery("ABR")),1,10)
In Query Console, it works as a search.
It does not work it Data Hub where I get the following error:
java.lang.RuntimeException: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request at com.marklogic.hub.collector.impl.CollectorImpl.run(CollectorImpl.java:145) at com.marklogic.hub.step.impl.QueryStepRunner.runCollector(QueryStepRunner.java:318) at com.marklogic.hub.step.impl.QueryStepRunner.run(QueryStepRunner.java:260) at com.marklogic.hub.flow.impl.FlowRunnerImpl$FlowRunnerTask.run(FlowRunnerImpl.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:79) at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:122) at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:102) at com.marklogic.rest.util.MgmtResponseErrorHandler.handleError(MgmtResponseErrorHandler.java:26) at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:778) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:736) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:710) at com.marklogic.hub.collector.impl.CollectorImpl.run(CollectorImpl.java:139) ... 6 more
I am assuming that datahub purposefully restricts that type of search and expects you to restrict the number of documents in other ways.
Any advice is welcome.