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.
1 parent 175904b commit fbbf6a0Copy full SHA for fbbf6a0
src/ElasticquentTrait.php
@@ -612,7 +612,10 @@ public function newFromHitBuilder($hit = array())
612
$key_name = $this->getKeyName();
613
614
$attributes = $hit['_source'];
615
- $attributes[$key_name] = is_numeric($hit['_id']) ? intval($hit['_id']) : $hit['_id'];
+
616
+ if (isset($hit['_id'])) {
617
+ $attributes[$key_name] = is_numeric($hit['_id']) ? intval($hit['_id']) : $hit['_id'];
618
+ }
619
620
// Add fields to attributes
621
if (isset($hit['fields'])) {
src/config/elasticquent.php
@@ -27,6 +27,6 @@
27
| Elasticquent models.
28
*/
29
30
- 'default_index' => 'default',
+ 'default_index' => 'my_custom_index_name',
31
32
);
0 commit comments