Skip to content

Commit

Permalink
Object to be skipped from the toSearchableArray method
Browse files Browse the repository at this point in the history
This allows the current object to be skipped, just by returning false, empty array or null in the toSearchableArray method of the model.
Ref to issue: typesense#24
  • Loading branch information
nicomengual committed Apr 20, 2022
1 parent d150ee8 commit c95a89a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Typesense.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public function deleteDocuments(Collection $collectionIndex, array $query): arra
*/
public function importDocuments(Collection $collectionIndex, $documents, string $action = 'upsert'): \Illuminate\Support\Collection
{
$documents = collect($documents)->filter()->toArray();
$importedDocuments = $collectionIndex->getDocuments()
->import($documents, ['action' => $action]);

Expand Down

0 comments on commit c95a89a

Please sign in to comment.