A typical method for browsing results on mobile devices is an “infinite scroll”, which loads results as the user scrolls through the list. With InstantSearch this is as easy as using the InfiniteHits
widget .
If there are no hits, you should display a message to users and clear filters so they can start over.
Show more than 1,000 hits
To ensure excellent performance, the default limit for the number of hits you can retrieve for a query is
1,000.
1
2
3
$index -> setSettings ([
'paginationLimitedTo' => 1000
]);
1
2
3
index . set_settings ({
paginationLimitedTo: 1000
})
1
2
3
4
5
index . setSettings ({
paginationLimitedTo : 1000
}). then (() => {
// done
});
1
2
3
index . set_settings ({
'paginationLimitedTo' : 1000
})
1
2
3
4
5
6
7
8
let settings = Settings ()
. set (\ . paginationLimitedTo , to : 1000 )
index . setSettings ( settings ) { result in
if case . success ( let response ) = result {
print ( "Response: \( response ) " )
}
}
1
2
3
4
5
val settings = settings {
paginationLimitedTo = 1000
}
index . setSettings ( settings )
1
2
3
4
IndexSettings settings = new IndexSettings ();
settings . PaginationLimitedTo = 1000 ;
index . SetSettings ( settings );
1
2
3
index . setSettings (
new IndexSettings (). setPaginationLimitedTo ( 1000 )
);
1
2
3
res , err := index . SetSettings ( search . Settings {
opt . PaginationLimitedTo ( 1000 ),
})
1
2
3
4
5
client . execute {
setSettings of "myIndex" `with` IndexSettings (
paginationLimitedTo = Some ( 1000 )
)
}
Increasing the limit doesn’t mean you can go until the end of the hits,
but just that Algolia will go as far as possible in the index to retrieve results in a reasonable time.
© Algolia · Privacy Policy · Cookie settings