microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
376 stars 328 forks source link

Pagination is not working when filters are applied escpecially for 2nd page from 1st page #3559

Open arunakshi opened 4 months ago

arunakshi commented 4 months ago

Version used Ex: 4.7.0

Describe the bug We are facing Pagination issue with V4 modern search webpart. This was working very fine in V3.9.0 of modern search webpart. Lately, we upgraded from V3 to V4.7. It is happening for all sites whereever we use modern search webpart.

We tested this with the Network traces and its coming from the API and the response is always same as in 1st page results when we click on 2nd page in pagination component.

Detailed steps to reproduce the behavior:

  1. Add Filters webpart (we are using managed metadata refinable properties for filtering)
  2. Add modern search results webpart and link it to filters webpart
  3. configure the search results webpart with search query that results more than 2 pages
  4. Now link filters webpart to modern search resutls webpart
  5. Select a filter from filters webpart
  6. I have 3 pages of search results in results webpart with the applied filter
  7. Observe the results in page 1
  8. Click on 2nd page, you will see same results in page 2
  9. Click on page 3, and you will see new results from page 3
  10. Click on page 2 again, you will see new results from page 2
  11. Again click on page 1, and after that click on page 2, you will see same results as in Page 1

I could able to reproduce this in multiple sites currently which affecting in a portal where we are targeting for more than 55k users.
This behavior is also reproducable in debug layout as well

Expected behavior Expected behavior is that it should able to get always new results in every page.

Desktop:

wobba commented 4 months ago

Did you also link the result web part to the filter web part? It has to be connected both ways: https://microsoft-search.github.io/pnp-modern-search/usage/search-filters/#connection

Tried now and pagination when selecting a filter value works as expected. Tested with both the SharePoint provider and Graph provider.

You can also check the JSON request per page and look at the startrow parameter and the refinementfilters being sent.

As for v4, you should always use the latest version, which is what I tested on (v4.10.2), to ensure what you report on has not been addressed already.

arunakshi commented 4 months ago

@wobba, yes, we do link the search results webpart to filters webpart like I mentioned in my step 2.

I cross verified the JSON request. The StartRow is 0 for page 2 when i click first time. If I click second time on Page 2, then StartRow has 12 (FYI: I have 12 item results per page) in JSON request.

wobba commented 4 months ago

Your next step is testing the latest version for repro. We don't triage issues on older versions.

driverdo1919 commented 2 weeks ago

@wobba I am experiencing the exact same problem, I have the latest version installed of PnP (4.11.1). This is not working for the following case:

I am showing 25 results per page, and I'm doing a query for a text that retrieves more than 25 results (thus I have more than 1 page). When trying to click on the 2nd page, I'm not navigated to the 2nd page...

I don't know if it's relevant, but I'm showing people results

BlazeOfFeathers commented 2 weeks ago

@driverdo1919 I'm having the same issue.

Tyrif commented 1 week ago

Version used Ex: 4.8.0.0 and 4.11.1.0

Describe the bug We are facing similar issues as above on the Search Results Wepart. We first noticed the issue on version 4.8.0.0 after upgrading to 4.11.1.0 we are still able to produce the issue. In addition to the above error we have noticed that when changing pages (mobile only 4.8.0.0 and 4.11.1.0) we cannot change pages because the elements move to the results section (This is the red box highlighted below) even though the UI shows it at the bottom of the list (This is the green box highlighted below).

image

Steps to Reproduce:

  1. Login to a mobile device
  2. Connect web inspector to the device
  3. Search for content
  4. Using the pagination numbers to swap different pages
  5. When you cannot change pages even though you are tapping the numbers, inspect the elements then search for "pagination"
  6. The pagination shifts up as well as the results.

Expected Behavior:Pagination should work smoothly on mobile devices, with the focus moving correctly as the user navigates through the pages. Observed Behavior: The focus is off when using pagination on mobile devices, making it difficult to navigate through pages.

Environment Details:

arunakshi commented 1 week ago

@wobba, I can't use latest release version since we have full customizations via search extensibility library and handlebar templates which would require our solution & handlebars must be upgraded if we use latest version. I tested with 4.9.2 version and paging worked without issues. We are good to go with 4.9.2 since no upgrade is required to our solution solution.

wobba commented 1 week ago

@arunakshi can you compare the requests being sent on v4.9.2 and v4.11 then? I don't see why they should be different in this regards.

driverdo1919 commented 1 week ago

@wobba, I saw there was a new version of PnP uploaded with the following changes:

Update audience docs by @patrikhellgren Fix for details list selection and focus by @patrikhellgren bugfix paging for dynamic filtering in combination with PnP search filters by @LeemansBE Patches to v4.12.2 by @wobba

Any chance that this bug is solved with this new version?

driverdo1919 commented 3 days ago

any updates on this one?

kasperbolarsen commented 3 days ago

I doubt it since this issue isn't mentioned in the release notes ,https://github.com/microsoft-search/pnp-modern-search/compare/4.12.1...4.12.2

BlazeOfFeathers commented 1 day ago

Who can fix this issue?

kasperbolarsen commented 1 day ago

We welcome PRs, would you like to have a go at it? You are also very welcome to have your internal developers working on it, and share the solution once it has been finished