SQLITE FTS3: Search string in column

Is there a way to search for a specific string in a column?

I want to search for SELECT *from email_fts WHERE email_fts MATCH’ to: “[email protected]” or from: “[email protected]”‘

Thanks in advance ,

Mano

make sure to create the correct FTS column in the FTS index :

CREATE VIRTUAL TABLE email_fts USING fts3(subject, body, "to", "from");

Then you can search for a single FTS column:

SELECT rowid 
FROM email_fts
WHERE "to" MATCH'[email protected]'

UNION

SELECT rowid
FROM email_fts
WHERE "from" MATCH'[email protected]'

Edit: My previous answer is in the WHERE clause There is an OR. Obviously SQLite does not support combining OR queries with MATCH conditions. The above union is valid.

The FTS document is here, and this is one of the examples used in the document.

http://sqlite.org/fts3.html

Is there a way to search for a specific string in a column?

I want to search for SELECT *from email_fts WHERE email_fts MATCH’ to: “[email protected]” or from: “[email protected]”‘

Thanks in advance ,

Mano

Make sure to create the correct FTS column in the FTS index:

< /p>

CREATE VIRTUAL TABLE email_fts USING fts3(subject, body, "to", "from");

Then you can search for a single FTS column:

SELECT rowid 
FROM email_fts
WHERE "to" MATCH'[email protected]'

UNION

SELECT rowid
FROM email_fts
WHERE "from" MATCH'[email protected]'

Edit: My previous answer has an OR in the WHERE clause. Obviously sqlite does not support OR query with MATCH conditions are combined. The above unions are valid.

The FTS document is here, this is one of the examples used in the document.

http://sqlite.org/fts3.html< /p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 874 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.