Not able to use more than one Match functions

112 views Asked by At

I am not able to use more than one match functions in filter() of Query where single match() working fine but when i start to use more than two match() it gives error like

assertion failed: unable to use function MATCH in the requested context: file /Users/rspl/Desktop/Tests/SqliteSwiftDemo/SqliteSwiftDemo/SQLiteSwift/Statement.swift, line 196

following example creates a problem:

emails.filter(  match("xyz", body) && match("wonder*", body))

is there any other alternate available ? or i made mistake.

I just want two simultaneous match from same or different columns.

2

There are 2 answers

2
ielyamani On

FTS only allows one 'MATCH' per SELECT statement. You can try this

emails.filter(match("xyz", body)).filter(match("wonder*", body))
0
diyoda_ On

You can use only one MATCH in a Select statement, But you can use the following to achieve this,

SELECT * FROM fts_table WHERE fts_table MATCH 'A:XXX OR B:YYY' assuming that A,B are column names