From fb3e933ec6d068c0a711f9321ae587593a439ab8 Mon Sep 17 00:00:00 2001 From: renanbr Date: Wed, 12 Feb 2020 08:13:45 +0100 Subject: [PATCH] Add Reindex::REFRESH_* constants --- lib/Elastica/Reindex.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Elastica/Reindex.php b/lib/Elastica/Reindex.php index 3dfa37cffc..17d5e7bc09 100644 --- a/lib/Elastica/Reindex.php +++ b/lib/Elastica/Reindex.php @@ -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'; @@ -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); }