Skip to content

Commit

Permalink
extra method didnt feel necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Nov 28, 2023
1 parent 279cef0 commit 00aa059
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Search/Algolia/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function update()
$index->setSettings($this->config['settings']);
}

$this->insertLazily($this->searchables()->lazy());
$this->searchables()->lazy()->each(fn ($searchables) => $this->insertMultiple($searchables));

return $this;
}
Expand Down
10 changes: 1 addition & 9 deletions src/Search/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Statamic\Search;

use Illuminate\Support\LazyCollection;
use Statamic\Contracts\Search\Searchable;
use Statamic\Support\Arr;

Expand Down Expand Up @@ -58,7 +57,7 @@ public function update()
{
$this->deleteIndex();

$this->insertLazily($this->searchables()->lazy());
$this->searchables()->lazy()->each(fn ($searchables) => $this->insertMultiple($searchables));

return $this;
}
Expand Down Expand Up @@ -88,13 +87,6 @@ public function insertMultiple($documents)
return $this;
}

public function insertLazily(LazyCollection $providers)
{
$providers->each(fn ($documents) => $this->insertMultiple($documents));

return $this;
}

public function shouldIndex($searchable)
{
return $this->searchables()->contains($searchable);
Expand Down

0 comments on commit 00aa059

Please sign in to comment.