Loading TOC...

WordsSearch.slice

WordsSearch.slice(
   start as integer,
   end as integer
) as WordsSearch

Summary

Specify a positional subset of words to retrieve. If unspecified, the slice defaults to the first 10 words.

Parameters
start The zero-based index of the first word to return.
end The zero-based index of the word after the last word to return. If unspecified, the end defaults to specify a subsequence of 10 words.

See Also

Example


const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.words('title')
  .slice(0,3)
  .result()
/* Result: Return the first 3 words in the lexicon. For example:
["Adventures", "and", "Collected"]
*/
   

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