Latest | 0.3.2 |
---|---|
Homepage | https://github.com/siuying/IGSearch |
License | MIT |
Platforms | ios 5.1, osx 10.8, requires ARC |
Dependencies | FMDB/standalone, sqlite3, CocoaLumberjack |
Authors | , |
A simple Objective-C full text search engine with CJK support.
Why
- Core Data search do not built in full text search.
- SQLite3 bundled with iOS do not have proper tokenizer that support CJK language full text search.
- A simple and easy to use API, independent with the data model.
Setup
Use CocoaPods, add following to your Podfile
pod 'IGSearch'
Run pod install
and you’re off!
Usage
First, create a database.
IGSearch* search = [[IGSearch alloc] initWithPath:aPath];
Then, index documents.
[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 the document is simple:
[search search:@"Street"]; // @[ @{@"title": @"Street Fighter 4", @"system": @"Xbox 360"} ]
[search search:@"Mega" withField:@"title"]; // @[ @{@"title": @"Mega Man", @"system": @"NES"} ]
Or search only the document ID:
[search search:@"Mega" withField:@"title" fetchIdOnly:YES]; // @[ @"4" ]
Credits
Use SQLite porter stemmer from Mozilla Thunderbird, Mozilla Public License.
License
This software is licensed in MIT License.
Latest podspec
{ "name": "IGSearch", "version": "0.3.2", "summary": "A simple Objective-C full text search engine with CJK support.", "homepage": "https://github.com/siuying/IGSearch", "authors": { "Francis Chong": "[email protected]", "Steven Gravell": "[email protected]" }, "source": { "git": "https://github.com/siuying/IGSearch.git", "tag": "0.3.2" }, "platforms": { "ios": "5.1", "osx": "10.8" }, "source_files": [ "IGSearch/Classes/*.{h,m}", "vendor/sqlite3-fts-cjk/fts3/*.{h,m,c}" ], "requires_arc": true, "license": { "type": "MIT", "file": "LICENSE.md" }, "dependencies": { "FMDB/standalone": [], "sqlite3": [], "CocoaLumberjack": [] } }
Tue, 01 Mar 2016 06:34:03 +0000