pageSize


pageSizenumberRead-only

Returns the search page size.

The page size is defined by the limit() function, can be retrieved using the pageSize property. You navigate through pages using the prev() and next() functions.

JavaScript
let resultPageSize = results.pageSize; // 25
Did this help?

totalCount


totalCountnumberRead-only

Returns the total number of documents that match the search.

The totalCount returns the total number of documents that match the search, not just the number of documents in the current page.

JavaScript
let resultCount = results.totalCount; // 50
Did this help?

totalPages


totalPagesnumberRead-only

Returns the total number of pages the search produced.

The page size is defined by the limit() function, can be retrieved using the pageSize property. You navigate through pages using the prev() and next() functions.

JavaScript
let resultPages = results.totalPages; // 2
Did this help?

hasNext( )


Indicates if the search has another page of results.

Method Declaration
Copy
function hasNext(): boolean;
Request
This method does not take any parameters
Returns
Return Type:boolean
JavaScript
let hasNext = results.hasNext(); // true
Did this help?

hasPrev( )


Indicates if the search has a previous page of results.

Method Declaration
Copy
function hasPrev(): boolean;
Request
This method does not take any parameters
Returns
Return Type:boolean
Get whether the search result object has previous results
JavaScript
let hasPrev = results.hasPrev(); // false
Did this help?

next( )


Retrieves the next page of search results.

The next() function retrieves the next page of search results.

The page size is defined by the limit() function, can be retrieved using the pageSize property. You navigate through pages using the prev() and next() functions.

If items are added or removed between calls to next(), the values returned by WixSearchResult may change.

Method Declaration
Copy
function next(): Promise<WixSearchResult>;
Request
This method does not take any parameters
Returns
Return Type:Promise<WixSearchResult>
JavaScript
oldResults .next() .then((results) => { let newResults = results; let documents = newResults.documents; let firstDocument = documents[0]; let facets = results.facets; let totalCount = newResults.totalCount; let pageSize = newResults.pageSize; let currentPage = newResults.currentPage; let totalPages = newResults.totalPages; let hasNext = newResults.hasNext(); let hasPrev = newResults.hasPrev(); let length = newResults.length; }) .catch((error) => { console.log(error); });
Did this help?