New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paging is broken when using algolia backend search #98
Comments
Howdy @ericmulder, I'm sorry to hear that you are experiencing issues with pagination. To verify that paging is indeed working as expected in WP Search with Algolia, I spun up a new local testing environment with WordPress 5.5.1. I installed and activated the Query Monitor and Any Ipsum plugins to assist with testing. I generated 20 posts with Any Ipsum, using the default "Bacon Ipsum" for text content...
I tested the standard WordPress search. I installed and activated WP Search with Algolia 1.4.0. I reindexed my testing content with WP-CLI...
I tested the WP Search with Algolia backend search. There were no differences in the results between WordPress standard search and WP Search with Algolia backend search. Paging through each result set worked as expected. Based on my testing, pagination appears to be behaving as expected with WP Search with Algolia v 1.4.0, WordPress 5.5.1, and a default Twenty* theme (in this test case Twenty Twenty). This leads me to believe there may be something specific to your environment that I cannot reproduce. Do you have any plugins or custom code that could be interfering with WP Search with Algolia's functionality? |
Hi @richaber, you're right. It was a conflicting plugin (facetwp) which was messing with the main_query. Sorry to bother you and thanks for the time spent researching! |
Describe the bug
Hi, I think I found a little bug in the backend search engine. The function
found_posts
inincludes/class-algolia-search.php:212
uses the function should_filter_query. But that function checks if it is a search query. But found posts is not a search query.I think you could just remove the check there since the
found_posts
function is only triggered from thepre_get_posts
function on line 155 which itself already checked if it should filter the query (on line 105)To Reproduce
Steps to reproduce the behavior:
found_posts
inincludes/class-algolia-search.php:212
Expected behavior
When using the algolia backend search engine, we want the found posts from there.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: