public function create($rawDocument)
    {
        /** @var \Magento\Framework\Search\DocumentField[] $fields */

        $entityIdFieldName = $this->entityMetadata->getEntityId();

        $rawDocument[Document::ID] = $rawDocument[$entityIdFieldName];

        return $this->objectManager->create($this->instanceName, ['data' => $rawDocument]);
    }
public function create($rawDocument)
    {
        /** @var \Magento\Framework\Search\DocumentField[] $fields */

        $entityIdFieldName = $this->entityMetadata->getEntityId();

        $rawDocument[Document::ID] = $rawDocument[$entityIdFieldName];

        return $this->objectManager->create($this->instanceName, ['data' => $rawDocument]);
    }
public function create ( $ rawDocument ) { /** @var \Magento\Framework\Search\DocumentField[] $fields */ $ entityIdFieldName = $ this -> entityMetadata -> getEntityId ( ) ; $ rawDocument [ Document :: ID ] = $ rawDocument [ $ entityIdFieldName ] ; return $ this -> objectManager -> create ( $ this -> instanceName , [ 'data' => $ rawDocument ] ) ; }
Create search dcument instance from a ES hit.

@param array $rawDocument ES raw hit.

@return Document
Create search dcument instance from a ES hit .