Sqlite FTS using OR between match operators

When I execute the following query in sqlite engine (android or sqlitebrowser) it throws an exception that says unable to use function MATCH in the requested context

.

select
    a.Body1,
    b.Body2
from
    tbl1_fts  as a,
    tbl2_fts  as b
where
    a.ID = b.ParentID and

    (
        a.Body1 match('value') or
        b.Body2 match('value')
    )

      

-Large tables have fts .
-Used operator And

between two matches (instead of OR

).

How can I fix this or change the query to find rows with the above condition?

+3


source to share


2 answers


you cannot use OR Operation, just change the Match keyword. like SELECT * FROM docs WHERE docs MATCH 'sqlite OR database';

OR perhaps you can use union



SELECT docid FROM docs WHERE docs MATCH 'sqlite AND database' UNION SELECT docid FROM docs WHERE docs MATCH 'library';

+1


source


MATCH has two parameters as a function:

... WHERE match('value', SomeColumn) ...

      



However, the common way to use MATCH is with the operator:

... WHERE SomeColumn MATCH 'value' ...

      

+1


source







All Articles