Blog Search Shows Only 1 Page of Results - Paginated Pages Are Blank

  • Using this for the search results:

    PHP
    1. <?php
    2. perch_content_search(perch_get('q'), [
    3. 'apps' => ['PerchBlog'],
    4. 'sort' => 'postDateTime',
    5. 'sort-order' => 'ASC',
    6. 'count' => '9',
    7. 'template'=>'search-result.html',
    8. ]);
    9. ?>

    I'm getting 12 results for a search of "test". Yet the page shows the first 9 results, then the second page is blank. In fact ALL searches are showing the first 9 results then all the remaining pages, even if there are 100 results, are all blank. What is missing from the code to where it's following the count, but only on one page?

  • dosa

    Changed the title of the thread from “Blog Search Show Extra Page in Pagination With No Results” to “Blog Search Shows Only 1 Page of Results - Paginated Pages Are Blank”.
  • Here you go hus_hmd - the debug message is below in two comments since it's beyond the 10,000 character limit per post.


    Code
  • Debug continued....

  • Awesome! That did it. I didn't realize it had to be specifically off, I commented it out thinking that removed it. So I guess there was a pagination loop happening. Thanks for the fix!


    On a related note, what is the search searching - blog post titles, descriptions, content, all?