Skip to content

Commit

Permalink
Add Reindex::REFRESH_* constants
Browse files Browse the repository at this point in the history
  • Loading branch information
renanbr committed Feb 12, 2020
1 parent 06ffaa7 commit fb3e933
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Elastica/Reindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class Reindex extends Param
public const REMOTE = 'remote';
public const SLICE = 'slice';
public const REFRESH = 'refresh';
public const REFRESH_TRUE = 'true';
public const REFRESH_FALSE = 'false';
public const REFRESH_WAIT_FOR = 'wait_for';
public const WAIT_FOR_COMPLETION = 'wait_for_completion';
public const WAIT_FOR_COMPLETION_FALSE = 'false';
public const WAIT_FOR_ACTIVE_SHARDS = 'wait_for_active_shards';
Expand Down Expand Up @@ -204,9 +207,12 @@ public function setPipeline(Pipeline $pipeline): void
$this->setParam(self::PIPELINE, $pipeline);
}

/**
* @param bool|string $value
*/
public function setRefresh($value): void
{
\is_bool($value) && $value = $value ? 'true' : 'false';
\is_bool($value) && $value = $value ? self::REFRESH_TRUE : self::REFRESH_FALSE;

$this->setParam(self::REFRESH, $value);
}
Expand Down

0 comments on commit fb3e933

Please sign in to comment.