Add Efficient searching feature in Android App from Sqlite Database

I have one problem Table

ProblemTable id problemTitle problemDescription 1 machine got hand water Motor got jammed 2 motor is not working induction motor is not working 3 water connection is not proper water connectivity problem in city 4 electric power machine problem Electric power generator is not working 5 power down in my city Power down in city

I need to add searching feature, which may be keyword searching or full text search,both from description and title. Like if i search by "motor"

reasults will be 1 machine got hand water Motor got jammed 2 motor is not working induction motor is not working

if i search by "power down in city" Search result

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

How do i implement this form sqlite db full text as well as kewords search .If i have large no of rows 100K, what searching strategy will be good ? Please help me .

-------------Problems Reply------------

If you want to do full text search in sqlite you could use fts3

https://sqlite.org/fts3.html

Assuming you are using SQLiteOpenHelper the syntax would be something like this

// Full-text search index. Update using updateSessionSearchIndex method.
// Use the porter tokenizer for simple stemming, so that "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)");

Category:android Views:5 Time:2019-03-08

Related post

  • displaying special characters in android app from sqlite database 2011-01-19

    I have a Periodic table of elements app for android that stores most of it's data in string arrays. I am now trying to use an sqlite database instead of the arrays but am having a small problem. If I type 'android:text="¹"' directly into a TextView i

  • Database error when running Android app with SQLite database 2011-11-04

    Specific error: An Android app with an SQLite database fails when attempting to access data/data/package/databases Note: I am aware that many articles have been posted on Stackoverflow as well as a number of recommended sites concerning how to copy t

  • How can I add a searchview to my Android app? 2011-06-02

    I want to add a searchview to my Android app but I can't understand the documentation. I have added <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:includeInGlobalSearch="true" android:searchSuggestAuthority="diction

  • How can I add a search feature to a website that returns images? 2010-07-05

    I need to add a search feature to a website. Not being adept at PERL or PHP, I was thinking of adding a remotely hosted search CGI (like freefind or fusionbot). Alternately, I might end up trying to convert the HTML site to a Wordpress site (as I thi

  • Invoke an Android App from a WebPage 2010-11-11

    Hi Is it possible to invoke an Android App from a Web Page that i am displaying on the phone browser to the user. I know that this is possible from an another Android App using Intents. But i am not sure if this is possible from a WebPage. Thanks in

  • How to add non-free application in Android market from unsupported country (Latvia)? 2011-03-30

    How to add non-free application in Android market from unsupported country (Latvia)? --------------Solutions------------- Maybe you can provide your app to someone who you 'trust' in a country where Google allows developers to sell their apps. This p

  • Android App from Go programming language 2012-04-10

    I am hearing buzzes about Go programming language from google. Wikipedia describes it like this: "Go aims to provide the efficiency of a statically-typed compiled language with the ease of programming of a dynamic language". I was thinking that since

  • Stopping an Android app from console 2010-06-25

    Is it possible to stop an Android app from the console? Something like: adb stop com.my.app.package It would speed up our testing process so much. Right now we uninstall/install the app each time to make sure the manual test cases start with a clean

  • Starting One Android App from Another App 2011-03-12

    What is the best way to start one android app from another app? Is it to send custom broadcast event and have broadcast receiver of other app catch this event and do a start activity on something? Thanks --------------Solutions------------- Use an In

  • Debugging Android apps from JDB(within Emacs) 2011-09-11

    Ok, so I've been trying to debug Android apps from jdb. I run the emulator, install the app, run ddms and then I launch the app and then select it in DDMS. Now I run jdb with the following command jdb -attach localhost:8700 -sourcepath /project-root/

  • how to protect android app from .apk backup apps 2011-11-22

    How to prevent an android app from the apps which can make backup of .apk file. Apps like astro file manager lets user to do so, menu: tools -> backup more info here and one can backup any installed apk on sdcard. Later on, i can rename it to .zip

  • Preventing Android app from closing 2012-02-04

    Is it possible to prevent an Android app. from closing? Is it possible to do this without modifying the OS? I don't want the app. to close unless the user authenticates with a password or some other mechanism. I don't want any system settings changed

  • Can't download android app from eclipse to my device 2012-02-25

    I'm trying to run an android app from eclipse on my device (moto droid2). I've followed all the instructions I can find to set up both the device and my computer (Win7) so that I can run the app on my device. I'm not getting the option to download to

  • Connect android app with the database from a Website 2012-03-05

    I need the users to register to my website with login and password. basically i need to do the following 1.Connect android app with the database from a website. 2.Store some information into the database. 3.retrieve some information back from the dat

  • Trying to run android app from eclipse: stuck between "out of heap space" and "failed to create jvm" 2012-04-04

    I am trying to launch an android app from within eclipse. If my eclipse.ini contains -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502 -showspla

  • Loading large amount of data from Sqlite database in Android 2011-12-13

    I'm writing an Android application that has different parts, including a dictionary. To implement a dictionary, I used the following technique: 1- Reading all words from Sqlite database and storing them in array list. ( "select * from vocabulary" ) .

  • Android app that accesses database on server machine 2012-02-22

    I'm developing an android app that accesses Databases that are stored on a server machine. I've done a bit a of googling and had a look through some of my programming books but can't find much information. SQLite seems like the right way to go but I

  • android - How to open and retrieve data from database which copied from sqlite database browser database? 2012-03-14

    i'm new to android development. here i m copying my database from SQLite Database Browser to my system database. But when i try to open that newly created database.. i gets an error.. here is my Code DBAdapter.java public class DBAdapter extends SQLi

  • Having list of lat/long value from sqlite database, how to show on Google map in Android? 2011-12-09

    I have stored list of Latitude and Longitude value retrieved from sqlite database,How to draw line between these co-ordinates and show it in map view. Can anyone help me with some good examples. --------------Solutions------------- You can try these

  • How to display markers on google maps from sqlite database on Android 2013-05-15

    Firstly sorry for my bad english. I want to make a program that displays markers on google maps api v2 (android) taking coordinates from SQLite database. Do you know any examples, I am a novice in this topic. The database will be created manually, th

  • How to populate AutoCompleteTextView inside a ListView from SQLite database efficiently? 2012-01-27

    I am populating the ListView from my Custom DataAdaptor. I have a layout defined for each item/row of the listview. Inside that ListView i have an AutoCompleteTextView. I need to bind it with data from SQLite database. Actually this AutoCompleteTextV

  • How to remove html tags getting from sqlite database in android? 2012-02-10

    In my project I am getting data from sqlite database and setting that data to my textviews. But the data which I am getting contains html tags which is looking odd when I am displaying. Can we remove those html tags after getting them from database?

  • Not able to fetch data from Sqlite Database 2011-11-25

    I want to fetch data from SQLITE database and display it in a LIST. My database name is AppDB.db and table name is Scrip which contains 3 columns _id(primary key) and symbol&company_name which are text. I want to fetch only 2nd and 3rd column. I

  • How to Read Data from SQLite Database and show it on a list view 2012-01-20

    How to pull Data from SQLite Database and show it on a list view. I am doing this in my code, but I am getting an error: public class ShoewDataListActivity extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCre

  • how can i display two columns in listview. that columns data is coming from SQLite database 2010-12-28

    How can i display two columns in listview that columns data is coming from sqlite database?In that columns first column is TextView and another column is EditView. i have tried below code. But I got the following exception unable to start the activit

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.160 (s). 11 q(s)