jsearch.values( index as cts.reference ) as ValuesSearch
Creates a ValuesSearch object to define and execute a search for a list of indexed values.
Use the methods of ValuesSearch
to further refine
your query, including scoping the values to those occurring in
documents that match a documents search, defining a sort order,
or computing an aggregate over the values.
// Query the values of the "title" JSON property in all documents // in the directory "/books". const jsearch = require('/MarkLogic/jsearch.sjs'); jsearch.values('title') .where(cts.directoryQuery('/books/')) .result() /* Result: A list of values from the "title" element range index that satisfy the query, similar to the following: ["Adventures of Huckleberry Finn", "Adventures of Tom Sawyer", "Collected Works", "East of Eden", "Of Mice and Men", "The Grapes of Wrath"] */
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.