Issue Bug Closed

#88557Indexed Search: generates identical word ids for different words

Dan Ilea 06/13/19, 14:26 updated 03/29/20, 18:14

Description

Because of the method used for hashing it, there are cases when a word id (wid) is a duplicate of the hash for a different word.
And the following error occurs because wid is primary key in the index_words table:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: An exception occurred while executing ‘INSERT INTO `index_words` (`wid`, `baseword`, `metaphone`) VALUES (?, ?, ?)’ with params [36468906, “nussholz”, “76382384"]: Duplicate entry ‘36468906’ for key ‘PRIMARY’ | Doctrine\DBAL\Exception\UniqueConstraintViolationException thrown in file deploy/releases/177/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php in line 66.

Test case:

\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash('nam')
and
@\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash(‘nussholz’)@

will both return 36468906

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.