     }
 
     private func removeFromSearchIndices(identifier: Model.CollectionIdentifier) throws {
-        guard self.useSearchIndices.get() ?? false else { return }
+        guard try self.shouldUseSearchIndices() else { return }
 
         let identifierBase64 = try self.encoder.encode(identifier.databaseKey()).base64EncodedString()
 

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

            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.
            useSearchIndices.put(false)
        }
        #endif


    func findPackage(identifier: PackageIdentity,
                     collectionIdentifiers: [Model.CollectionIdentifier]?,
                     callback: @escaping (Result<Model.PackageSearchResult.Item, Error>) -> Void) {
        let useSearchIndices: Bool
        do {
            useSearchIndices = try self.shouldUseSearchIndices()
        } catch {
            return callback(.failure(error))
        }

        if useSearchIndices {
            var matches = [(collection: Model.CollectionIdentifier, package: PackageIdentity)]()
            var matchingCollections = Set<Model.CollectionIdentifier>()

