Loading src/ElasticquentResultCollection.php +2 −2 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ class ElasticquentResultCollection extends \Illuminate\Database\Eloquent\Collect */ public function totalHits() { return $this->hits['total']; return $this->hits['total']['value']; } /** Loading src/ElasticquentTrait.php +6 −7 Original line number Diff line number Diff line Loading @@ -369,8 +369,7 @@ trait ElasticquentTrait public function getBasicEsParams($getIdIfPossible = true, $limit = null, $offset = null) { $params = array( 'index' => $this->getIndexName(), 'type' => $this->getTypeName(), 'index' => $this->getIndexName() ); if ($getIdIfPossible && $this->getKey()) { Loading Loading @@ -456,7 +455,7 @@ trait ElasticquentTrait 'properties' => $instance->getMappingProperties(), ); $mapping['body'][$instance->getTypeName()] = $params; $mapping['body'] = $params; return $instance->getElasticSearchClient()->indices()->putMapping($mapping); } Loading Loading @@ -531,7 +530,7 @@ trait ElasticquentTrait $mappingProperties = $instance->getMappingProperties(); if (!is_null($mappingProperties)) { $index['body']['mappings'][$instance->getTypeName()] = [ $index['body']['mappings'] = [ '_source' => array('enabled' => true), 'properties' => $mappingProperties, ]; Loading Loading
src/ElasticquentResultCollection.php +2 −2 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ class ElasticquentResultCollection extends \Illuminate\Database\Eloquent\Collect */ public function totalHits() { return $this->hits['total']; return $this->hits['total']['value']; } /** Loading
src/ElasticquentTrait.php +6 −7 Original line number Diff line number Diff line Loading @@ -369,8 +369,7 @@ trait ElasticquentTrait public function getBasicEsParams($getIdIfPossible = true, $limit = null, $offset = null) { $params = array( 'index' => $this->getIndexName(), 'type' => $this->getTypeName(), 'index' => $this->getIndexName() ); if ($getIdIfPossible && $this->getKey()) { Loading Loading @@ -456,7 +455,7 @@ trait ElasticquentTrait 'properties' => $instance->getMappingProperties(), ); $mapping['body'][$instance->getTypeName()] = $params; $mapping['body'] = $params; return $instance->getElasticSearchClient()->indices()->putMapping($mapping); } Loading Loading @@ -531,7 +530,7 @@ trait ElasticquentTrait $mappingProperties = $instance->getMappingProperties(); if (!is_null($mappingProperties)) { $index['body']['mappings'][$instance->getTypeName()] = [ $index['body']['mappings'] = [ '_source' => array('enabled' => true), 'properties' => $mappingProperties, ]; Loading