Add Efficient searching feature in Android App from Sqlite Database -


i have 1 problem table

    problemtable     id  problemtitle                        problemdescription     1   machine got hand                    water motor got jammed     2   motor not working                induction motor not working     3   water connection not proper      water connectivity problem in city     4   electric power machine problem      electric power generator not working     5   power down in city               power down in city  

i need add searching feature, may keyword searching or full text search,both description , title. if search "motor"

 reasults      1   machine got hand                    water motor got jammed     2   motor not working                induction motor not working 

if search "power down in city" search result

4   electric power machine problem      electric power generator not working  5   power down in city               power down in city 3   water connection not proper      water connectivity problem in city  

how implement form sqlite db full text kewords search .if have large no of rows 100k, searching strategy ? please me .

if want full text search in sqlite use fts3

https://sqlite.org/fts3.html

assuming using sqliteopenhelper syntax

 // full-text search index. update using updatesessionsearchindex method.  // use porter tokenizer simple stemming, "frustration" matches "frustrated." db.execsql("create virtual table " + tables.sessions_search + " using fts3("             + basecolumns._id + " integer primary key autoincrement,"             + sessionssearchcolumns.body + " text not null,"             + sessionssearchcolumns.session_id                     + " text not null " + references.session_id + ","             + "unique (" + sessionssearchcolumns.session_id + ") on conflict replace,"             + "tokenize=porter)"); 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -