Skip to content

Commit 280f931

Browse files
authored
[3] Fixing search suggestions for mixed-case searches (#33942)
* Fixing search suggestions for mixed-case searches * Fixing mapping table lookup
1 parent 95d8d44 commit 280f931

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/com_finder/models/suggestions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function getListQuery()
7070
// Limit term count to a reasonable number of results to reduce main query join size
7171
$termIdQuery->select('ti.term_id')
7272
->from($db->quoteName('#__finder_terms', 'ti'))
73-
->where('ti.term LIKE ' . $db->quote($db->escape($this->getState('input'), true) . '%', false))
73+
->where('ti.term LIKE ' . $db->quote($db->escape(StringHelper::strtolower($this->getState('input')), true) . '%', false))
7474
->where('ti.common = 0')
7575
->where('ti.language IN (' . $db->quote($this->getState('language')) . ', ' . $db->quote('*') . ')')
7676
->order('ti.links DESC')
@@ -96,7 +96,7 @@ protected function getListQuery()
9696
->order('t.weight DESC');
9797

9898
// Determine the relevant mapping table suffix by inverting the logic from drivers
99-
$mappingTableSuffix = StringHelper::substr(md5(StringHelper::substr($this->getState('input'), 0, 1)), 0, 1);
99+
$mappingTableSuffix = StringHelper::substr(md5(StringHelper::substr(StringHelper::strtolower($this->getState('input')), 0, 1)), 0, 1);
100100

101101
// Join mapping table for term <-> link relation
102102
$mappingTable = $db->quoteName('#__finder_links_terms' . $mappingTableSuffix);

0 commit comments

Comments
 (0)