original_string: public function newFromElasticResults(Array $hit)
      {
          $instance = $this->newInstance(array(), true);
  
          $attributes = $hit['_source'];
  
          $instance->isDocument = true;
  
          if (isset($hit['_score'])) {
              $instance->documentScore = $hit['_score'];
          }
  
          if (isset($hit['_version'])) {
              $instance->documentVersion = $hit['_version'];
          }
  
          if (isset($hit['highlight'])) {
              foreach ($hit['highlight'] as $field => $value) {
                  $instance->highlighted[$field] = $value[0];
              }
          }
  
          $instance->setRawAttributes($attributes, true);
  
          return $instance;
      }
code: public function newFromElasticResults(Array $hit)
      {
          $instance = $this->newInstance(array(), true);
  
          $attributes = $hit['_source'];
  
          $instance->isDocument = true;
  
          if (isset($hit['_score'])) {
              $instance->documentScore = $hit['_score'];
          }
  
          if (isset($hit['_version'])) {
              $instance->documentVersion = $hit['_version'];
          }
  
          if (isset($hit['highlight'])) {
              foreach ($hit['highlight'] as $field => $value) {
                  $instance->highlighted[$field] = $value[0];
              }
          }
  
          $instance->setRawAttributes($attributes, true);
  
          return $instance;
      }
code_tokens: public function newFromElasticResults ( Array $ hit ) { $ instance = $ this -> newInstance ( array ( ) , true ) ; $ attributes = $ hit [ '_source' ] ; $ instance -> isDocument = true ; if ( isset ( $ hit [ '_score' ] ) ) { $ instance -> documentScore = $ hit [ '_score' ] ; } if ( isset ( $ hit [ '_version' ] ) ) { $ instance -> documentVersion = $ hit [ '_version' ] ; } if ( isset ( $ hit [ 'highlight' ] ) ) { foreach ( $ hit [ 'highlight' ] as $ field => $ value ) { $ instance -> highlighted [ $ field ] = $ value [ 0 ] ; } } $ instance -> setRawAttributes ( $ attributes , true ) ; return $ instance ; }
docstring: Fills a model's attributes with Elasticsearch
  result data.
  
  @param array $hit
  @return mixed
docstring_tokens: Fills a model s attributes with Elasticsearch result data .