全文搜索在苹果的核心数据框架 [英] Full Text Searching in Apple's Core Data Framework

查看:264
本文介绍了全文搜索在苹果的核心数据框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iPhone应用程式中执行全文搜寻。我有数据存储在一个sqlite数据库,我通过Core Data框架访问。只是使用谓词和ORing一个contains [cd]短语为每个搜索字和列不能很好地工作。

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 predicates and ORing a bunch of "contains[cd]" phrases for every search word and column does not work well at all.

你做了什么,似乎工作得很好?

What have you done that seems to work well?

推荐答案

我们有FTS3在150,000多条记录上工作得很好。我们正在获得亚秒个查询时间,对单个关键字查询返回超过200个结果。

We have FTS3 working very nicely on 150,000+ records. We are getting subsecond query times returning over 200 results on a single keyword query.

目前,在iPhone上获得Sqlite FTS3的唯一方法是编译自己的二进制文件并将其链接到您的项目。据我所知,包含在您自己的项目中的二进制文件将不能与Core Data一起使用。也许苹果会在未来的版本中打开FTS3编译器选项?

Presently the only way to get Sqlite FTS3 working on the iPhone is to compile your own binary and link it to your project. To my knowledge, the binary included in your own project will not work with Core Data. Perhaps Apple will turn on the FTS3 compiler option in a future release?

你仍然可以链接到自己的Sqlite FTS3二进制文件,并仅用于全文搜索。这将非常类似于Sphinx或Lucene在Web App环境中使用的方式。请注意,您仍然需要在某一时刻更新搜索索引,以便与Core Data存储保持同步。

You can still link in your own Sqlite FTS3 binary and use it just for full text searches. This would be very similar to the way Sphinx or Lucene are used in Web App environments. Note you will still have to update the search index at some point to keep synchronicity with the Core Data stores.

祝你好运!

这篇关于全文搜索在苹果的核心数据框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆