Skip to content

Commit

Permalink
Merge b001250 into 61efdfe
Browse files Browse the repository at this point in the history
  • Loading branch information
VaderSV committed Feb 5, 2019
2 parents 61efdfe + b001250 commit 7d399ab
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Search.php
Expand Up @@ -34,6 +34,14 @@
*/
class Search
{
/**
* If you don’t need to track the total number of hits at all you can improve
* query times by setting this option to false. Defaults to true.
*
* @var bool
*/
private $trackTotalHits;

/**
* To retrieve hits from a certain offset. Defaults to 0.
*
Expand Down Expand Up @@ -447,6 +455,24 @@ public function setFrom($from)
return $this;
}

/**
* @return bool
*/
public function isTrackTotalHits()
{
return $this->trackTotalHits;
}

/**
* @param bool $trackTotalHits
* @return $this
*/
public function setTrackTotalHits(bool $trackTotalHits)
{
$this->trackTotalHits = $trackTotalHits;
return $this;
}

/**
* @return int
*/
Expand Down Expand Up @@ -719,6 +745,7 @@ public function toArray()
'indicesBoost' => 'indices_boost',
'minScore' => 'min_score',
'searchAfter' => 'search_after',
'trackTotalHits' => 'track_total_hits',
];

foreach ($params as $field => $param) {
Expand Down

0 comments on commit 7d399ab

Please sign in to comment.