0
votes

I am using structured query to fetch 100k messages from the database as below:

sqb.and(
          sqb.word(sqb.jsonProperty(status.name), toBeReported.name),
          sqb.word(sqb.jsonProperty(dataCategory.name), param.businessCategory),
          sqb.range(sqb.jsonProperty(creationDate.name), marklogicDateFormat.name, Operator.LE, DateUtil.printFpmlDateTime(param.messagesTime)))

then, applying the sorting on it using optionsName.

I am getting timeout error sometimes like :

SVC-EXTIME: search-impl:apply-search($querydef) -- Time limit exceeded

Can someone please tell me that are structured queries make unfiltered searched or filtered searched? can we make structured queries to make unfiltered searched?

1

1 Answers

1
votes

Is the query trying to retrieve all 100k messages in a single request?

The recommended approach is to paging over the result list, getting somewhere between 100 and 1,000 documents (the sweet spot can vary depending on the document size and other factors) in each request and processing each response page concurrently with requesting the next page for optimal throughput.

Hoping that helps,