Loading TOC...

search:unparse

search:unparse(
   $cts-query as schema-element(cts:query)
) as xs:string+

Summary

This function turns a serialized and annotated cts:query (typically from search:parse) back into query text according to the specified rules.

Parameters
$cts-query A serialized and annotated cts:query, typically the result of a call to search:parse.

Example

xquery version "1.0-ml";
import module namespace search = "http://marklogic.com/appservices/search"
    at "/MarkLogic/appservices/search/search.xqy";

search:unparse(
    search:parse("tag:technology AND format:pdf",
    search:get-default-options()))

=>

"tag:technology AND format:pdf"

      

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.