Loading TOC...

MarkLogic 10 Product Documentation
search functions

The table below lists all the search built-in functions (in this namespace: http://marklogic.com/appservices/search).

The Search function module is installed as the following file:

  • install_dir/Modules/MarkLogic/appservices/search/search.xqy

where install_dir is the directory in which MarkLogic Server is installed.

To use the search.xqy module in your own XQuery modules, include the following line in your XQuery prolog:

import module namespace search="http://marklogic.com/appservices/search"
                    at "/MarkLogic/appservices/search/search.xqy";

The Search functions are used to create search high-level results, facets, snippets, and other search-related items.

12 functions
Function name Description
search.checkOptions This function verifies that options XML is properly structured.
search.estimate This function quickly estimates the number of hits a query will return.
search.getDefaultOptions This function returns the default options XML.
search.parse This function parses query text according to given options and returns the appropriate cts:query XML.
search.removeConstraint NOTE: This function is deprecated.
search.resolve This function is the same as search:search, except that it takes a parsed and annotated cts:query XML node or a structured search search:query XML node as input.
search.resolveNodes This function performs the same search as search:search, but it takes a parsed and annotated cts:query XML node or a structured search search:query XML node as input and returns the actual result nodes from the database.
search.search This function parses and invokes a query according to specified options, returning up to $page-length result nodes starting from $start.
search.snippet This function extracts matching text from the result node based on options, and returns the matches wrapped in a containing node, with highlights tagged.
search.suggest This function returns a sequence of suggested text strings that match a wildcarded search for the $qtext input, ready for use in a user interface.
search.unparse NOTE: This function is deprecated.
search.values This function returns lexicon values and co-occurrences, and allows you to calculate aggregates based on the lexicon values.