Loading TOC...


   type as string
) as object


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.

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


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

// Result: An array of the matched words.

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