We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5a47780 + 068edfe commit e72bcc4Copy full SHA for e72bcc4
src/ElasticquentTrait.php
@@ -584,9 +584,11 @@ public static function typeExists()
584
public function newFromHitBuilder($hit = array())
585
{
586
$instance = $this->newInstance(array(), true);
587
-
588
- $attributes = $hit['_source'];
589
+ $keyname = $instance->getKeyName();
+
+ $attributes = $hit['_source'];
590
+ $attributes[$keyname] = $hit['_id'];
591
592
// Add fields to attributes
593
if (isset($hit['fields'])) {
594
foreach ($hit['fields'] as $key => $value) {
0 commit comments