From 72a898a9555e1b0061ab2fb1d4eb74f9e15c76a5 Mon Sep 17 00:00:00 2001 From: Gulzar Ahmed Date: Thu, 1 Feb 2024 01:41:15 +0530 Subject: [PATCH] Fix zero integer value in options (#802) Typesense accepts a `0` INT value in some search options parameters like "drop_tokens_threshold": 0. Due to the `array_filter()` function, it was filtered out in the final search query. --- src/Engines/TypesenseEngine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 927bd11c..2f79954d 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -190,7 +190,7 @@ public function search(Builder $builder) { return $this->performSearch( $builder, - array_filter($this->buildSearchParameters($builder, 1, $builder->limit)) + $this->buildSearchParameters($builder, 1, $builder->limit) ); } @@ -209,7 +209,7 @@ public function paginate(Builder $builder, $perPage, $page) { return $this->performSearch( $builder, - array_filter($this->buildSearchParameters($builder, $page, $perPage)) + $this->buildSearchParameters($builder, $page, $perPage) ); }