Search.../

length

Returns the number of documents in the current results page.

Description

The length is the number of documents in the current page. This may be different than the pageSize, which is defined by the limit() function.

You navigate through pages using the prev() and next() functions.

Type:

numberRead Only

Was this helpful?

Get the length of the current results page

Copy Code
1let resultLength = results.length; // 20
Perform a search and get the length of the current results page

Copy Code
1import wixSearch from 'wix-search';
2
3// ...
4
5wixSearch.search(phrase)
6 .find()
7 .then( (results) => {
8 let resultLength = results.length; // 20
9 } ) ;