WordsSearch.result

WordsSearch.result(
   type as string
) as Iterable

Summary

Executes the words search definition and returns an array or object depending on whether the results are generated by default, with a mapper, or with a reducer.

Parameters
type Specifies 'value' (the default) to return the words as a value (an array unless reducing) or 'iterator' to return a streaming iterator over the words.

Usage Notes

This function can return an array or an object, depending on how the results are generated (the default results, by a mapper, or by a reducer).

See Also

Example


// Find the first 10 words that occur in the "title" property of
// documents containing the word "adventure".
const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.words(srch.jsonPropertyLexicon('title'))
  .where(cts.wordQuery('adventure'))
  .slice(0, 10)
  .result();

// Result: An array of the matched words.
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy