jsearch.databaseLexicon() as LexiconDefinition
Identifies the lexicon for all words in the database
as input for the jsearch.words
method.
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.
// 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()