MarkLogic 10 Product Documentation
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"

      
Powered by MarkLogic Server | Terms of Use | Privacy Policy