You are here:  » Advanced search node 1224 + Maximum results


Advanced search node 1224 + Maximum results

Submitted by APZ215 on Thu, 2019-02-14 09:32 in

Hello David

Is it possible to create/show a maximum number of search results (or adjust the number of pages) by adjusting the makeIndex.php?

Sometimes I get thousands of search results and for example 100 search results is more than enough to show the website visitor.

This is an expansion on:
Advanced Search @ https://www.pricetapestry.com/node/1224

Greetings Arlo

Submitted by support on Thu, 2019-02-14 09:59

Hello Arlo,

Sure - you can cap the number of result pages linked as required - edit search.php and look for the following code at line 347:

    $resultCount = $rowsResultCount[0]["resultcount"];

...and REPLACE with:

    $maxPages = 100;
    $resultCount = $rowsResultCount[0]["resultcount"];
    $maxResults = ($config_resultsPerPage * $maxPages);
    if ($resultCount > $maxResults) $resultCount = $maxResults;

Adjust value for $maxPages as required...

Cheers,
David.
--
PriceTapestry.com

Submitted by APZ215 on Thu, 2019-02-14 13:26

Thank you David for the quick and good solution.
It must feel good to be able to write code :-)

Greetings Arlo