One of our clients requested to be able to do "boolean" searches on a view. This small patch adds an additional operator onto the string filter allowing SQL IN BOOLEAN MODE Expression to be selected. This filter operator uses MySQL's IN BOOLEAN MODE keyword for the MATCH() AGAINST() full-text syntax. ( see http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html )
About the Patch:
I'm no expert on patches I'm afraid, but I've rolled up a little patch against the CVS HEAD, I think this is in the correct format, if there are any problems with the patch feedback would be appreciated :)
Potential Issues:
- This patch is using MySQL syntax, postgres has some support for boolean operators in fulltext mode i think, but i've no idea of the details. Thus this patch would probably fail badly under pgsql.
- IN BOOLEAN MODE is a full-text search. While it can work on tables without a FULLTEXT index, it will perform poorly. Its out of scope of this patch to fiddle with the indices really, but this probably is an issue to let people blindly select an operator that might cause their view to grind to a halt on queries against a large number of rows.
- IN BOOLEAN MODE is innately case-insensitive. This means that this operator does not obey the state of the "Case sensitive" checkbox in the filter configuration. (in the code $upper is unused).
| Comment | File | Size | Author |
|---|---|---|---|
| views-boolean-mode.patch | 1.38 KB | Kaso |
Comments
Comment #1
dawehnerAre you sure about the version? I think you mean drupal6. Additional i don't like to do something, which does not support other databases.
Comment #2
merlinofchaos commentedHmm, yeah. While mysql is the 90% database, we do support postgres and moving forward, other databases as well. Not sure how I feel about this. Will ponder.
Comment #3
Kaso commentedI agree that lack of pgsql is an issue. I have changed this to "Needs Work" and will take a look at doing this in a more platform agnostic manner.
Comment #4
esmerel commentedIf work is actually being done here, please update and move back to an active status.
Comment #5
merlinofchaos commentedYeah, we're avoiding supporting MySQL only features. You'll have to add your boolean mode in your own handlers and alters.