\SearchWP\Engine
Note: SearchWP Engines are designed to be fully managed by the settings screen.
Direct manipulation of an Engine should be done only when directed by Support.
Table of Contents
\SearchWP\Engines control the parameters used when performing a \SearchWP\Query.
❗️Important❗️ \SearchWP\Engines fully define what content is stored in SearchWP’s Index. As a result, \SearchWP\Engine management should take place on the settings screen. There are limited modifications that can happen at runtime, outlined below.
Arguments
When instantiating a new \SearchWP\Engine the following parameters can be passed:
name(string)- The Engine name. (default:
'default') settings(array)- Settings. (default:
[])
When the $name is that of a saved \SearchWP\Engine it’s settings will be loaded automatically.
When the $settings is empty, a default collections of settings will be used, based on the \SearchWP\Source and \SearchWP\Attribute configurations available.
$settings cannot be directly manipulated programmatically as many changes to the $settings require that the Index be manipulated in some way. SearchWP needs to know about those changes to ensure accuracy of results. That is why \SearchWP\Engine updates must take place on the settings screen unless otherwise directed by Support.
Properties
There are no public properties in \SearchWP\Engine.
Methods
When working with \SearchWP\Engine there are a select few methods to consider.
remove_source( string $source_name )- Excludes a
\SearchWP\Sourcefor this request, does not drop anything from the Index. get_settings- Getter for settings.
get_sources- Getter for
\SearchWP\Sources added to this Engine. get_source( string $source_name )- Getter for a single
\SearchWP\Sourceadded to this Engine. get_label- Getter for label.
get_name- Getter for name.

