Short, 2-3 character searches typically don't work with standard MySQL implementations, especially with shared hosting. This module fixes that.
The core of the search function uses MySQL do perform the search query. However, MySQL system variables limit the minimum word length (ft_min_word_len) and exclude some words (ft_stopword_file). These parameters are often read-only for shared hosting accounts (e.g. GoDaddy). This seriously sucks, especially if you have a bunch of 2-3 letter tags.
So, this module pads all search terms and search queries with a prefix to make them longer than 2-3 letters. To the user, the search queries and results are the same, but to MySQL, they've all gotten longer. In this way, we circumvent the limitations.
Tested and functioning well on Gallery v3.0.2.
Note that this module alters the search_records table in your SQL database. Because of that, during deactivation or uninstallation, the module will automatically flag all search records for rebuild. Afterward, you'll need to run the Update Search Records function once again before the standard search function will work properly.
Also note that this module must be ordered after anything that generates search records (e.g. comments and tag modules). This is likely to occur by default, but if not, get the moduleorder module .
For most users, the default settings should work fine. However, you can change the prefix as you desire. Here are some pointers:
The default of "1Z" was chosen since typically, it allows two-character searches and is unlikely to match any excluded words.
Note that anytime you change the prefix, you must rebuild the search_records database. Check the appropriate box on the admin settings screen and hit save. Then, run the Update Search Records function in the Admin -> Maintenance menu.
The screen also allows you to flag all search records as up-to-date, which could be useful as an "undo" of the previous step. However, beware: if before you marked them all for rebuild there in fact were a few that were out of date, that information will be lost! When in doubt, don't use this feature.
Made compatible will all boolean SQL special characters (ref http://codex.gallery2.org/Gallery3:Modules:search and http://dev.mysql.com/doc/refman/4.1/en/fulltext-boolean.html)