1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

Rebuild the inverted index if it doesn't exist on search.

This commit is contained in:
Starbeamrainbowlabs 2015-12-05 17:27:01 +00:00
parent c6442565bf
commit d55132fd19

View file

@ -30,6 +30,11 @@ register_module([
add_action("search", function() { add_action("search", function() {
global $settings, $env, $pageindex, $paths; global $settings, $env, $pageindex, $paths;
// Create the inverted index if it doesn't exist.
// todo In the future perhaps a CLI for this would be good?
if(!file_exists($paths->searchindex))
search::rebuild_invindex();
if(!isset($_GET["query"])) if(!isset($_GET["query"]))
exit(page_renderer::render("No Search Terms - Error - $settings->sitename", "<p>You didn't specify any search terms. Try typing some into the box above.</p>")); exit(page_renderer::render("No Search Terms - Error - $settings->sitename", "<p>You didn't specify any search terms. Try typing some into the box above.</p>"));