Locayta Search Mobile A full text search library for iOS

 All Classes Functions Properties Pages
Locayta Search Mobile for iOS - API Documentation

Locayta Search Mobile for iOS is a framework for embedding a full text search engine within Apple iOS (iPhone, iPod Touch and iPad) applications.

It allows you to index any number of segments of text or data ("field values") for each item you wish to search ("document"), then search across all the documents quickly.

The following simplified code will create and index a document (see Creating & Updating Search Databases via API for full example including error checking and memory management):

LSLocaytaSearchIndexer *searchIndexer = [[LSLocaytaSearchIndexer alloc] initWithDatabasePath:databasePath delegate:self];
NSDictionary *searchSchema = [[NSDictionary alloc] initWithContentsOfFile:schemaFile];
LSLocaytaSearchIndexableRecord *indexableRecord = [[LSLocaytaSearchIndexableRecord alloc] initWithSchema:searchSchema];
[indexableRecord addValue:@"document01" forField:@"id" error:&error]
[indexableRecord addValue:@"my document title" forField:@"title" error:&error]
[indexableRecord addValue:@"the quick brown fox jumps over the lazy dog" forField:@"content" error:&error]
[searchIndexer addOrReplaceRecord:indexableRecord]; // Asynchronous with callback

The following code will search the index for a user-provided query string (see Performing Search Queries for full example):

NSString *searchDatabasePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"my_search_db"];
LSLocaytaSearchRequest *searchRequest = [[LSLocaytaSearchRequest alloc] initWithDatabasePath:searchDatabasePath delegate:self];
LSLocaytaSearchQuery *searchQuery = [LSLocaytaSearchQuery queryWithQueryString:@"quick brown fox"];
[searchRequest searchWithQuery:searchQuery topDocIndex:0 docsPerPage:50]; // Asynchronous with callback

This manual is divided into the following sections: