From ead3d3eec3821d067501f5a66d45fa6a230abe1b Mon Sep 17 00:00:00 2001 From: michel-DoubleRs Date: Wed, 9 Dec 2015 10:53:13 +0100 Subject: [PATCH] check for null values when creating an index currently a number_of_replicas of 0 is not possible --- src/ElasticquentTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ElasticquentTrait.php b/src/ElasticquentTrait.php index 1c672a3..e97b3e7 100644 --- a/src/ElasticquentTrait.php +++ b/src/ElasticquentTrait.php @@ -525,11 +525,11 @@ public static function createIndex($shards = null, $replicas = null) 'index' => $instance->getIndexName(), ); - if ($shards) { + if (!is_null($shards)) { $index['body']['settings']['number_of_shards'] = $shards; } - if ($replicas) { + if (!is_null($replicas)) { $index['body']['settings']['number_of_replicas'] = $replicas; }