mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +00:00
Rebuild the inverted index if it doesn't exist on search.
This commit is contained in:
parent
c6442565bf
commit
d55132fd19
1 changed files with 5 additions and 0 deletions
|
@ -30,6 +30,11 @@ register_module([
|
|||
add_action("search", function() {
|
||||
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"]))
|
||||
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>"));
|
||||
|
||||
|
|
Loading…
Reference in a new issue