Skip to content

Commit 2e92b8f

Browse files
committed
Mark dontUseTimestampsInIndex as deprecated.
1 parent 0234890 commit 2e92b8f

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

src/ElasticquentResultCollection.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ class ElasticquentResultCollection extends \Illuminate\Database\Eloquent\Collect
1212
protected $instance;
1313

1414
/**
15-
* _construct
15+
* Create a new instance containing Elasticsearch results
1616
*
17-
* @param $results elasticsearch results
17+
* @param $results elasticsearch results
1818
* @param $instance
19-
*
20-
* @return \Elasticquent\ElasticquentResultCollection
2119
*/
2220
public function __construct($results, $instance)
2321
{

src/ElasticquentTrait.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ public function newCollection(array $models = array())
7777
*/
7878
public function getIndexName()
7979
{
80-
// The first thing we check is if there
81-
// is an elasticquery config file and if there is a
82-
// default index.
80+
// The first thing we check is if there is an elasticquent
81+
// config file and if there is a default index.
8382
$index_name = $this->getElasticConfig('default_index');
8483

8584
if (!empty($index_name)) {
@@ -111,17 +110,19 @@ public function usesTimestampsInIndex()
111110
/**
112111
* Use Timestamps In Index.
113112
*/
114-
public function useTimestampsInIndex()
113+
public function useTimestampsInIndex($shouldUse = true)
115114
{
116-
$this->usesTimestampsInIndex = true;
115+
$this->usesTimestampsInIndex = $shouldUse;
117116
}
118117

119118
/**
120119
* Don't Use Timestamps In Index.
120+
*
121+
* @deprecated
121122
*/
122123
public function dontUseTimestampsInIndex()
123124
{
124-
$this->usesTimestampsInIndex = false;
125+
$this->useTimestampsInIndex(false);
125126
}
126127

127128
/**
@@ -267,7 +268,7 @@ public static function searchByQuery($query = null, $aggregations = null, $sourc
267268
*
268269
* Using this method, a custom query can be sent to Elasticsearch.
269270
*
270-
* @param $params
271+
* @param $params parameters to be passed directly to Elasticsearch
271272
* @return ElasticquentResultCollection
272273
*/
273274
public static function complexSearch($params)
@@ -410,8 +411,8 @@ public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible =
410411
/**
411412
* Build the 'fields' parameter depending on given options.
412413
*
413-
* @param bool $getSourceIfPossible
414-
* @param bool $getTimestampIfPossible
414+
* @param bool $getSourceIfPossible
415+
* @param bool $getTimestampIfPossible
415416
* @return array
416417
*/
417418
private function buildFieldsParameter($getSourceIfPossible, $getTimestampIfPossible)
@@ -602,7 +603,7 @@ public function newFromHitBuilder($hit = array())
602603
}
603604
}
604605

605-
$instance->setRawAttributes((array) $attributes, true);
606+
$instance->setRawAttributes((array)$attributes, true);
606607

607608
// In addition to setting the attributes
608609
// from the index, we will set the score as well.

0 commit comments

Comments
 (0)