First, I have to say that I was very happy to see a folder full of search modules. Overall I found your plugin really well-designed and laid out. The suggestions below are really minor but I thought I’d pass along my thoughts, for what little they’re worth.
It wasn’t terribly difficult to create my own module, but there was a couple of things that would have made it easier. Both these suggestions are in the engine files, specifically for me, mysql.php.
1) if you used $wp_query->query instead of $_GET, then code run in earlier hooks could modify $wp_query and get the expected results when your plugin does its magic.
2) My module actually narrows the search rather than expands it, so the AND %var% LIKE… construction didn’t work. I had to put a special test in the code to use NOT IN for my module. It worked for me but isn’t very general.
The simple solution to that would be to let the module supply its full AND clause, but then the plugin would have to know what engine was running. To do this right I guess you would have to create an abstraction of the clause that each engine could interpret. That may be too much work for the limited number of cases, but you would increase the versatility of your modules significantly. Such an abstraction would also allow you to move some of your logic out of the database-specific engine files, which would reduce maintenance long-term.
Anyway, thanks for making this plugin, and thanks for doing it well.
- The topic ‘[Plugin: Search Unleashed] Simplifying creating custom modules’ is closed to new replies.