/**
  * @param SearchDocumentFieldCollection $searchDocumentFieldCollection
  * @return string[]
  */
 private function getSearchDocumentFieldsAsArray(SearchDocumentFieldCollection $searchDocumentFieldCollection) : array
 {
     $searchDocumentFields = $searchDocumentFieldCollection->getFields();
     return array_reduce($searchDocumentFields, function ($searchDocumentFieldsArray, SearchDocumentField $field) {
         $searchDocumentFieldsArray[$field->getKey()] = $field->getValues();
         return $searchDocumentFieldsArray;
     }, []);
 }
 /**
  * @param SearchDocumentFieldCollection $fieldCollection
  * @return array[]
  */
 private static function getSearchDocumentFields(SearchDocumentFieldCollection $fieldCollection) : array
 {
     return array_reduce($fieldCollection->getFields(), function ($carry, SearchDocumentField $field) {
         return array_merge([$field->getKey() => $field->getValues()], $carry);
     }, []);
 }