测试已测试 | ✗ |
语言语言 | CC |
许可证 | MIT |
发布最新发布 | 2014年12月 |
由 Francis Chong 维护。
依赖 | |
FMDB/独立 | >= 0 |
sqlite3 | >= 0 |
CocoaLumberjack | >= 0 |
一个简单的支持中日韩语言的 Objective-C 全文搜索引擎。
使用 CocoaPods,将以下内容添加到你的 Podfile
pod 'IGSearch'
运行 pod install
,然后你就可以开始了!
首先,创建一个数据库。
IGSearch* search = [[IGSearch alloc] initWithPath:aPath];
然后,索引文档。
[search indexDocument:@{@"title": @"Street Fighter 4", @"system": @"Xbox 360"} withId:@"1"];
[search indexDocument:@{@"title": @"Super Mario Bros", @"system": @"NES"} withId:@"2"];
[search indexDocument:@{@"title": @"Sonic", @"system": @"Mega Drive"} withId:@"3"];
[search indexDocument:@{@"title": @"Mega Man", @"system": @"NES"} withId:@"4"];
搜索文档很简单
[search search:@"Street"]; // @[ @{@"title": @"Street Fighter 4", @"system": @"Xbox 360"} ]
[search search:@"Mega" withField:@"title"]; // @[ @{@"title": @"Mega Man", @"system": @"NES"} ]
或者只搜索文档 ID
[search search:@"Mega" withField:@"title" fetchIdOnly:YES]; // @[ @"4" ]
使用了来自Mozilla Thunderbird的 SQLite porter stemmer,Mozilla Public License 许可证。
本软件使用 MIT 许可证。