6

My English skill is not good. So please try to understand what I say. Thank you !

I want to create a Android dictionary app but I'm not experienced on it. I did a research and there are 2 choices for creating database: Lucene and SQLite Full Text Search. So I made an app as some tutorials.I find that FTS use a Virtual Table to store database but the probblem is the app freeze when adding data to Virtual Table at the first time (from text file about 10000 line). The searching function also takes long time (about 10 seconds)

Then, I find some others tutorials about Lucene. Lucene create an indexed directory for searching but I do not know how fast it is (with large data). Anyone could give me some advices on my problem?

Hoang Lam
  • 523
  • 8
  • 23
  • What advises you looking for? Comparison between them based on perfomance? Also, specify which search features you need – Mysterion Apr 02 '14 at 12:45
  • @Mysterion Can you tell me how to load data to Virtual Table quickly?Also, I want to know whether FTS index data for us or we have to index data by ourself (for quick searching)? – Hoang Lam Apr 02 '14 at 16:01
  • Well, are you sure that Lucene runs on Android runtime? – Chiron Apr 03 '14 at 08:32
  • @Chiron I'm not sure. Are there any methods that help load data from file to SQLite data table faster? – Hoang Lam Apr 03 '14 at 12:23
  • Maybe this answer will give you the right decision: [link](http://stackoverflow.com/questions/737275/comparison-of-full-text-search-engine-lucene-sphinx-postgresql-mysql?rq=1) – blueware Apr 12 '15 at 09:35
  • Did you find an answer? – Suragch Apr 16 '15 at 07:18

2 Answers2

2

I have not used Lucene for FTS yet, but you can make a virtual table in SQLite. However, the downside of virtual table in SQLite is that the storage space almost doubles.

"I find that FTS use a Virtual Table to store database but the probblem is the app freeze when adding data to Virtual Table at the first time (from text file about 10000 line). The searching function also takes long time (about 10 seconds) " Alternatively, you can make a virtual table beforehand and just add the sqlite database to the assets folder.

John61590
  • 1,106
  • 1
  • 13
  • 29
2

I suggest you to use sqlite with fts4. Three strong reason

  1. sqlite is android os feature. it's supported very well in android, and many people use it.
  2. Well extendable, not only fts feature support but other feature support.
  3. if you thing the index building time is two long, just build the index before you build the apk, and put it into asset. 10000 lines wording size db will not take 500ms to copy from asset to /data/data
Nikhil Maheshwari
  • 2,198
  • 18
  • 25
Jimmy Chen
  • 177
  • 5