search.checkOptions

search.checkOptions(
   options as element(search.options),
   [strict as Boolean?]
) as Sequence

Summary

This function verifies that options XML is properly structured. Used in debugging, normally not in production. Returns the empty sequence on success, otherwise it returns one or more error messages inside <report> elements.

Parameters
options Options that define the search grammar and control the search. See the description for $options for the function search:search.
strict If true, index settings are additionally verified. The default is false.

Example

const search = require('/MarkLogic/appservices/search/search');

search.checkOptions(fn.head(xdmp.unquote(
  '<options xmlns="http://marklogic.com/appservices/search">' +
      '<grammar>' +
        '<joiner strength="10" apply="infix" element="cts:or-query">|</joiner>' +
        '<joiner strength="20" apply="infix" element="cts:and-query">&amp;</joiner>' +
      '</grammar>' +
    '</options>')).root);
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy