     }
     
     /// Search the local mirror.
-    @objc public func searchMirror(query: Query, completionHandler: CompletionHandler) {
+    @objc public func searchMirror(query: Query, completionHandler: CompletionHandler) -> NSOperation {
+        let queryCopy = Query(copy: query)
         let callingQueue = NSOperationQueue.currentQueue() ?? NSOperationQueue.mainQueue()
-        self.offlineClient.searchQueue.addOperationWithBlock() {
-            self._searchMirror(query) {
-                (content, error) -> Void in
-                callingQueue.addOperationWithBlock() {
+        let operation = NSBlockOperation()
+        operation.addExecutionBlock() {
+            let (content, error) = self._searchMirror(query)
+            callingQueue.addOperationWithBlock() {
+                if !operation.cancelled {
                     completionHandler(content: content, error: error)
                 }
             }
         }
+        self.offlineClient.searchQueue.addOperation(operation)
+        return operation
     }
     
     /// Search the local mirror synchronously.
-    private func _searchMirror(query: Query, completionHandler: CompletionHandler) {
+    private func _searchMirror(query: Query) -> (content: [String: AnyObject]?, error: NSError?) {
         assert(!NSThread.isMainThread()) // make sure it's run in the background
         assert(self.mirrored, "Mirroring not activated on this index")
         

    ///
    @objc public func browseMirrorFrom(cursor: String, completionHandler: CompletionHandler) -> NSOperation {
        let callingQueue = NSOperationQueue.currentQueue() ?? NSOperationQueue.mainQueue()
        let operation = NSBlockOperation() {
            let query = Query(parameters: ["cursor": cursor])
            self._browseMirror(query) {
                (content, error) -> Void in
                callingQueue.addOperationWithBlock() {
                    completionHandler(content: content, error: error)
                }
            }

    /// Same semantics as `Index.browse()`.
    ///
    @objc public func browseMirror(query: Query, completionHandler: CompletionHandler) -> NSOperation {
        let queryCopy = Query(copy: query)
        let callingQueue = NSOperationQueue.currentQueue() ?? NSOperationQueue.mainQueue()
        let operation = NSBlockOperation()
        operation.addExecutionBlock() {
            let (content, error) = self._browseMirror(queryCopy)
            callingQueue.addOperationWithBlock() {
                if !operation.cancelled {
                    completionHandler(content: content, error: error)
                }
            }
