Thanks Dan, didn't realize that NOT completely replaced -, thought you could use them side by side.
All OK now Mike > -----Original Message----- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Dan > Sent: 21 January 2009 17:14 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] FTS3 - operator > > > On Jan 21, 2009, at 11:43 PM, Mike Marshall wrote: > > > Hi all > > > > > > > > Quick question > > > > > > > > Should the - operator work in FTS in conjunction with the phrase > > operator > > > > > > > > i.e. router -"ip address" > > sqlite3_step returns SQLITE_ERROR which leads me to believe its > > invalid but > > the question is should it be invalid, it seems a perfectly valid use > > of the > > syntax to me. > > Hi, > > I don't think that has ever worked. The documentation has: > > A token that is not part of a quoted phrase may be preceded by a '-' > character, which indicates that matching rows must not contain the > specified term. > > See here for more: > > http://www.sqlite.org/cvstrac/fileview?f=sqlite/ext/fts3/ > README.syntax > > Also, new versions of Fts3 support two different syntaxes. The legacy > syntax that is enabled by default and the enhanced syntax that is > enabled by defining SQLITE_ENABLE_FTS3_PARENTHESIS at compile time. > > The enhanced syntax does not support the '-' operator at all. Instead, > it uses the binary operator NOT. When using the enhanced syntax, you > can do: > > <column> MATCH 'router NOT "ip address"' > > and things will work as expected. > > Dan. > > > > > > > > > > > > > > My code is > > > > > > > > sqlite3_stmt* pStatement; > > > > char* acSQLQuery = sqlite3_mprintf("SELECT * FROM data WHERE story > > MATCH > > '%q'",acQuery); > > > > nRet = sqlite3_prepare_v2(pDB,acSQLQuery,-1,&pStatement,0); > > > > nRet = sqlite3_step(pStatement); > > > > > > > > Thanks for any help or pointers, or even just letting me know it's a > > bug so > > I can raise a ticket. > > > > > > > > Mike > > > > > > > > > > > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users