/**
  * @param SearchDocument $searchDocument
  * @return mixed[]
  */
 private function getArrayRepresentationOfSearchDocument(SearchDocument $searchDocument) : array
 {
     return [self::PRODUCT_ID => (string) $searchDocument->getProductId(), self::FIELDS => $this->getSearchDocumentFieldsAsArray($searchDocument->getFieldsCollection()), self::CONTEXT => $this->getContextAsArray($searchDocument->getContext())];
 }
 /**
  * @param SearchDocument $document
  * @return string[]
  */
 public static function fromSearchDocument(SearchDocument $document) : array
 {
     $context = $document->getContext();
     return array_merge([SolrSearchEngine::DOCUMENT_ID_FIELD_NAME => $document->getProductId() . '_' . $context, SolrSearchEngine::PRODUCT_ID_FIELD_NAME => (string) $document->getProductId()], self::getSearchDocumentFields($document->getFieldsCollection()), self::getContextFields($context));
 }