         #if os(Android)
         // FTS queries for strings containing hyphens isn't working in SQLite on
         // Android, so disable for now.
-        useSearchIndices.put(false)
+        self.useSearchIndices.put(false)
         #else
         do {
             let ftsPackages = """

    func searchPackages(identifiers: [Model.CollectionIdentifier]? = nil,
                        query: String,
                        callback: @escaping (Result<Model.PackageSearchResult, Error>) -> Void) {
        if self.useSearchIndices.get() ?? false {
            var matches = [(collection: Model.CollectionIdentifier, package: PackageIdentity)]()
            var matchingCollections = Set<Model.CollectionIdentifier>()


            """
            try db.exec(query: ftsTargets)

            self.useSearchIndices.put(true)
        } catch {
            // We can use FTS3 tables but queries yield different results when run on different
            // platforms. This could be because of SQLite version perhaps? But since we can't get
            // consistent results we will not fallback to FTS3 and just give up if FTS4 is not available.
            self.useSearchIndices.put(false)
        }
        #endif

