]> BookStack Code Mirror - bookstack/blob - app/Search/Vectors/StoreEntityVectorsJob.php
Vectors: Built content vector indexing system
[bookstack] / app / Search / Vectors / StoreEntityVectorsJob.php
1 <?php
2
3 namespace BookStack\Search\Vectors;
4
5 use BookStack\Entities\Models\Entity;
6 use Illuminate\Contracts\Queue\ShouldQueue;
7 use Illuminate\Foundation\Queue\Queueable;
8
9 class StoreEntityVectorsJob implements ShouldQueue
10 {
11     use Queueable;
12
13     /**
14      * Create a new job instance.
15      */
16     public function __construct(
17         protected Entity $entity
18     ) {
19     }
20
21     /**
22      * Execute the job.
23      */
24     public function handle(EntityVectorGenerator $generator): void
25     {
26         $generator->generateAndStore($this->entity);
27     }
28 }