Full Text Searching in Apple's Core Data Framework

前端 未结 5 643
感动是毒
感动是毒 2020-12-24 09:27

I would like to implement a full text search in an iPhone application. I have data stored in an sqlite database that I access via the Core Data framework. Just using predi

5条回答
  •  死守一世寂寞
    2020-12-24 10:13

    I assume that by "does not work well" you mean 'performs badly'. Full-text search is always relatively slow, especially in memory or space constrained environments. You may be able to speed things up by making sure the attributes you're searching against are indexed and using BEGINSWITH[cd] instead of CONTAINS[cd]. My recollection (can't find the cocoa-dev post at this time) is that SQLite will use the index for prefix matching, but falls back to linear search for infix searches.

提交回复
热议问题