Count search results
Permalink 2 users found helpful
Hello everyone,
Is it possible to count the total amount of search results when using the search block ?
Like when you use yahoo.com. yahoo shows the total amount of search results to the left like this:
"43,300,000 results for
concrete5"
So far i have tried with this line of code.
But it only counts the amount of search results on the current page.
If pagination is active, it should add the total result count on the other pages too, but it doesn't.
Please help. :)
Thank you in advance
Is it possible to count the total amount of search results when using the search block ?
Like when you use yahoo.com. yahoo shows the total amount of search results to the left like this:
"43,300,000 results for
concrete5"
So far i have tried with this line of code.
But it only counts the amount of search results on the current page.
If pagination is active, it should add the total result count on the other pages too, but it doesn't.
Please help. :)
Thank you in advance
Hello Mnkras,
Thank you for your answer.
Well it still only counts the amount of search results on 1 page. If i got 3 pages with search results, I need those results to be included in the total result count too.
Isn't that possible ?
The core files for the search function must include an array that contains all the search results when using the search block. ?
Can anyone help me locate these core files for the search function. Maybe that could be the answer for my problem. :)
Thank you in advance.
Thank you for your answer.
Well it still only counts the amount of search results on 1 page. If i got 3 pages with search results, I need those results to be included in the total result count too.
Isn't that possible ?
The core files for the search function must include an array that contains all the search results when using the search block. ?
Can anyone help me locate these core files for the search function. Maybe that could be the answer for my problem. :)
Thank you in advance.
echo 'Total: '. $paginator->result_count;
Pretty simple... Thank You!
$pages = $pagination->getTotalResults();
at the top of the php.
then:
<?php echo $pages; ?>
Best Mathias
at the top of the php.
then:
<?php echo $pages; ?>
Best Mathias
i didn't try with pagination (don't feel like makin pages)
if you want to see where i put it search for
//search results text
in the code