class NodeSearch
Same name and namespace in other branches
- 11.x core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
- 10 core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
- 9 core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
- 8.9.x core/modules/node/src/Plugin/Search/NodeSearch.php \Drupal\node\Plugin\Search\NodeSearch
Handles searching for node entities using the Search module index.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\search\Plugin\SearchPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\search\Plugin\SearchInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\search\Plugin\ConfigurableSearchPluginBase implements \Drupal\search\Plugin\ConfigurableSearchPluginInterface uses \Drupal\Core\Plugin\ConfigurableTrait extends \Drupal\search\Plugin\SearchPluginBase
- class \Drupal\search_node\Plugin\Search\SearchNode implements \Drupal\Core\Access\AccessibleInterface, \Drupal\search\Plugin\SearchIndexingInterface, \Drupal\Core\Security\TrustedCallbackInterface extends \Drupal\search\Plugin\ConfigurableSearchPluginBase
- class \Drupal\node\Plugin\Search\NodeSearch extends \Drupal\search_node\Plugin\Search\SearchNode
- class \Drupal\search_node\Plugin\Search\SearchNode implements \Drupal\Core\Access\AccessibleInterface, \Drupal\search\Plugin\SearchIndexingInterface, \Drupal\Core\Security\TrustedCallbackInterface extends \Drupal\search\Plugin\ConfigurableSearchPluginBase
- class \Drupal\search\Plugin\ConfigurableSearchPluginBase implements \Drupal\search\Plugin\ConfigurableSearchPluginInterface uses \Drupal\Core\Plugin\ConfigurableTrait extends \Drupal\search\Plugin\SearchPluginBase
- class \Drupal\search\Plugin\SearchPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\search\Plugin\SearchInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of NodeSearch
Deprecated
in drupal:11.4.0 and is removed from drupal:12.0.0. Instead, use \Drupal\search_node\Plugin\Search\SearchNode.
See also
https://www.drupal.org/node/3590298
File
-
core/
modules/ node/ src/ Plugin/ Search/ NodeSearch.php, line 25
Namespace
Drupal\node\Plugin\SearchView source
class NodeSearch extends CoreSearchNode {
public function __construct(array $configuration, $plugin_id, $plugin_definition, protected Connection $database, protected EntityTypeManagerInterface $entityTypeManager, protected ModuleHandlerInterface $moduleHandler, protected Config $searchSettings, protected LanguageManagerInterface $languageManager, protected RendererInterface $renderer, MessengerInterface $messenger, protected AccountInterface $account, protected Connection $databaseReplica, protected SearchIndexInterface $searchIndex, protected EntityTypeBundleInfoInterface $entityTypeBundleInfo) {
@trigger_error(__CLASS__ . ' is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Instead, use \\Drupal\\search_node\\Plugin\\Search\\SearchNode. See https://www.drupal.org/node/3590298', E_USER_DEPRECATED);
parent::__construct($configuration, $plugin_id, $plugin_definition, $this->database, $this->entityTypeManager, $this->moduleHandler, $this->searchSettings, $this->languageManager, $this->renderer, $messenger, $this->account, $this->databaseReplica, $this->searchIndex, $this->entityTypeBundleInfo);
$this->setMessenger($messenger);
$this->addCacheTags([
'node_list',
]);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
|---|---|---|---|---|---|
| AutowiredInstanceTrait::createInstanceAutowired | public static | function | Instantiates a new instance of the implementing class using autowiring. | ||
| AutowiredInstanceTrait::getAutowireArguments | private static | function | Resolves arguments for a method using autowiring. | ||
| CacheableDependencyTrait::$cacheContexts | protected | property | Cache contexts. | ||
| CacheableDependencyTrait::$cacheMaxAge | protected | property | Cache max-age. | ||
| CacheableDependencyTrait::$cacheTags | protected | property | Cache tags. | ||
| CacheableDependencyTrait::getCacheContexts | public | function | 4 | ||
| CacheableDependencyTrait::getCacheMaxAge | public | function | 4 | ||
| CacheableDependencyTrait::getCacheTags | public | function | 4 | ||
| CacheableDependencyTrait::setCacheability | protected | function | Sets cacheability; useful for value object constructors. | ||
| ConfigurableSearchPluginBase::$searchPageId | protected | property | The unique ID for the search page using this plugin. | ||
| ConfigurableSearchPluginBase::calculateDependencies | public | function | Calculates dependencies for the configured plugin. | Overrides DependentPluginInterface::calculateDependencies | |
| ConfigurableSearchPluginBase::setSearchPageId | public | function | Sets the ID for the search page using this plugin. | Overrides ConfigurableSearchPluginInterface::setSearchPageId | |
| ConfigurableSearchPluginBase::validateConfigurationForm | public | function | Form validation handler. | Overrides PluginFormInterface::validateConfigurationForm | |
| ConfigurableTrait::$configuration | protected | property | Configuration information passed into the plugin. | ||
| ConfigurableTrait::getConfiguration | public | function | Gets this plugin's configuration. | 3 | |
| ConfigurableTrait::setConfiguration | public | function | Sets the configuration for this plugin instance. | 2 | |
| DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | ||
| DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | ||
| DependencySerializationTrait::__sleep | public | function | 2 | ||
| DependencySerializationTrait::__wakeup | public | function | 2 | ||
| MessengerTrait::messenger | public | function | Gets the messenger. | 26 | |
| MessengerTrait::setMessenger | public | function | Sets the messenger. | ||
| NodeSearch::__construct | public | function | Constructs a \Drupal\node\Plugin\Search\NodeSearch object. | Overrides SearchNode::__construct | |
| PluginBase::$pluginDefinition | protected | property | The plugin implementation definition. | 1 | |
| PluginBase::$pluginId | protected | property | The plugin ID. | ||
| PluginBase::DERIVATIVE_SEPARATOR | constant | A string which is used to separate base plugin IDs from the derivative ID. | |||
| PluginBase::getBaseId | public | function | Gets the base_plugin_id of the plugin instance. | Overrides DerivativeInspectionInterface::getBaseId | |
| PluginBase::getDerivativeId | public | function | Gets the derivative_id of the plugin instance. | Overrides DerivativeInspectionInterface::getDerivativeId | |
| PluginBase::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | Overrides PluginInspectionInterface::getPluginDefinition | 2 |
| PluginBase::getPluginId | public | function | Gets the plugin ID of the plugin instance. | Overrides PluginInspectionInterface::getPluginId | |
| RefinableCacheableDependencyTrait::addCacheableDependency | public | function | 1 | ||
| RefinableCacheableDependencyTrait::addCacheContexts | public | function | |||
| RefinableCacheableDependencyTrait::addCacheTags | public | function | |||
| RefinableCacheableDependencyTrait::mergeCacheMaxAge | public | function | |||
| SearchNode::$advanced | protected | property | The list of options and info for advanced search filters. | ||
| SearchNode::$messenger | protected | property | The messenger. | Overrides MessengerTrait::$messenger | |
| SearchNode::$rankings | protected | property | An array of additional rankings from hook_node_search_ranking(). | ||
| SearchNode::access | public | function | Checks data value access. | Overrides AccessibleInterface::access | |
| SearchNode::addNodeRankings | protected | function | Adds the configured rankings to the search query. | ||
| SearchNode::ADVANCED_FORM | constant | A constant for setting and checking the query string. | |||
| SearchNode::buildConfigurationForm | public | function | Form constructor. | Overrides PluginFormInterface::buildConfigurationForm | |
| SearchNode::buildSearchUrlQuery | public | function | Builds the URL GET query parameters array for search. | Overrides SearchPluginBase::buildSearchUrlQuery | |
| SearchNode::create | public static | function | Instantiates a new instance of the implementing class using autowiring. | Overrides PluginBase::create | |
| SearchNode::defaultConfiguration | public | function | Gets default configuration for this plugin. | Overrides ConfigurableTrait::defaultConfiguration | |
| SearchNode::execute | public | function | Executes the search. | Overrides SearchInterface::execute | |
| SearchNode::findResults | protected | function | Queries to find search results, and sets status messages. | ||
| SearchNode::getRankings | protected | function | Gathers ranking definitions from hook_node_search_ranking(). | ||
| SearchNode::getType | public | function | Returns the search index type this plugin uses. | Overrides SearchPluginBase::getType | |
| SearchNode::indexClear | public | function | Clears the search index for this plugin. | Overrides SearchIndexingInterface::indexClear | |
| SearchNode::indexNode | protected | function | Indexes a single node. | ||
| SearchNode::indexStatus | public | function | Reports the status of indexing. | Overrides SearchIndexingInterface::indexStatus | |
| SearchNode::isSearchExecutable | public | function | Verifies if the values set via setSearch() are valid and sufficient. | Overrides SearchPluginBase::isSearchExecutable | |
| SearchNode::markForReindex | public | function | Marks the search index for reindexing for this plugin. | Overrides SearchIndexingInterface::markForReindex | |
| SearchNode::parseAdvancedDefaults | protected | function | Parses the advanced search form default values. | ||
| SearchNode::prepareResults | protected | function | Prepares search results for rendering. | ||
| SearchNode::removeSubmittedInfo | public | function | Removes the submitted by information from the build array. | ||
| SearchNode::searchFormAlter | public | function | Alters the search form when being built for a given plugin. | Overrides SearchPluginBase::searchFormAlter | |
| SearchNode::submitConfigurationForm | public | function | Form submission handler. | Overrides PluginFormInterface::submitConfigurationForm | |
| SearchNode::trustedCallbacks | public static | function | Lists the trusted callbacks provided by the implementing class. | Overrides TrustedCallbackInterface::trustedCallbacks | |
| SearchNode::updateIndex | public | function | Updates the search index for this plugin. | Overrides SearchIndexingInterface::updateIndex | |
| SearchPluginBase::$keywords | protected | property | The keywords to use in a search. | ||
| SearchPluginBase::$searchAttributes | protected | property | Array of attributes - usually from the request object. | ||
| SearchPluginBase::$searchParameters | protected | property | Array of parameters from the query string from the request. | ||
| SearchPluginBase::buildResults | public | function | Executes the search and builds render arrays for the result items. | Overrides SearchInterface::buildResults | 1 |
| SearchPluginBase::getAttributes | public | function | Returns the currently set attributes (from the request). | Overrides SearchInterface::getAttributes | |
| SearchPluginBase::getHelp | public | function | Returns the searching help. | Overrides SearchInterface::getHelp | 1 |
| SearchPluginBase::getKeywords | public | function | Returns the currently set keywords of the plugin instance. | Overrides SearchInterface::getKeywords | |
| SearchPluginBase::getParameters | public | function | Returns the current parameters set using setSearch(). | Overrides SearchInterface::getParameters | |
| SearchPluginBase::setSearch | public | function | Sets the keywords, parameters, and attributes to be used by execute(). | Overrides SearchInterface::setSearch | 1 |
| SearchPluginBase::suggestedTitle | public | function | Provides a suggested title for a page of search results. | Overrides SearchInterface::suggestedTitle | |
| SearchPluginBase::usesAdminTheme | public | function | Returns whether or not search results should be displayed in admin theme. | Overrides SearchInterface::usesAdminTheme | |
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | |
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | ||
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | ||
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | ||
| StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | |
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | 1 | |
| TrustedCallbackInterface::THROW_EXCEPTION | constant | Untrusted callbacks throw exceptions. | |||
| TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION | constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.