Site search
Full-text search
Full-text search is a natural language search which checks for full words only. Generally, anything that's alphabetic or numeric, including accented characters, is part of a word, anything that's not alphabetic or numeric (even "-") is not part of a word and is therefore used as a separator.
To search for a partial word use * at the end of your search keyword. For example "train*" will match words "train", "trains", "trainer" etc. Note that this makes the search considerably slower.
Full-text search has a relevancy ranking which shows correlation between the searched words occurrence in the database and times found in the search results. The relevancy rating differs when you are doing an advanced search or using * at the end of search keyword. In these cases, the relevancy only shows how many hits the particular word got. Search results are by default sorted by relevancy.
Priority keywords
The default article profile has a field for keywords which are included in the search so that the article can be given better relevancy and ranked higher in the results. The search results are prioritised to show the articles that have a match in the keywords before the other articles.
Note for developers: The MySQL full-text search sets some limitations to the search(http://dev.mysql.com/doc/refman/4.1/en/fulltext-restrictions.html) of which most important is the search words length - by default the word must be between 4 to 256 characters. You can change these settings just by following the instructions at http://dev.mysql.com/doc/refman/4.1/en/fulltext-fine-tuning.html.
Migrating from pre 4.3.1 to current versions
If you have a custom search form (usually in page template) change the field name of the keyword from 'otsi' to 'query' (this isn't mandatory, but makes more sense). Add a hidden field for 'op' and point it to your search results template, the default is 'search'. Example of a search form would be:
<form action="{$self}" method="GET">
<input type="hidden" name="op" value="search">
<input type="text" name="query">
<input type="submit" value="Search">
</form>
Pre 4.3.1 enabled the search template by employing an if statement in the page template, something like this:
{if $smarty.get.otsi} {* or $smarty.post.otsi *}
{print_content tpl="search_results"}
{else}
{print_content}
{/if}
You can now eliminate this if block, if the search template has an 'op' defined and it is present in the search form as described above
RSS