search:parse Returns a Different Type for cts:query Output Format
- Last Updated: August 5, 2026
- 1 minute read
- MarkLogic Server
- Version 11.0
- Documentation
In MarkLogic 8, search:parse returned the XML serialization of a cts:query by default. You could also explicitly select this return type by specifying “cts:query” as the value of the $output parameter.
In MarkLogic 9 and later, if you explicitly specify “cts:query” as the value of the $output parameter, you will now get a cts:query object instead of a serialized query. The default return type from search:parse is unchanged.
If your code explicitly sets the output type to “cts:query” and passes the output of search:parse straight through to functions such as search:resolve or cts:search, no code changes are required.
If your code explicitly sets the output type to “cts:query” and then transforms or traverses the output query XML, then you must change your code to use the new “schema-element(cts:query)” for the $output parameter of search:parse.
For example, the following call generates the XML serialization of a cts:query in MarkLogic 9 and later:
search:parse("cat AND dog", (), "schema-element(cts:query)")