Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-2201 now.

incorrect use of str_replace in fulltext_mysql (fix completed in vcs)

the following segment appears in fulltext_mysql.php:
Code: Select all
      if (sizeof($this->replace_synonym))
      {
         $text = str_replace($this->replace_synonym, $this->match_synonym, $text);
      }


this is, of course, wrong, because str_replace() will substitute parts of a word, while the "synonyms" mechanism should only be used for full words.
just to demonstrate, if $text contains the string "cartridge", this code, using the english synonym tables, will change it to "automobiletridge" (and then, maybe, cut it because it's too long... :( )

in general, since the synonyms are not used at all with fulltext_native, and their use is dubious at best with fulltext_mysql, i think the best thing to do would be to scrap the whole idea, remove the synonym table (btw: was the table itself ever debugged? why should "whack" be replaced with "wack", and what is "wack" anyway? who says "vol" is "volume"? can't it be "voluntary"? etc. etc.) from the language directory, and make the thing a bit simpler.

no user is going to complain when they can't find a word that was spelled wrong, either in the message or the search string. otoh, if i search for car* expecting to find carburetor and carpool, i don't want the machine to look for automobile*.

to summarize: please get rid of the synonyms

Comments / History

Assigned ticket to user "naderman"

Action performed by DavidMJ (Former Team Member) on Apr 1st 2007, 00:43

Edited ticket

Action performed by DavidMJ (Former Team Member) on Apr 1st 2007, 00:43

Changed ticket status from "New" to "Reviewed"

Action performed by naderman (Development Team Leader) on Apr 1st 2007, 12:31

Posted by naderman (Development Team Leader) on Apr 1st 2007, 12:31

Well I have no idea why synonym code is still in there :S

Changed ticket status from "Reviewed" to "Fix in progress"

Action performed by naderman (Development Team Leader) on Apr 1st 2007, 19:04

Linked ticket with changeset: r7261

Action performed by naderman (Development Team Leader) on Apr 1st 2007, 22:15

Posted by arod-1 on Apr 1st 2007, 22:40

thanks for removing it from fulltext_mysql, but there are still some residues to the "synonym" thingy, both in search.php and in synonyms.php

same for ignore_words.
it is important to remove get_synonyms() and get_ignore_words() from search.php, but it is even more important to remove the synonyms.php and ignore_words.php from the languages/en directory, and let the translation teams know that these files are not used, and please do not translate them.
right now several dozens of translation teams are busy creating translations of olympus to many languages, and it's a pity if these people are wasting time and energy on useless things.

also, i think it will be nice to make a note on the translations forum on the community section for the translator to skip these files when translating.

Changed ticket status from "Fix in progress" to "Fix completed in CVS"

Action performed by naderman (Development Team Leader) on Apr 1st 2007, 22:57

Posted by naderman (Development Team Leader) on Apr 1st 2007, 22:57

They are just not currently being used, the long term plan is to support these features again. But this will probably not happen in 3.0, however other search backends might want to make use of these files. The fulltext_sphinx backend we use here on phpbb.com uses the english ignore_words file for example.

Ticket details

Related SVN changesets