useInfiniteHits does not reset its current page wh...
# community-help
a
useInfiniteHits does not reset its current page when filters change. Also has out of sync data when useInstantSearch().refresh() is called @Kishore Nallan
f
Could you send a screenshot of the requests sent to Typesense when you change filters and another one for when you refresh?
a
wait
message has been deleted
f
Sorry, meant the request sent to Typesense from the browser's network tab
step to reproduce :
click on new book filter then scroll up to appx 20 30 page then click on used book see result it stuck same same whatever you apply fliter
f
Are you sending the requests to Typesense directly or a custom built backend that then queries Typesense?
a
using react intsant search
f
So there's two things: 1) Is your Instantsearch adapter's configuration using the Typesense server directly (so the host is either Typesense cloud or your localhost's port that Typesense runs on) 2) On the network tab of your browser, there's a new request sent when you change filters / change pages. Could you post those requests as a screenshot directly from the browser's network tab?
a
hosting Typesense cloud
Copy code
{
  "searches": [
    {
      "q": "cherba",
      "query_by": "isbn,title,author, embedding,publication",
      "prioritize_token_position": true,
      "max_facet_values": 10,
      "num_typos": "2",
      "min_len_1typo": 2,
      "split_join_tokens": "always",
      "typo_tokens_threshold": 10,
      "per_page": 24,
      "sort_by": "num_is_out_of_stack:asc",
      "pre_segmented_query": true,
      "drop_tokens_threshold": 0,
      "facet_sample_threshold": 1000,
      "facet_sample_percent": 20,
      "exclude_fields": "embedding",
      "highlight_full_fields": "isbn,title,author, embedding,publication",
      "collection": "books_collection",
      "facet_by": "agedGroup,author,binding,bookCondition,bookType,language,price,publication",
      "filter_by": "bookType:=[0]",
      "page": 1
    },
    {
      "q": "cherba",
      "query_by": "isbn,title,author, embedding,publication",
      "prioritize_token_position": true,
      "max_facet_values": 10,
      "num_typos": "2",
      "min_len_1typo": 2,
      "split_join_tokens": "always",
      "typo_tokens_threshold": 10,
      "per_page": 24,
      "sort_by": "num_is_out_of_stack:asc",
      "pre_segmented_query": true,
      "drop_tokens_threshold": 0,
      "facet_sample_threshold": 1000,
      "facet_sample_percent": 20,
      "exclude_fields": "embedding",
      "highlight_full_fields": "isbn,title,author, embedding,publication",
      "collection": "books_collection",
      "facet_by": "bookType",
      "page": 1
    }
  ]
}
It's what you want
f
They both point to the first page of the results, so this doesn't seem like a Typesense problem. This seems like a rendering problem, that's out of the Instantsearch adapter's scope
this is also open git issue
@Fanis Tharropoulos yes its rendering issue from react instant search how we can solve
f
Instantsearch itself isn't managed by Typesense, so we can't further assist with that at this point of time. If a solution arises from this GitHub issue, it should work on your use-case as well
Jason discussed this on the Instantsearch adapter repository here: https://github.com/typesense/typesense-instantsearch-adapter/issues/160#issuecomment-1498908829
a
hi i have 1 more doubt
incart108149fetchcoupon_detail_homepage108149check_book_incart108149multi_search?x-typesense-api-key=WcC50Q6xiobuAnmeydV47hQSRyuNyqWTmulti_search?x-typesense-api-key=WcC50Q6xiobuAnmeydV47hQSRyuNyqWTcollect?v=2&tid=G-2SY1411BGE&gtm=45je4b70v89983912…E%20BOOKS%20ONLINE%20INDIA!&en=page_view&tfd=8244collect?v=2&tid=G-2SY1411BGE&gtm=45je4b70v89983912…h_term=concept%20of%20physics%20hcverma&tfd=14096 14 / 111 requests84.6 kB / 9.5 MB transferred145 kB / 40.1 MB resourcesFinish: 14.22 sDOMContentLoaded: 452 ms Headers Payload Preview Response Initiator Timing 1. Query String Parameters 1. x*-typesense-api-key:* 2. WcC50Q6xiobuAnmeydV47hQSRyuNyqWT a. 3. Request Payload 1. {"searches":[{"q":"concept of physics hcverma","query_by":"isbn,title,author, embedding,publication","prioritize_token_position":true,"max_facet_values":10,"num_typos":"2","min_len_1typo":2,"split_join_tokens":"always","typo_tokens_threshold":10,"per_page":24,"sort_by":"num_is_out_of_stack:asc","pre_segmented_query":true,"drop_tokens_threshold":0,"facet_sample_threshold":1000,"facet_sample_percent":20,"exclude_fields":"embedding","highlight_full_fields":"isbn,title,author, embedding,publication","collection":"books_collection","facet_by":"agedGroup,author,binding,bookCondition,bookType,language,price,publication","filter_by":"isOutOfStock:N","page":1}]}
My search query is 'Concept of Physics.' The most relevant data appears at index 14 in the response, but ideally, it should come first