Skip to content

Commit 1921d3a

Browse files
authored
Bump ElasticSearch version to ~6.0 (#159)
* Removed invalid 'fields' parameter * Bumped ElasticSearch version to ~6.0 Thanks @coffeeburrito!
1 parent 46c838b commit 1921d3a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"illuminate/database": "~4.2|^5",
2222
"illuminate/config": "~4.2|^5",
2323
"nesbot/carbon": "~1.0",
24-
"elasticsearch/elasticsearch": ">1.0 <2.2"
24+
"elasticsearch/elasticsearch": "~6.0"
2525
},
2626
"require-dev": {
2727
"phpunit/phpunit": "~4.2|~5.0",

src/ElasticquentTrait.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public static function searchByQuery($query = null, $aggregations = null, $sourc
225225
{
226226
$instance = new static;
227227

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

230230
if (!empty($sourceFields)) {
231231
$params['body']['_source']['include'] = $sourceFields;
@@ -366,7 +366,7 @@ public function getIndexedDocument()
366366
*
367367
* @return array
368368
*/
369-
public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible = false, $getTimestampIfPossible = false, $limit = null, $offset = null)
369+
public function getBasicEsParams($getIdIfPossible = true, $limit = null, $offset = null)
370370
{
371371
$params = array(
372372
'index' => $this->getIndexName(),
@@ -377,11 +377,6 @@ public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible =
377377
$params['id'] = $this->getKey();
378378
}
379379

380-
$fields = $this->buildFieldsParameter($getSourceIfPossible, $getTimestampIfPossible);
381-
if (!empty($fields)) {
382-
$params['fields'] = implode(',', $fields);
383-
}
384-
385380
if (is_numeric($limit)) {
386381
$params['size'] = $limit;
387382
}

0 commit comments

Comments
 (0)