Loading TOC...

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();
   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.