Indexer.php
/**
     * Indicates whether an URL already has been indexed or not.
     *
     * @param string $uri
     * @param array $metadata
     *
     * @return boolean
     */
Indicates whether an URL already has been indexed or not.
@param string $uri
@param array $metadata

@return boolean
Indicates whether an URL already has been indexed or not . @param string $uri @param array $metadata @return boolean
public function isUrlIndexedandNotExpired($uri, array $metadata = [])
    {
        $this->setCoreNameFromMetadata($metadata);
        $currentDate = new DateTime();
        $queryPhrase = sprintf(
            "id:%s AND revisit_expiration:[%s TO *]",
            sha1(strtolower($uri)),
            $currentDate->format('Y-m-d\TH:i:s\Z')
        );
        $query = $this->client->createSelect();
        $query->setQuery($queryPhrase);
        $result = $this->client->select($query);
        return ($result->getNumFound() > 0);
    }
public function isUrlIndexedandNotExpired ( $ uri , array $ metadata = [ ] ) { $ this -> setCoreNameFromMetadata ( $ metadata ) ; $ currentDate = new DateTime ( ) ; $ queryPhrase = sprintf ( " id:%s AND revisit_expiration:[%s TO *] " , sha1 ( strtolower ( $ uri ) ) , $ currentDate -> format ( 'Y-m-d\TH:i:s\Z' ) ) ; $ query = $ this -> client -> createSelect ( ) ; $ query -> setQuery ( $ queryPhrase ) ; $ result = $ this -> client -> select ( $ query ) ; return ( $ result -> getNumFound ( ) > 0 ) ; }
Indicates whether an URL already has been indexed or not.
Indicates whether an URL already has been indexed or not .