Loading TOC...


jsearch.databaseLexicon() as LexiconDefinition


Identifies the lexicon for all words in the database as input for the jsearch.words method.

Usage Notes

The database lexicon must be enabled for the database. Note that this lexicon can be huge for a large database and thus is typically only enabled for a small database.

When using a database-wide lexicon that does not use the default collation (http://marklogic.com/collation), use the withOptions method to pass the collation details to the underlying cts query. See the examples, below.

See Also


// Retrieve words in all documents from the database-wide word lexicon.
// You must configure a database-wide word lexicon to use this form.
const jsearch = require('/MarkLogic/jsearch.sjs');
  .withOptions({words: 'collation=http://marklogic.com/collation/en'})

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