yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

SQLite FTS support #204

Closed preetb123 closed 8 years ago

preetb123 commented 8 years ago

is there any way i can create FTS tables using squidb. If not then how can i achieve full text searching?

jdkoren commented 8 years ago

Absolutely! In the @TableModelSpec annotation, you can specify the module name for virtual tables (which include FTS):

@TableModelSpec(className="FtsModel", tableName="fts_models", moduleName="FTS4")
public class FtsModelSpec {
    // ...
}

When the annotation processor generates the model class, the static final TABLE field will be of type VirtualTable instead of Table.

For using the MATCH operation, you have StringProperty#match() for matching on the column, or you can use VirtualTable#match() for cases where you specify the table name instead of the column name before the MATCH operator.

preetb123 commented 8 years ago

thanks @jdkoren.

sbosley commented 8 years ago

Seems like this has been answered, but feel free to reopen if you have any problems with it.