Pluggable web search component using crawler + database full text search. Inspired by Sphider.
- Create your .env settings file.
- Create your website classes, follow
Sites\RootBasics
as en example. - Make a request to
index.php
to generate the full text index. - Make a request to
query.php
to fetch the search results.
Add the following block to index.php
:
use GuzzleHttp\RequestOptions;
$clientConfig = [];
if (getenv('CLIENT_USERNAME') && getenv('CLIENT_PASSWORD')) {
$clientConfig[RequestOptions::AUTH] = [getenv('CLIENT_USERNAME'), getenv('CLIENT_PASSWORD')];
}
Pass the $clientConfig
variable to the Spatie crawler constructor.