mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-26 05:32:59 +00:00
Bugfix the inverted index. Fixes #34.
This commit is contained in:
parent
bf2da0b28c
commit
05026b9045
3 changed files with 6 additions and 6 deletions
|
@ -1591,7 +1591,7 @@ class search
|
||||||
|
|
||||||
public static function rebuild_invindex()
|
public static function rebuild_invindex()
|
||||||
{
|
{
|
||||||
global $pageindex;
|
global $pageindex, $env, $paths;
|
||||||
|
|
||||||
$invindex = [];
|
$invindex = [];
|
||||||
foreach($pageindex as $pagename => $pagedetails)
|
foreach($pageindex as $pagename => $pagedetails)
|
||||||
|
@ -1602,7 +1602,7 @@ class search
|
||||||
self::merge_into_invindex($invindex, ids::getid($pagename), $index);
|
self::merge_into_invindex($invindex, ids::getid($pagename), $index);
|
||||||
}
|
}
|
||||||
|
|
||||||
self::save_invindex("invindex.json", $invindex);
|
self::save_invindex($paths->searchindex, $invindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds proper search functionality to Pepperminty Wiki. Note that this module, at the moment, just contains test code while I figure out how best to write a search engine.",
|
"description": "Adds proper search functionality to Pepperminty Wiki. Note that this module, at the moment, just contains test code while I figure out how best to write a search engine.",
|
||||||
"id": "feature-search",
|
"id": "feature-search",
|
||||||
"lastupdate": 1447053773,
|
"lastupdate": 1447267196,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds an action to allow administrators to move pages.",
|
"description": "Adds an action to allow administrators to move pages.",
|
||||||
"id": "page-move",
|
"id": "page-move",
|
||||||
"lastupdate": 1447266379,
|
"lastupdate": 1447266462,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,7 +187,7 @@ class search
|
||||||
|
|
||||||
public static function rebuild_invindex()
|
public static function rebuild_invindex()
|
||||||
{
|
{
|
||||||
global $pageindex;
|
global $pageindex, $env, $paths;
|
||||||
|
|
||||||
$invindex = [];
|
$invindex = [];
|
||||||
foreach($pageindex as $pagename => $pagedetails)
|
foreach($pageindex as $pagename => $pagedetails)
|
||||||
|
@ -198,7 +198,7 @@ class search
|
||||||
self::merge_into_invindex($invindex, ids::getid($pagename), $index);
|
self::merge_into_invindex($invindex, ids::getid($pagename), $index);
|
||||||
}
|
}
|
||||||
|
|
||||||
self::save_invindex("invindex.json", $invindex);
|
self::save_invindex($paths->searchindex, $invindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue