From 2dacc5f99cb86fe7c8c30e058dbc600142337e68 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 21 Apr 2020 22:13:08 +0100 Subject: [PATCH] Disable the didyoumean typo correction engine by default & add it to the changelog --- Changelog.md | 9 +++++++++ modules/feature-search-didyoumean.php | 2 +- peppermint.guiconfig.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 3d9b930..74d26ec 100644 --- a/Changelog.md +++ b/Changelog.md @@ -22,6 +22,11 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t - Wiki administrators with terminal/console access can now make use of a brand-new CLI by executing `php ./index.php` (warning: strange things will happen if the current working directory is not the directory that contains index.php and peppermint.json) - Added new `anoncomments` setting to control whether anonymous users are allowed to make comments (disabled by default) - thanks to @SeanFromIT for suggesting it in #181 - Added markdown support for media captions (#184) + - Finally: *Experimental* didyoumean support. Ever made a typo in a search query? The new didyoumean engine can correct query terms that are up to 2 characters out! + - It's disabled by default (check out the new `search_didyoumean_enabled` setting), as it enabling it comes with a significant performance impact when typos are corrected (~0.8s-ish / typo is currently observed) + - Uses the words in the search index as a base for corrections (so if you have a typo on a page, then it will correct it to the typo) + - The index does _not_ currently update when you edit a page - this feature is still _very_ experimental (please report any issues) + - A typo is a search query term that is both not a stop word and not found in the search index ### Fixed - Fixed weighted word support on search query analysis debug page @@ -50,6 +55,10 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t - [Module Api] Add new `absolute` and `html` optional boolean arguments to `render_timestamp()` - [Module Api] `search::extract_context()` and `search::highlight_context()` now take in a _parsed_ query (with `search::stas_parse()`), not a raw string +### Known bugs + - Wow, a new section! Haven't seen one of these before. Hopefully we don't see it too often..... + - The didyoumean search query typo correction engine does not currently update it's index when you save an edit to a page (the typo correction engine is still under development). + ## v0.20.3-hotfix3 - Squash password-based warning (#182, thanks, @SeanFromIT!) diff --git a/modules/feature-search-didyoumean.php b/modules/feature-search-didyoumean.php index 2e7dcbd..4153eb9 100644 --- a/modules/feature-search-didyoumean.php +++ b/modules/feature-search-didyoumean.php @@ -3,7 +3,7 @@ register_module([ "name" => "Did you mean? support", "version" => "0.1", "author" => "Starbeamrainbowlabs", - "description" => "Ever searched for something but couldn't find it because you couldn't spell it correctly? This module is for you! It adds spelling correction for search queries based on the words in the inverted search index.", + "description" => "*Experimental* Ever searched for something but couldn't find it because you couldn't spell it correctly? This module is for you! It adds spelling correction for search queries based on the words in the inverted search index.", "id" => "feature-search-didyoumean", "depends" => [ "lib-search-engine", "lib-storage-box" ], "code" => function() { diff --git a/peppermint.guiconfig.json b/peppermint.guiconfig.json index 1c1c3f7..ff4df0b 100644 --- a/peppermint.guiconfig.json +++ b/peppermint.guiconfig.json @@ -228,7 +228,7 @@ "search_characters_context_total": { "type": "number", "description": "The total number of characters that a search result context should display at most.", "default": 250 }, "search_title_matches_weighting": { "type": "number", "description": "The weighting to give to search term matches found in a page's title.", "default": 10 }, "search_tags_matches_weighting": { "type": "number", "description": "The weighting to give to search term matches found in a page's tags.", "default": 3 }, - "search_didyoumean_enabled": { "type": "checkbox", "description": "Whether to enable the 'did you mean?' search query typo correction engine.", "default": true }, + "search_didyoumean_enabled": { "type": "checkbox", "description": "Whether to enable the 'did you mean?' search query typo correction engine.", "default": false }, "search_didyoumean_editdistance": { "type": "number", "description": "The maximmum edit distance to search when checking for typos. Increasing this number causes an exponential increase in the amount of computing power required to correct all spellings.", "default": 2 }, "search_didyoumean_cost_insert": { "type": "number", "description": "The insert cost to use when calculating levenshtein distances. If this value is changed then the did you mean index must be rebuilt.", "default": 1 }, "search_didyoumean_cost_delete": { "type": "number", "description": "The delete cost to use when calculating levenshtein distances. If this value is changed then the did you mean index must be rebuilt.", "default": 1 },