CBLView *fullTextView = [database viewNamed: @"fullText"];
[fullTextView setMapBlock: MAPBLOCK({
if ([doc[@"type"] isEqualToString:@"TFFormEntry"]) {
NSDictionary *valuesDict = doc[@"values"];
NSArray *keys = valuesDict.allKeys;
// get keys from all the forms and build up one big search index somehow.
for (NSString *key in keys) {
if (([key hasSuffix:@"text"] || [key hasSuffix:@"note"] || [key hasSuffix:@"email"] || [key hasSuffix:@"web_site"] || [key hasSuffix:@"location"] || [key hasSuffix:@"contact"])) {
NSString *value = valuesDict[key];
if ([NSString ts_isNotEmptyString:value]) {
emit(CBLTextKey(value), doc);
}
}
}
}
}) reduceBlock: NULL version: @"1"];
On Jun 17, 2015, at 6:14 AM, Brendan Duddridge <bren...@gmail.com> wrote:How can I make sure that documents would come back from the search that contained "Terminator" ONLY when it occurs in the value corresponding to the "fieldId-3-note" field?
On Jun 17, 2015, at 4:29 PM, Brendan Duddridge <bren...@gmail.com> wrote:Perhaps one alternative might be for me to prefix the value with the field identifier and then whenever I query, I could include the value they enter prefixed with the field identifier? So something like:
Although that also depends on how SQLite is compiled. I compile my own because I use SQLCipher.
On Jun 18, 2015, at 8:12 AM, Brendan Duddridge <bren...@gmail.com> wrote:Will SQLite at least always be an option?