jsearch.words

jsearch.words(
   index as LexiconDefinition
) as WordsSearch

Summary

Creates a WordsSearch object to define and execute a search for a list of indexed words.

Parameters
index A JSON property (as a string) or a LexiconDefinition produced by one of the jsearch lexion helper functions; see the Usage Notes for details. You can specify a single property name, a single LexiconDefinition, or an array of LexiconDefinition's.

Usage Notes

You can search over one or more lexicons defined on JSON properties, XML elements, XML attributes, database fields, or database word lexicons. You can use a simple string to identify a JSON property, or build a LexiconDefinition using the following helper functions: jsearch.databaseLexicon, jsearch.elementLexicon, jsearch.elementAttributeLexicon, jsearch.fieldLexicon, jsearch.jsonPropertyLexicon.

See Also

Example


// Match words in the JSON property named "title".
const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.words(jsearch.jsonPropertyLexicon('title'))
  .match('c*')
  .result();
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy