Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL fulltext search for html entities
    primarykey
    data
    text
    <p>I have to hack a content management system to support fulltext search for a language that contains special characters. These are stored in the database as html entities. Out of the box, the CMS doesn't support it. The bug was reported long time ago, but apparently it has no priority. I'm stick to this CMS, the customer is awaiting my solution, so I have to hack it. Damn...</p> <p>Ok... the CMS stores it's content by translating special characters into html entities (this is actualy done by the bundled editor). So the german word "möchten" gets "m&amp;ouml;chten" in the DB. The CMS creates a query string like</p> <pre><code>SELECT * FROM `SiteTree` WHERE MATCH( Content ) AGAINST (&lt;SEARCH_STRING&gt; IN BOOLEAN MODE); </code></pre> <p>The table is of type MyISAM, the field has a FULLTEXT index.</p> <p>If you use "m&amp;ouml;chten" as search string, MySQL will match every page, as &amp; is a operator that will do crazy things if it's present in the search string. The search will not work. </p> <p>Next idea is to replace the special character by an &#42; as placeholder. But this will also match several words, as soon as you have anything starting with an "m" and another following word ending with an "chten". I don't know why, but replacing only the ampersand with an asterisk (so searching for "m&#42;ouml;chten") will also lead to similar results.</p> <p>The same problem was described <a href="http://eric.persson.tm/?id=public:mysql_fulltext_index_htmlentities" rel="nofollow noreferrer">here</a>.</p> <p>Ok, folks, I need your help! Any ideas?</p> <p><strong>Edit:</strong> Converting the content to UTF-8 is no option.</p> <p>Thanks! <br> craesh</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload