First of all - the plugin is excellent, thank you for sharing it!
1) A minor bug - when logging the results, it will crash if "location" column is too long. Maybe the content should be trimmed to the column length before save?
2) Extending to other plugins.
This is already a bit messy in the back-end - too many providers listed, most users will find 90% of them unnecessary. May I suggest the following way to approach it:
I think that in all cases where other plugin creators will respond, the external SearchResultProviders should be removed from SiteSearch, and moved to respective plugins - IMHO it makes most sense if e.g. ProductCatalog search provider is part of that ProductCatalog, rather than a generic search tool.
I have approached it with the following code, to extend my own plugin and to inject config fields into SiteSearch config form:
public function boot()
{
// OFFLINE.SiteSearch may not be installed - silently ignore if not
if (class_exists('OFFLINE\SiteSearch\Classes\SearchService')) {
// this is described in OFFLINE.SiteSearch docs
Event::listen('offline.sitesearch.extend', function () {
return new PubliCatSearchResultsProvider();
});
// this is new - inject own fields into the settings controller
$this->extendSearchSettingsController();
}
}
protected function extendSearchSettingsController()
{
Event::listen('backend.form.extendFields', function ($form) {
if (!$form->model instanceof \OFFLINE\SiteSearch\Models\Settings)
return;
$configFile = plugins_path('_author_/_plugin_/config/search_fields.yaml');
$config = Yaml::parse(File::get($configFile));
$form->addTabFields($config);
});
}
So, for better extensibility, please consider keeping only core Providers in your plugin, e.g. CMSPages, Pages, Blog. All other providers could be moved to respective plugins by their owners, leaving a clean and more usable settings form.
Alternatively, if you think it is better to keep the current providers, maybe you could break the YAML config into sections belongings to each one, check whether each plugin is installed, and include/show only those tabs, that reference actually installed plugins?
1-1 of 1