Search...
skip( )
Sets the number of documents to skip before returning search results.
Description
The skip()
function defines the number of results to skip in the search
results before returning new search results.
For example, if you search your site and 20 documents match your search, but
you set skip()
to 5, the results returned will skip the first 5 documents
that match and return the 6th through 20th documents.
By default, skip()
is set to 0.
The maximum value that skip()
can accept is 100000
.
Syntax
function skip(skip: number): WixSearchBuilder
skip Parameters
NAME
TYPE
DESCRIPTION
skip
number
The number of documents to skip in the search results before returning the results.
Was this helpful?
Add a skip to a search
Copy Code
1let newSearch = search.skip(10);
Create a search, add a skip, and run it
Copy Code
1import wixSearch from 'wix-search';23// ...45$w("#searchInput").onKeyPress((keyPress) => {6 if (keyPress.key === "Enter") {7 const phrase = $w("#searchInput").value;8 wixSearch.search(phrase)9 .skip(10)10 .find()11 .then((results) => {12 if (results.documents.length > 0) {13 let documents = results.documents;14 } else {15 console.log("No matching results");16 }17 })18 .catch((error) => {19 console.log(error);20 });21 }22});