Language name search: don't match on short infix terms

These are often punctuation, prepositions, articles which add
more noise than useful matches.

Bug: T358862
Change-Id: I364ef629049471410cc1b3dd9b5df5de1515097b
This commit is contained in:
Niklas Laxström
2024-03-07 11:54:00 +02:00
committed by jenkins-bot
parent 5d69081678
commit 814a62926a
2 changed files with 6 additions and 893 deletions

View File

@@ -80,7 +80,12 @@ class LanguageNameIndexer extends Maintenance {
$type = 'prefix'; $type = 'prefix';
$display = $translation; $display = $translation;
if ( $index > 0 && count( $words ) > 1 ) { if ( $index > 0 ) {
// Avoid creating infix entries for short strings like punctuation, articles, prepositions...
if ( mb_strlen( $word ) < 3 ) {
continue;
}
$type = 'infix'; $type = 'infix';
$display = "$word$translation"; $display = "$word$translation";
} }

File diff suppressed because it is too large Load Diff