public function deleteDocument($resource, $context, $specId = array())
    {
        $query = array(_ID_KEY . '.' . _ID_RESOURCE => $this->labeller->uri_to_alias($resource),  _ID_KEY . '.' . _ID_CONTEXT => $context);
        try {
            $searchTypes = array();
            if (!empty($specId)) {
                $specTypes = $this->config->getSearchDocumentSpecifications($this->storeName, null, true);
                if(is_string($specId))
                {
                    if(!in_array($specId, $specTypes))
                    {
                        return;
                    }
                    $query[_ID_KEY][_ID_TYPE] = $specId;
                    $searchTypes[]  = $specId;
                }
                elseif(is_array($specId))
                {
                    // Only filter on search document spec types
                    $specId = array_intersect($specTypes, $specId);
                    if(empty($specId))
                    {
                        return;
                    }
                    $query[_ID_KEY . '.' . _ID_TYPE] = array('$in'=>array_values($specId));
                    $searchTypes = $specId;
                }
            }
            foreach($this->config->getCollectionsForSearch($this->storeName, $searchTypes) as $collection)
            {
                $collection->deleteMany($query);
            }
        } catch (\Exception $e) {
            throw new \Tripod\Exceptions\SearchException("Failed to Remove Document with id \n" . print_r($query, true), 0, $e);
        }
    }