Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FTS support #272

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add FTS support #272

wants to merge 2 commits into from

Conversation

@emmx
Copy link

@emmx emmx commented Sep 17, 2014

I added full-text search support in ActiveRecord. It's basically a flag in the table annotation.

@Table(name = "cars", fts = "4")
public class Car extends Model {
   //...
}

Here "4" is just the version of the FTS engine. Behind the scene it creates a virtual table instead of a normal table if this flag is used.

PS: My editor screwed some lines converting TABs into spaces. There's a good reason not to use TABs to indent code!!

@kenjiru
Copy link

@kenjiru kenjiru commented Oct 15, 2014

Nice work. I would like to see this feature in.

@emmx
Copy link
Author

@emmx emmx commented Oct 28, 2014

I've updated and fixed a couple more things regarding FTS support in ActiveAndroid.

There must be taken into account that FTSs tables in SQLite does not support any kind of constraint restriction (not even primary key validation, check the docs). For that a hidden column called /rowid/ shoud be used.

I've added all of that into the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants