Page 1 of 1

How to print query statement being executed by cts:search

Posted: Fri Feb 03, 2017 5:05 pm
by vkdev
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?

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

Posted: Mon Feb 06, 2017 10:51 am
by alex_jitianu
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