{"id":16597376,"url":"https://github.com/cbess/cbsearchkit","last_synced_at":"2025-10-29T12:31:29.142Z","repository":{"id":14783105,"uuid":"17504966","full_name":"cbess/CBSearchKit","owner":"cbess","description":"Simple and flexible full text search for iOS and Mac. Uses the sqlite3 FTS3/4 engine.","archived":false,"fork":false,"pushed_at":"2023-03-19T15:31:27.000Z","size":98,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T01:31:42.650Z","etag":null,"topics":["fts","objective-c","search","sqlite3-fts3"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbess.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-07T06:25:08.000Z","updated_at":"2023-03-20T09:50:45.000Z","dependencies_parsed_at":"2022-09-02T23:40:35.423Z","dependency_job_id":null,"html_url":"https://github.com/cbess/CBSearchKit","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2FCBSearchKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2FCBSearchKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2FCBSearchKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbess%2FCBSearchKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbess","download_url":"https://codeload.github.com/cbess/CBSearchKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238825693,"owners_count":19537110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fts","objective-c","search","sqlite3-fts3"],"created_at":"2024-10-11T23:55:39.388Z","updated_at":"2025-10-29T12:31:28.739Z","avatar_url":"https://github.com/cbess.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"CBSearchKit\n===========\n\nSimple and flexible full text search for iOS and Mac. Using the sqlite3 FTS3/4 engine.\n\n## Setup\n\n- Link `libsqlite3.dylib`\n- Add `pod 'CBSearchKit', :git =\u003e 'https://github.com/cbess/CBSearchKit.git', :tag =\u003e 'v0.6.0'` to `Podfile`\n- Run `pod update`\n\n## Example Usage\n\n```objc\n- (NSArray *)buildIndex {\n    // create in-memory index\n    self.indexer = [[CBSIndexer alloc] initWithDatabaseNamed:nil];\n\n    CBSIndexDocument *document = [CBSIndexDocument new];\n    document.indexItemIdentifier = @\"one-id\";\n    document.indexTextContents = @\"this is one\";\n    document.indexMeta = @{@\"idx\": @1, @\"name\": @\"one\"};\n\n    CBSIndexDocument *document2 = [CBSIndexDocument new];\n    document2.indexTextContents = @\"this is two\";\n    document2.indexMeta = @{@\"idx\": @2, @\"name\": @\"two\"};\n\n    CBSIndexDocument *document3 = [CBSIndexDocument new];\n    document3.indexTextContents = @\"this is three\";\n    document3.indexMeta = @{@\"idx\": @3, @\"test\": @\"three\", @\"name\": @\"three\"};\n\n    NSArray *documents = @[document, document2, document3];\n\n    XCTestExpectation *expectation = [self expectationWithDescription:@\"build index\"];\n    [self.indexer addItems:documents completionHandler:^(NSArray *indexItems, NSError *error) {\n        XCTAssertNil(error, @\"unable to build the index\");\n        XCTAssertEqual(indexItems.count, documents.count, @\"wrong count indexed\");\n\n        [expectation fulfill];\n    }];\n\n    [self waitForExpectationsWithTimeout:3 handler:nil];\n\n    return documents;\n}\n\n- (void)testSearch {\n    NSArray *indexedDocuments = [self buildIndex];\n\n    XCTAssertEqual([self.indexer itemCount], indexedDocuments.count, @\"Bad count\");\n\n    id\u003cCBSIndexItem\u003e oneDoc = indexedDocuments.firstObject;\n    static NSString * const searchText = @\"one\";\n\n    XCTestExpectation *expectation = [self expectationWithDescription:@\"search index\"];\n\n    CBSSearcher *searcher = [[CBSSearcher alloc] initWithIndexer:self.indexer];\n    searcher.orderType = CBSSearcherOrderTypeRelevance;\n    [searcher itemsWithText:searchText itemType:CBSIndexItemTypeIgnore completionHandler:^(NSArray *items, NSError *error) {\n        XCTAssertEqual(items.count, 1, @\"Should be only one item\");\n        XCTAssertNil(error, @\"Error: %@\", error);\n\n        id\u003cCBSIndexItem\u003e item = items.lastObject;\n        NSDictionary *meta = [item indexMeta];\n\n        XCTAssertNotNil(meta, @\"No meta\");\n        XCTAssertEqualObjects(meta[@\"idx\"], [oneDoc indexMeta][@\"idx\"], @\"Wrong meta value\");\n        XCTAssertEqualObjects([item indexItemIdentifier], [oneDoc indexItemIdentifier], @\"Wrong index identifier\");\n\n        [expectation fulfill];\n    }];\n\n    [self waitForExpectationsWithTimeout:7 handler:nil];\n}\n```\n\nSee [unit tests](CBSearchKitTests) for more examples.\n\n[Soli Deo Gloria](http://perfectGod.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbess%2Fcbsearchkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbess%2Fcbsearchkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbess%2Fcbsearchkit/lists"}