Skip to content

Commit

Permalink
Bump ElasticSearch version to ~6.0 (#159)
Browse files Browse the repository at this point in the history
* Removed invalid 'fields' parameter
* Bumped ElasticSearch version to ~6.0
Thanks @coffeeburrito!
  • Loading branch information
timgws committed Mar 23, 2018
1 parent 46c838b commit 1921d3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -21,7 +21,7 @@
"illuminate/database": "~4.2|^5",
"illuminate/config": "~4.2|^5",
"nesbot/carbon": "~1.0",
"elasticsearch/elasticsearch": ">1.0 <2.2"
"elasticsearch/elasticsearch": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.2|~5.0",
Expand Down
9 changes: 2 additions & 7 deletions src/ElasticquentTrait.php
Expand Up @@ -225,7 +225,7 @@ public static function searchByQuery($query = null, $aggregations = null, $sourc
{
$instance = new static;

$params = $instance->getBasicEsParams(true, true, true, $limit, $offset);
$params = $instance->getBasicEsParams(true, $limit, $offset);

if (!empty($sourceFields)) {
$params['body']['_source']['include'] = $sourceFields;
Expand Down Expand Up @@ -366,7 +366,7 @@ public function getIndexedDocument()
*
* @return array
*/
public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible = false, $getTimestampIfPossible = false, $limit = null, $offset = null)
public function getBasicEsParams($getIdIfPossible = true, $limit = null, $offset = null)
{
$params = array(
'index' => $this->getIndexName(),
Expand All @@ -377,11 +377,6 @@ public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible =
$params['id'] = $this->getKey();
}

$fields = $this->buildFieldsParameter($getSourceIfPossible, $getTimestampIfPossible);
if (!empty($fields)) {
$params['fields'] = implode(',', $fields);
}

if (is_numeric($limit)) {
$params['size'] = $limit;
}
Expand Down

0 comments on commit 1921d3a

Please sign in to comment.