How to print query statement being executed by cts:search

Issues related to W3C XQuery.
vkdev
Posts: 21
Joined: Sat Jan 07, 2017 12:54 am

How to print query statement being executed by cts:search

Post by vkdev » Fri Feb 03, 2017 5:05 pm

Is it possible to see or print the full query that a cts:search executed? Like when we use hibernate, we can turn on a logging flag to trace the slq query statement and also the bind parameters that it used.
Is a similar feature of logging the executed query statement on oxygenxml console please?

alex_jitianu
Posts: 682
Joined: Wed Nov 16, 2005 11:11 am

Re: How to print query statement being executed by cts:search

Post by alex_jitianu » Mon Feb 06, 2017 10:51 am

Hi,

From the cts:search documentation I see that they recommend using xdmp:query-trace(true()) . Calling this before the cts:search() will print logging information to the error log. The error log location is system dependent. Unfortunately, from Oxygen, the only way to see these logs is to:
1. present the XQuery/XPath Builder (from Window->Show view)
2. select the MarkLogic connection from the view's toolbar
3. run a query like this (please make sure you use the proper path depending on the OS where the ML server is running):

Code: Select all

xdmp:document-get("/var/opt/MarkLogic/Logs/ErrorLog.txt")
Best regards,
Alex

Post Reply