views:

48

answers:

1

I need to support full text search for a 10 mb document and wondering if I should implement FTS with CoreData or Sqlite3. I am familiar with CoreData and not too fond of Sqlite3. Anyone with experience care to enlighten me? What other options do i have? Thanks!

+1  A: 

It'll be pretty hard to better Core Data by doing it by hand, so try Core Data first; it will be quicker anyway to get your app / tests going. On an iOS device Core Data will use a sqlite database anyway. I've got good results with an in-app database of 3-4Mbytes using Core Data, and without any special coding.

petert
Thanks for your reply Peter! Yeah, I just hacked out a quick test app with CoreData with help of FTS3 tutorial I found. The problem I am seeing is that the 10 mb db has been bloated to 50+ megs after indexing all the keywords. Is this normal? Thanks!
Unikorn
Core Data isn't perfect, so it does still help to known about efficient data modelling, knowing it'll come down to sql eventually. I'm guessing you've already read Apple's Core Data Programming guide, the "Core Data Performance" chapter is the one to read - http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/CoreData/Articles/cdPerformance.html%23//apple_ref/doc/uid/TP40003468-SW1. Of course it gives help with benchmarking, remember to try core data in Instruments.
petert
Yeah, indexing the keywords for the fts seems to be a bit costly; but the search result time improved immensely. My guess is rolling a different fts method would probably cut down on the memory require for indexing.
Unikorn