-
Book Overview & Buying
-
Table Of Contents
MySQL 5.1 Plugin Development
We know the Boolean syntax of the MySQL built-in full-text parser. MySQL already supports it; there is no fun in reimplementing the same thing. To do something new we could make a parser that supports AND, OR, and NOT keywords, which is supposedly a more user-friendly syntax and our users may like it more than MySQL plus and minus prefixes.
How could our parser support such a syntax? It could, for example, by doing look-ahead, reading the next word before sending the current one to MySQL. If the next word is AND, the current one must have yesno=1. The idea is simple, but the devil, as always, is in the detail:
Both words before and after AND must have yesno=1.
To support foo AND NOT bar we may need to look two words ahead.
Typically, both words around OR must have yesno=0. But not if an AND is involved. In foo OR bar AND bla the second word must have yesno=1.
In a query string such as foo AND bar OR some AND thing we cannot simply have yesno=1 in all four words....
Change the font size
Change margin width
Change background colour