search: properly apply weightings in titlels and tags

This commit is contained in:
Starbeamrainbowlabs 2021-02-10 22:17:38 +00:00
parent b2a783e903
commit 77880d9410
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
2 changed files with 3 additions and 2 deletions

View File

@ -18,6 +18,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
## Fixed
- [security] Fixed some potential XSS attacks in the page editor
- Fixed a weird bug in the `stats-update` action causing warnings
- search: Properly apply weightings of matches in page titles and tags
## v0.22

View File

@ -865,7 +865,7 @@ class search
if(!isset($matching_pages[$pageid]))
$matching_pages[$pageid] = $match_template; // Assign by copy
$matching_pages[$pageid]["rank_title"] += $title_matches_count * $term_def["weight"];
$matching_pages[$pageid]["rank_title"] += $title_matches_count * $term_def["weight"] * $settings->search_title_matches_weighting;
}
}
@ -886,7 +886,7 @@ class search
if(!isset($matching_pages[$pageid]))
$matching_pages[$pageid] = $match_template; // Assign by copy
$matching_pages[$pageid]["rank_tags"] += $tag_matches_count * $term_def["weight"];
$matching_pages[$pageid]["rank_tags"] += $tag_matches_count * $term_def["weight"] * $settings->search_tags_matches_weighting;
}
}
}