Skip to content

Commit

Permalink
add null driver for database search as default
Browse files Browse the repository at this point in the history
  • Loading branch information
mylxsw committed May 19, 2022
1 parent 74b3575 commit c05fa86
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
27 changes: 27 additions & 0 deletions app/Components/Search/NullDriver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Components\Search;

use App\Repositories\Document;

/**
* 基于数据库的搜索
*/
class NullDriver implements Driver
{

public function deleteIndex($id)
{
// TODO: Implement deleteIndex() method.
}

public function syncIndex(Document $doc)
{
// TODO: Implement syncIndex() method.
}

public function search(string $keyword, int $page, int $perPage): ?Result
{
return null;
}
}
6 changes: 5 additions & 1 deletion config/wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,12 @@
'search' => [
/**
* 全文搜索驱动 Class
*
* GoFound: App\Components\Search\GoFoundDriver
* Null: App\Components\Search\NullDriver
*/
'driver' => env('WIZARD_SEARCH_DRIVER', 'App\Components\Search\GoFoundDriver'),
'driver' => env('WIZARD_SEARCH_DRIVER', 'App\Components\Search\NullDriver'),

/**
* 驱动配置
*/
Expand Down

0 comments on commit c05fa86

Please sign in to comment.