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

Bugfix: Squash bug in new array_simple search optimisation

This commit is contained in:
Starbeamrainbowlabs 2019-12-23 21:58:23 +00:00
parent 52fcd6a44a
commit 456f749ffe
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 8 additions and 7 deletions

View file

@ -10,7 +10,8 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- [security] Bugfix: Don't leak the PHP version in emails when expose_php is turned off - [security] Bugfix: Don't leak the PHP version in emails when expose_php is turned off
- Fixed handling of Unicode characters when emailing users - added new `email_subject_utf8` and `email_body_utf8` settings to control the new behaviour - Fixed handling of Unicode characters when emailing users - added new `email_subject_utf8` and `email_body_utf8` settings to control the new behaviour
- Add new `email_debug_dontsend` setting for debugging emails sent by Pepperminty Wiki - Add new `email_debug_dontsend` setting for debugging emails sent by Pepperminty Wiki
- Fixed pressing alt + enter to open a search in a new tab - it should no longer fail and briefly prompt to allow popups - Fixed pressing alt + enter to open a search in a new tab - it should no longer fail and briefly prompt to allow pop-ups
- Squashed a bug in the new upgraded get/set_array_simple search optimisation
## Changed ## Changed
- Improved the search indexing system performance - again - Improved the search indexing system performance - again

View file

@ -135,7 +135,7 @@
"version": "0.11", "version": "0.11",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.", "description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.",
"lastupdate": 1576615079, "lastupdate": 1577135005,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -347,11 +347,11 @@
"version": "0.10", "version": "0.10",
"author": "Emanuil Rusev & Starbeamrainbowlabs", "author": "Emanuil Rusev & Starbeamrainbowlabs",
"description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation.", "description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation.",
"lastupdate": 1572090277, "lastupdate": 1577135577,
"optional": false, "optional": false,
"extra_data": { "extra_data": {
"Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php", "Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/3825db53a2be5d9ce54436a9cc557c6bdce1808a\/Parsedown.php",
"ParsedownExtra.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown-extra\/f21b40a1973b6674903a6da9857ee215e8839f96\/ParsedownExtra.php", "ParsedownExtra.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown-extra\/352d03d941fc801724e82e49424ff409175261fd\/ParsedownExtra.php",
"ParsedownExtreme.php": "https:\/\/raw.githubusercontent.com\/BenjaminHoegh\/parsedown-extreme\/adae4136534ad1e4159fe04c74c4683681855b84\/ParsedownExtreme.php" "ParsedownExtreme.php": "https:\/\/raw.githubusercontent.com\/BenjaminHoegh\/parsedown-extreme\/adae4136534ad1e4159fe04c74c4683681855b84\/ParsedownExtreme.php"
} }
} }

View file

@ -994,7 +994,7 @@ class search
if(!self::$invindex->has("|termlist|")) if(!self::$invindex->has("|termlist|"))
self::$invindex->set("|termlist|", []); self::$invindex->set("|termlist|", []);
$termlist = self::$invindex->get("|termlist|"); $termlist = self::$invindex->get("|termlist|");
error_log(var_export($removals, true));
// Remove all the subentries that were removed since last time // Remove all the subentries that were removed since last time
foreach($removals as $nterm) { foreach($removals as $nterm) {
// Delete the offsets // Delete the offsets
@ -1009,7 +1009,7 @@ class search
if($termlist_loc !== false) array_splice($termlist, $termlist_loc, 1); if($termlist_loc !== false) array_splice($termlist, $termlist_loc, 1);
} }
else else
self::$invindex->get_arr_simple($nterm, $nterm_pageids); self::$invindex->set_arr_simple($nterm, $nterm_pageids);
} }
// Merge all the new / changed index entries into the inverted index // Merge all the new / changed index entries into the inverted index