Jump to content

Rebuild search index effectively


Fabrizio Carloni

Recommended Posts

Do you know if there is a way to bypass the web server (Apache) and rebuild search index from shell scripts? I use Prestashop 1.7.7.5 with PHP 7.4 and I would like to have the webserver free from a heavy workload during indexing for the benefit of user navigation.

Best regards,
Fabrizio.

Link to comment
Share on other sites

Searching on the internet I found this article https://netlogica.it/blog/72-prestashop-come-reindicizzare-il-database-prodotti-in-modo-efficace (in Italian) which proposes this script:

script prestashopNetlogicaIndexer.php

<?php
    // Netlogica hack - Prestashop search indexing

    echo "\n".'Starting Netlogica Indexing Hack...'."\n";
    $timeStart = microtime(true);

    include({path_fisico_hosting}.'/config/config.inc.php');
    Search::indexation(1);

    $timeEnd = microtime(true);
    $executionTime = ($timeEnd - $timeStart);
    echo '-> index complete '.$executionTime.' sec.'."\n\n";
?>

Do you think it can also work on Prestashop 1.7.7.5?

Thank you and greetings,
Fabrizio.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...