WordPress / wordpress.org

WordPress.org Meta, Git-ified. Synced from git://meta.git.wordpress.org/ This repository is just a mirror of the WordPress Meta subversion repository. Please include a link to a pre-existing ticket on https://meta.trac.wordpress.org/ with every pull request.
https://meta.trac.wordpress.org/
109 stars 140 forks source link

Plugins: Modify search results total when there are more than 1000 results #310

Closed ndiego closed 4 months ago

ndiego commented 4 months ago

When searching in the Plugin Directory, the maximum number of returned search results is 1020. Because many search terms return 1020 results, and the number is so specific, it feels odd or that something is not working correctly. If the search maxes out at 1020, I propose we instead display 1,000+.

Current Proposed
image image
pkevan commented 4 months ago

It should be possible to return the total from ES, even if it isn't possible to paginate through all the results, as the total exists in the response. That would probably be better?

ndiego commented 4 months ago

It should be possible to return the total from ES, even if it isn't possible to paginate through all the results, as the total exists in the response. That would probably be better?

Oh yeah, that would be better. Didn't think it was possible.

dd32 commented 4 months ago

test search is 5,552 results, as reported by the search api.

1,020 is 51 * 21, the display is limited to 50 pages which would be 1,000, so it seems that there's an off-by-one in the pagination limiting code.

There's a logged-out 50 page limit plugin: https://github.com/WordPress/wordpress.org/blob/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-page-limiter.php

The plugin directory search limits it to 50 pages, which seems odd: https://github.com/WordPress/wordpress.org/blob/86efbda99d43bb3603c082a8ed59912fc99be061/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-search.php#L401-L421

Disabling that leads to 51 pages being offered, the 1,020. So I guess the actual bug is in the upstream Jetpack code that sets it as 1020..

Let's see if this following change works to properly show the search result counter.

pkevan commented 4 months ago

Looks like the numbers are accurately reflected in the search results from a few tests.

I wonder if we should consider a page that exists after 50 pages, something along the lines of "Please consider narrowing your search, results are limited to 1000"?

ndiego commented 4 months ago

Let's see if this following change works to properly show the search result counter.

Looks like it's now showing the actual number of plugins 🙌

image
StevenDufresne commented 4 months ago

Can we close this issue now?