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

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;
}
}
}