SQlite3 fts deny search

Hi and thanks for watching!

I am looking for articles containing specific strings with full text search, something like this:

SELECT * FROM Articles_fts WHERE body MATCH 'monkey OR banana OR "hungry gorilla"'; 

My real search is much longer (22 words) and probably not the smartest way to do this, but it works, so there is no problem.

I need help ... Now I want to return OPPOSITE to what this search returns. In other words, I want all articles that do not contain monkeys, bananas or "hungry gorillas."

Thank you very much in advance!

+1
full-text-search negation sqlite3
Feb 26 '15 at 13:36
source share
1 answer

NOT available only when SQLite was compiled with the extended FTS query syntax .

Otherwise, you can use SQL set operations to negate the result:

 SELECT * FROM Articles WHERE id NOT IN (SELECT docid FROM Articles_fts WHERE body MATCH '...') 
+1
Feb 26 '15 at 15:27
source share



All Articles