Q: The hits are always numbered 1..N..is it possib...
# community-help
a
Q: The hits are always numbered 1..N..is it possible to take the page number into account? 20 hits per page, the first item on page #1 would be β€œ1”, first item on page #2 would be β€œ21" …the current fixed 1..N numbering is counter-intuitive.
k
πŸ‘‹ We don't number the hits in the API responses. Can you post a snippet or screenshot to show that?
k
Ah, you mean the numbers always starting with "1" in the UI even when I click on page 2, 3, etc.?
a
yes
k
I see the HTML is being rendered using
<li>
-- that explains those 1 to 10 numbering.
a
using an outer ordered list
k
You can probably add a CSS
list-style: none
rule to remove that numbering, but @Jason Bosco might have an alternative approach here.
g
Or use
ul
(unordered list) instead of
ol
(ordered list).
If you retain all the results in memory (page #1, #2, #3, etc) then you could likely use the array index to apply the numbering yourself even with techniques like virtualization (windowing).
(or something like
pageNumber
+
index + 1
if you don't)
j
It looks like instantsearch might have a way to manage ordering like what Greg mentioned using __hitIndex. Could you try this out: https://www.algolia.com/doc/api-reference/widgets/hits/js/#widget-param-item
c
if the numbering is coming from an
<ol>
element there is a
start
attribute that lets you set the number sequence starting point
πŸ‘ 1