Browse Source

add url trim

main
ghost 1 year ago
parent
commit
dc807fe4d5
  1. 4
      src/cli/document/add.php

4
src/cli/document/add.php

@ -24,7 +24,7 @@ $index = $client->index( @@ -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()) @@ -42,7 +42,7 @@ if ($result->getTotal())
// Add
$result = $index->addDocument(
[
'url' => $argv[1]
'url' => trim($argv[1])
]
);

Loading…
Cancel
Save