Skip to content

Commit cb681ab

Browse files
committed
fix-issue-20716
1 parent 2b27bc0 commit cb681ab

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

app/code/Magento/Search/Model/ResourceModel/SynonymReader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ protected function _construct()
8585
*/
8686
private function queryByPhrase($phrase)
8787
{
88+
$phrase = rtrim($phrase, "-");
8889
$matchQuery = $this->fullTextSelect->getMatchQuery(
8990
['synonyms' => 'synonyms'],
9091
$phrase,

app/code/Magento/Search/Model/SynonymAnalyzer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public function getSynonymsForPhrase($phrase)
5454
return $result;
5555
}
5656

57+
$phrase = rtrim($phrase, "-");
58+
5759
$synonymGroups = $this->getSynonymGroupsByPhrase($phrase);
5860

5961
// Replace multiple spaces in a row with the only one space

0 commit comments

Comments
 (0)