MarkLogic Server 11.0 Product Documentation
jsearch.databaseLexicon

jsearch.databaseLexicon() as LexiconDefinition

Summary

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

Example


// 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');
jsearch.words(jsearch.databaseLexicon())
  .match('c*')
  .withOptions({words: 'collation=http://marklogic.com/collation/en'})
  .result()
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy