From dc807fe4d59682259e40cdeafc79856b851829b6 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 24 Nov 2023 18:37:25 +0200 Subject: [PATCH] add url trim --- src/cli/document/add.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/document/add.php b/src/cli/document/add.php index 58170ec..4f675cd 100644 --- a/src/cli/document/add.php +++ b/src/cli/document/add.php @@ -24,7 +24,7 @@ $index = $client->index( ); // Check URL for exist -$result = $index->search('@url "' . $argv[1] . '"') +$result = $index->search('@url "' . trim($argv[1]) . '"') ->limit(1) ->get(); @@ -42,7 +42,7 @@ if ($result->getTotal()) // Add $result = $index->addDocument( [ - 'url' => $argv[1] + 'url' => trim($argv[1]) ] );