The name of the indexer class suggests that it is responsible for indexing pages. However, it performs a search on pages. For the search no class is necessary, because the eloquent query builder already offers a flexible api for filtering search results.
Added Laravel Scout
Laravel Scout's trait Searchable is added to the model that stores the web page content. This way algolia, the laravel-scout-mysql-driver or other drivers may be added to provide the search results.
Renamed Model
The model was renamed from PageIndexRecord to WebPage as it increases readability. The model may be used like this:
This pr adds some design changes.
Removed Indexer
The name of the indexer class suggests that it is responsible for indexing pages. However, it performs a search on pages. For the search no class is necessary, because the eloquent query builder already offers a flexible api for filtering search results.
Added Laravel Scout
Laravel Scout's trait
Searchable
is added to the model that stores the web page content. This way algolia, the laravel-scout-mysql-driver or other drivers may be added to provide the search results.Renamed Model
The model was renamed from
PageIndexRecord
toWebPage
as it increases readability. The model may be used like this:Added Model and table name to config
The model class and database table name were added to the config to make the customizable.
Added .gitignore
The
.gitignore
was added.