The example from the documentation uses the enhanced query syntax.
Check that PRAGMA compile_options;
includes ENABLE_FTS3_PARENTHESIS
.
That your NEAR
query does not work is not a problem with compilation options:
> SELECT * FROM docs WHERE docs MATCH '(database OR sqlite) NEAR/5 system';
Error: malformed MATCH expression: [(database OR sqlite) NEAR/5 system]
The problem is that, according to the documentation, NEAR
does work only with basic search expressions:
A NEAR query is specified by putting the keyword "NEAR" between two phrase, term or prefix queries.
So you have to rewrite your search expression accordingly:
> SELECT * FROM docs WHERE docs MATCH '(database NEAR/5 system) OR (sqlite NEAR/5 system)';
a database is a software system
sqlite is a software system