add url trim

This commit is contained in:
ghost 2023-11-24 18:37:25 +02:00
parent 20d3530721
commit dc807fe4d5

View File

@ -24,7 +24,7 @@ $index = $client->index(
); );
// Check URL for exist // Check URL for exist
$result = $index->search('@url "' . $argv[1] . '"') $result = $index->search('@url "' . trim($argv[1]) . '"')
->limit(1) ->limit(1)
->get(); ->get();
@ -42,7 +42,7 @@ if ($result->getTotal())
// Add // Add
$result = $index->addDocument( $result = $index->addDocument(
[ [
'url' => $argv[1] 'url' => trim($argv[1])
] ]
); );