<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
    <channel>
        <title>Web-Site-Scripts.com - Search Issues</title>
        <link>https://www.web-site-scripts.com/knowledge-base/category/92</link>
        <description><![CDATA[Root / KnowledgeBase Manager Pro / Troubleshooting / Search Issues]]></description>
        <language>en-us</language>
        <generator>KnowlageBase RSS Generator</generator>

         
                <item>
                        <title>Correct search by codes, IDs, and short acronyms</title>
                                    <link>https://www.web-site-scripts.com/knowledge-base/article/AA-00543</link>
                                    <description><![CDATA[<p>You may notice that by default you cannot search for words that consist of 3 characters or less. This usually makes you unable able to search for some strings that may be considered as a single word, but they are really not, e.g. IDs, codes, reference numbers, short acronyms, etc. It happens because, when full-text search index created for an article (or attachment, or any other searchable item), all symbols (e.g. points, slashes, hyphens, etc.) get replaced by whitespaces, for example you got this text:</p>
<p></p>
<div class="preformatted">
<div class="preformattedContent">AAA-BBB-111</div>
</div>
<p>its search index is this:</p>
<p></p>
<div class="preformatted">
<div class="preformattedContent">
AAA BBB 111<br></div>
</div>
<p>Since each part is 3 characters long, you will not find this text &nbsp;using neither "AAA-BBB-111" for search phrase, nor "AAA BBB 111".</p>
<p>If you would like to be able to search for such strings, you need to decrease minimum length of words to be indexed in MySQL settings (my.ini). For that:</p>
<p>Add this line under the&nbsp;<span style="line-height: 13px; ">[mysqld] section:</span></p>
<p></p>
<div class="preformatted">
<div class="preformattedContent">
<pre class="code-java">ft_min_word_len=3<br></pre></div>
</div>And the same line under the&nbsp;<span style="line-height: 13px; ">[myisamchk] section:</span><div class="preformatted"><div class="preformattedContent">
<pre class="code-java">ft_min_word_len=3</pre></div></div><p>If there is no [myisamchk] section in the my.ini yet, you just need to add it at the end of the file and place ft_min_word_len=3 on the next line:</p><p><div class="preformatted">
<div class="preformattedContent"><pre class="code-java">[myisamchk]
ft_min_word_len=3</pre></div>
</div>
<p>The code above sets minimum length of words to be searched to 3. You can try to decrease it to 2, but be careful because search may start to return inaccurate results.</p></p>
<p>Then restart the MySQL server.</p>
<p>Now you need to rebuild the full-text indexes by running the following MySQL queries (you can run them from MySQL command line, or via any MySQL management tool like phpMyAdmin or HeidiSQL).</p>
<p></p>
<div class="preformatted">
<div class="preformattedContent"><div class="preformattedContent">USE <span style="background-color: rgb(255, 255, 0);">kmp_database</span>;</div><div class="preformattedContent">REPAIR TABLE search_index QUICK;</div></div>
</div>
<p>Be sure to use the real name for the database you're using for KMP instead of "kmp_database". Also, if you're using table prefix, you need to specify it in the table name, e.g.: prefix_search_index.</p>
<p></p>
<p></p>
<p></p>
<div class="attention">
<div class="attentionHeader">Warning<br></div>
<div class="attentionContent">
<p>
Please note that each&nbsp;<span style="font-family: monospace; line-height: 13px; white-space: pre;">ft_min_word_len=3</span> setting must go to its section. So you need to find the&nbsp;<span style="font-family: monospace; line-height: 13px; white-space: pre;">[mysqld]</span>&nbsp;section in my.ini and insert the&nbsp;<span style="font-family: monospace; line-height: 13px; white-space: pre;">ft_min_word_len=3 </span>there. Then you search for the&nbsp;<span style="font-family: monospace; line-height: 13px; white-space: pre;">[myisamchk] </span>section and add&nbsp;<span style="font-family: monospace; line-height: 13px; white-space: pre;">ft_min_word_len=3 </span>to it. If section doesn't exist, you can create it.</p>
</div>
</div>
<p><br></p>
<p></p>
<p></p>
]]></description>
                                    <pubDate>Wed, 11 Aug 2010 14:27:43 +0000</pubDate>
                                    <guid>https://www.web-site-scripts.com/knowledge-base/article/AA-00543</guid>
                    </item>
                
    </channel>
</rss>