Loading TOC...

search:unparse

search:unparse(
   $qtree as element()
) as xs:string+

Summary

NOTE: This function is deprecated. Turn a serialized, annotated cts:query (typically from search:parse) back into query text according to the specified rules.

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

Usage Notes

You can only use search:unparse on an annotated cts:query. You can generate an annotated query by passing "cts:annotated-query" as the 3rd parameter of 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(), "cts:annotated-query"))

=>

"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.