2021年1月26日星期二

How to use fn:contains(), fn:starts-with() and fn:ends-with in Optic API

Earlier we used the FLOWR query to satisfy our search requirement, since data is getting increased day by day so we decided to use Indexing for better search performance.

Working FLOWR Query (Just Sample)

for $doc in collection("col1")  where fn:contains($doc//entityName/text(), "USA")  return document-uri($doc)  

above query is working and it returns a document URI, Now we are trying to use Opting API to satisfy the same requirement.

We have created an element range index for entityName but not sure how to convert the above FLOWR query into Optic Query.

What will be equivalent Optic Query for the above FLOWR query ?, also in future we are planning to use fn:starts-with() and fn:ends-with() functions too.

We are using MarkLogic 10.0-2.1

Any help is appreciated

https://stackoverflow.com/questions/65911520/how-to-use-fncontains-fnstarts-with-and-fnends-with-in-optic-api January 27, 2021 at 09:07AM

没有评论:

发表评论