Flush the log index right before searching. If the search starts before the AILoggerPlugin finishes flushing the log, it will appear as if there are no results.
SKIndexFlush is thread-safe, and according to the docs: "Before searching an index, always call SKIndexFlush, even though the flush process may take up to several seconds. If there are no updates to commit, a call to SKIndexFlush does nothing and takes minimal time.", so it will never hurt doing this here.
1.1 --- a/Source/AILogViewerWindowController.m Fri Feb 10 23:01:26 2012 +0100
1.2 +++ b/Source/AILogViewerWindowController.m Sat Feb 11 00:04:26 2012 +0100
1.3 @@ -1571,6 +1571,9 @@
1.4 [wildcardedSearchString appendFormat:@"%@ ", searchComponent];
1.5 }
1.6
1.7 + AILogWithSignature(@"Calling flush");
1.8 + SKIndexFlush(logSearchIndex);
1.9 + AILogWithSignature(@"Done flushing. Now we can search.");
1.10 thisSearch = SKSearchCreate(logSearchIndex,
1.11 (CFStringRef)wildcardedSearchString,
1.12 kSKSearchOptionDefault);