Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read documents in order

We have a list of URIs and which we need to read in the sequence in which it is passed.

Example1

doc(("/doc1", "/doc2", "/doc3"))

above function should return the content of "/doc1" then "/doc2" and then "/doc3" but it is not happening.

The same thing is happening is with the below query also.

Example2

cts:search(doc(), cts:document-query((("/doc1"),("/doc2"),("/doc3"))))

What will be the solution if I want to read the documents in which sequence I pass the URIs ?

Any help is appreciated..!

like image 976
DevNinja Avatar asked May 06 '26 02:05

DevNinja


1 Answers

cts:search has its own ordering functionality, which you can trigger using functions like cts:index-order. fn:doc takes an array, and will return them in database order. Neither of them sounds like what you are trying to achieve.

I would suggest explicitly iterating over the uris, and fetching the uris one by one. You could use ! operator for this, for instance:

("/doc1", "/doc2", "/doc3") ! doc(.)

HTH!

like image 56
grtjn Avatar answered May 11 '26 16:05

grtjn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!