src/snac/server/elastic/ElasticSearchUtil.php
/**
     * Write or Update Resource Indices
     *
     * Writes the given resource to the resource indices in Elastic Search.  If they already exist in ES, they
     * are updated. If not, they are inserted.
     *
     * @param \snac\data\Resource $resource The resource object to insert/update in Elastic Search
     */
Write or Update Resource Indices
Writes the given resource to the resource indices in Elastic Search.  If they already exist in ES, they
are updated. If not, they are inserted.

@param \snac\data\Resource $resource The resource object to insert/update in Elastic Search
Write or Update Resource Indices Writes the given resource to the resource indices in Elastic Search . If they already exist in ES they are updated . If not they are inserted . @param \ snac \ data \ Resource $resource The resource object to insert / update in Elastic Search
public function writeToResourceIndices(&$resource) {
        if ($this->connector != null) {
            $params = [
                'index' => \snac\Config::$ELASTIC_SEARCH_RESOURCE_INDEX,
                'id' => $resource->getID(),
                'body' => [
                    'id' => (int) $resource->getID(),
                    'title' => $resource->getTitle(),
                    'url' => $resource->getLink(),
                    'abstract' => $resource->getAbstract(),
                    'type' => $resource->getDocumentType()->getTerm(),
                    'type_id' => (int) $resource->getDocumentType()->getID(),
                    'timestamp' => date('c')
                ]
            ];
            $this->connector->index($params);
            $this->logger->addDebug("Updated elastic search with new resource");
        }
    }
public function writeToResourceIndices ( & $ resource ) { if ( $ this -> connector != null ) { $ params = [ 'index' => \ snac \ Config :: $ ELASTIC_SEARCH_RESOURCE_INDEX , 'id' => $ resource -> getID ( ) , 'body' => [ 'id' => ( int ) $ resource -> getID ( ) , 'title' => $ resource -> getTitle ( ) , 'url' => $ resource -> getLink ( ) , 'abstract' => $ resource -> getAbstract ( ) , 'type' => $ resource -> getDocumentType ( ) -> getTerm ( ) , 'type_id' => ( int ) $ resource -> getDocumentType ( ) -> getID ( ) , 'timestamp' => date ( 'c' ) ] ] ; $ this -> connector -> index ( $ params ) ; $ this -> logger -> addDebug ( " Updated elastic search with new resource " ) ; } }
Write or Update Resource Indices
 Writes the given resource to the resource indices in Elastic Search.
Write or Update Resource Indices Writes the given resource to the resource indices in Elastic Search .