You are here

interface SolrConnectorInterface in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/SolrConnectorInterface.php \Drupal\search_api_solr\SolrConnectorInterface
  2. 8 src/SolrConnectorInterface.php \Drupal\search_api_solr\SolrConnectorInterface
  3. 4.x src/SolrConnectorInterface.php \Drupal\search_api_solr\SolrConnectorInterface

Hierarchy

Expanded class hierarchy of SolrConnectorInterface

All classes that implement SolrConnectorInterface

1 file declares its use of SolrConnectorInterface
SolrConnectorPluginBase.php in src/SolrConnector/SolrConnectorPluginBase.php

File

src/SolrConnectorInterface.php, line 17

Namespace

Drupal\search_api_solr
View source
interface SolrConnectorInterface extends ConfigurablePluginInterface {

  /**
   * Returns a link to the Solr server.
   *
   * @return \Drupal\Core\Link
   */
  public function getServerLink();

  /**
   * Returns a link to the Solr core, if the necessary options are set.
   *
   * @return \Drupal\Core\Link
   */
  public function getCoreLink();

  /**
   * Gets the current Solr version.
   *
   * @param bool $force_auto_detect
   *   If TRUE, ignore user overwrites.
   *
   * @return string
   *   The full Solr version string.
   */
  public function getSolrVersion($force_auto_detect = FALSE);

  /**
   * Gets the current Solr major version.
   *
   * @param string $version
   *   An optional Solr version string.
   *
   * @return int
   *   The Solr major version.
   */
  public function getSolrMajorVersion($version = '');

  /**
   * Gets the current Solr branch name.
   *
   * @param string $version
   *   An optional Solr version string.
   *
   * @return string
   *   The Solr branch string.
   */
  public function getSolrBranch($version = '');

  /**
   * Gets the LuceneMatchVersion string.
   *
   * @param string $version
   *   An optional Solr version string.
   *
   * @return string
   *   The lucene match version in V.V format.
   */
  public function getLuceneMatchVersion($version = '');

  /**
   * Gets information about the Solr server.
   *
   * @param bool $reset
   *   If TRUE the server will be asked regardless if a previous call is cached.
   *
   * @return object
   *   A response object with server information.
   *
   * @throws \Drupal\search_api_solr\SearchApiSolrException
   */
  public function getServerInfo($reset = FALSE);

  /**
   * Gets information about the Solr Core.
   *
   * @param bool $reset
   *   If TRUE the server will be asked regardless if a previous call is cached.
   *
   * @return object
   *   A response object with system information.
   *
   * @throws \Drupal\search_api_solr\SearchApiSolrException
   */
  public function getCoreInfo($reset = FALSE);

  /**
   * Gets meta-data about the index.
   *
   * @return object
   *   A response object filled with data from Solr's Luke.
   *
   * @throws \Drupal\search_api_solr\SearchApiSolrException
   */
  public function getLuke();

  /**
   * Gets the full schema version string the core is using.
   *
   * @param bool $reset
   *   If TRUE the server will be asked regardless if a previous call is cached.
   *
   * @return string
   *   The full schema version string.
   */
  public function getSchemaVersionString($reset = FALSE);

  /**
   * Gets the schema version number.
   *
   * @param bool $reset
   *   If TRUE the server will be asked regardless if a previous call is cached.
   *
   * @return string
   *   The schema version number.
   */
  public function getSchemaVersion($reset = FALSE);

  /**
   * Pings the Solr core to tell whether it can be accessed.
   *
   * @return mixed
   *   The latency in milliseconds if the core can be accessed,
   *   otherwise FALSE.
   */
  public function pingCore();

  /**
   * Pings the Solr server to tell whether it can be accessed.
   *
   * @return mixed
   *   The latency in milliseconds if the core can be accessed,
   *   otherwise FALSE.
   */
  public function pingServer();

  /**
   * Gets summary information about the Solr Core.
   *
   * @return array
   *   An array of stats about the solr core.
   *
   * @throws \Drupal\search_api_solr\SearchApiSolrException
   */
  public function getStatsSummary();

  /**
   * Sends a REST GET request to the Solr core and returns the result.
   *
   * @param string $path
   *   The path to append to the base URI.
   *
   * @return string
   *   The decoded response.
   */
  public function coreRestGet($path);

  /**
   * Sends a REST POST request to the Solr core and returns the result.
   *
   * @param string $path
   *   The path to append to the base URI.
   * @param string $command_json
   *   The command to send encoded as JSON.
   *
   * @return string
   *   The decoded response.
   */
  public function coreRestPost($path, $command_json = '');

  /**
   * Sends a REST GET request to the Solr server and returns the result.
   *
   * @param string $path
   *   The path to append to the base URI.
   *
   * @return string
   *   The decoded response.
   */
  public function serverRestGet($path);

  /**
   * Sends a REST POST request to the Solr server and returns the result.
   *
   * @param string $path
   *   The path to append to the base URI.
   * @param string $command_json
   *   The command to send encoded as JSON.
   *
   * @return string
   *   The decoded response.
   */
  public function serverRestPost($path, $command_json = '');

  /**
   * Creates a new Solarium update query.
   *
   * @return \Solarium\QueryType\Update\Query\Query
   *   The Update query.
   */
  public function getUpdateQuery();

  /**
   * Creates a new Solarium update query.
   *
   * @return \Solarium\QueryType\Select\Query\Query
   *   The Select query.
   */
  public function getSelectQuery();

  /**
   * Creates a new Solarium more like this query.
   *
   * @return \Solarium\QueryType\MorelikeThis\Query
   *   The MoreLikeThis query.
   */
  public function getMoreLikeThisQuery();

  /**
   * Creates a new Solarium terms query.
   *
   * @return \Solarium\QueryType\Terms\Query
   *   The Terms query.
   */
  public function getTermsQuery();

  /**
   * Creates a new Solarium suggester query.
   *
   * @return \Solarium\QueryType\Spellcheck\Query
   *   The Spellcheck query.
   */
  public function getSpellcheckQuery();

  /**
   * Creates a new Solarium suggester query.
   *
   * @return \Solarium\QueryType\Suggester\Query
   *   The Suggester query.
   */
  public function getSuggesterQuery();

  /**
   * Creates a new Solarium autocomplete query.
   *
   * @return \Drupal\search_api_solr\Solarium\Autocomplete\Query
   *   The Autocomplete query.
   */
  public function getAutocompleteQuery();

  /**
   * Creates a new Solarium extract query.
   *
   * @return \Solarium\QueryType\Extract\Query
   *   The Extract query.
   */
  public function getExtractQuery();

  /**
   * Returns a Solarium query helper object.
   *
   * @param \Solarium\Core\Query\QueryInterface|null $query
   *   (optional) A Solarium query object.
   *
   * @return \Solarium\Core\Query\Helper
   *   A Solarium query helper.
   */
  public function getQueryHelper(QueryInterface $query = NULL);

  /**
   * Executes a search query and returns the raw response.
   *
   * @param \Solarium\QueryType\Select\Query\Query $query
   * @param \Solarium\Core\Client\Endpoint|null $endpoint
   *
   * @return \Solarium\Core\Client\Response
   */
  public function search(Query $query, Endpoint $endpoint = NULL);

  /**
   * Creates a result from a response.
   *
   * @param QueryInterface $query
   * @param \Solarium\Core\Client\Response $response
   *
   * @return \Solarium\Core\Query\Result\ResultInterface
   */
  public function createSearchResult(QueryInterface $query, Response $response);

  /**
   * Executes an update query and applies some tweaks.
   *
   * @param \Solarium\QueryType\Update\Query\Query $query
   * @param \Solarium\Core\Client\Endpoint|null $endpoint
   *
   * @return \Solarium\Core\Query\Result\ResultInterface
   */
  public function update(UpdateQuery $query, Endpoint $endpoint = NULL);

  /**
   * Executes any query.
   *
   * @param \Solarium\Core\Query\QueryInterface $query
   * @param \Solarium\Core\Client\Endpoint|null $endpoint
   *
   * @return \Solarium\Core\Query\Result\ResultInterface
   *
   * @throws \Drupal\search_api_solr\SearchApiSolrException
   */
  public function execute(QueryInterface $query, Endpoint $endpoint = NULL);

  /**
   * Executes a request and returns the response.
   *
   * @param \Solarium\Core\Client\Request $request
   * @param \Solarium\Core\Client\Endpoint|null $endpoint
   *
   * @return \Solarium\Core\Client\Response
   *
   * @throws \Drupal\search_api_solr\SearchApiSolrException
   */
  public function executeRequest(Request $request, Endpoint $endpoint = NULL);

  /**
   * Optimizes the Solr index.
   *
   * @param \Solarium\Core\Client\Endpoint|null $endpoint
   */
  public function optimize(Endpoint $endpoint = NULL);

  /**
   * Executes an extract query.
   *
   * @param \Solarium\Core\Query\QueryInterface|\Solarium\QueryType\Extract\Query $query
   * @param \Solarium\Core\Client\Endpoint|null $endpoint
   *
   * @return \Solarium\QueryType\Extract\Result
   */
  public function extract(QueryInterface $query, Endpoint $endpoint = NULL);

  /**
   * Gets the content from an extract query result.
   *
   * @param \Solarium\QueryType\Extract\Result $result
   *
   * @param string $filepath
   *
   * @return string
   *   The extracted content as string.
   *
   * @throws \Drupal\search_api_solr\SearchApiSolrException
   */
  public function getContentFromExtractResult(ExtractResult $result, $filepath);

  /**
   * Returns an endpoint.
   *
   * @param string $key
   *
   * @return \Solarium\Core\Client\Endpoint
   */
  public function getEndpoint($key = 'core');

  /**
   * Retrieves a config file or file list from the Solr server.
   *
   * Uses the admin/file request handler.
   *
   * @param string|null $file
   *   (optional) The name of the file to retrieve. If the file is a directory,
   *   the directory contents are instead listed and returned. NULL represents
   *   the root config directory.
   *
   * @return \Solarium\Core\Client\Response
   *   A Solarium response object containing either the file contents or a file
   *   list.
   */
  public function getFile($file = NULL);

  /**
   * Returns additional, connector-specific information about this server.
   *
   * This information will be then added to the server's "View" tab in some way.
   * In the default theme implementation the data is output in a table with two
   * columns along with other, generic information about the server.
   *
   * @return array
   *   An array of additional server information, with each piece of information
   *   being an associative array with the following keys:
   *   - label: The human-readable label for this data.
   *   - info: The information, as HTML.
   *   - status: (optional) The status associated with this information. One of
   *     "info", "ok", "warning" or "error". Defaults to "info".
   */
  public function viewSettings();

  /**
   * Reloads the Solr core.
   *
   * @return bool
   */
  public function reloadCore();

  /**
   * Sets a new timeout for queries, but not for indexing or optimization.
   *
   * The timeout will not be saved in the configuration of the connector. It
   * will be overwritten for the current request only.
   *
   * @param int $timeout
   * @param \Solarium\Core\Client\Endpoint|NULL $endpoint
   *
   * @return int
   *   The previous timeout value.
   */
  public function adjustTimeout(int $timeout, Endpoint $endpoint = NULL);

  /**
   * Get the query timeout.
   *
   * @param \Solarium\Core\Client\Endpoint|NULL $endpoint
   *
   * @return int
   */
  public function getTimeout(Endpoint $endpoint = NULL);

  /**
   * Get the index timeout.
   *
   * @return int
   */
  public function getIndexTimeout();

  /**
   * Get the optimize timeout.
   *
   * @return int
   */
  public function getOptimizeTimeout();

  /**
   * Get the finalize timeout.
   *
   * @return int
   */
  public function getFinalizeTimeout();

  /**
   * Alter the newly assembled Solr configuration files.
   *
   * @param string[] $files
   *   Array of config files keyed by file names.
   * @param string $lucene_match_version
   *   Lucene (Solr) minor version string.
   * @param string $server_id
   *   Optional Search API server id. Will be set in most cases but might be
   *   empty when the config generation is triggered via UI or drush.
   */
  public function alterConfigFiles(array &$files, string $lucene_match_version, string $server_id = '');

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurablePluginInterface::defaultConfiguration public function Gets default configuration for this plugin. 1
ConfigurablePluginInterface::getConfiguration public function Gets this plugin's configuration. 1
ConfigurablePluginInterface::setConfiguration public function Sets the configuration for this plugin instance. 1
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
SolrConnectorInterface::adjustTimeout public function Sets a new timeout for queries, but not for indexing or optimization. 1
SolrConnectorInterface::alterConfigFiles public function Alter the newly assembled Solr configuration files. 1
SolrConnectorInterface::coreRestGet public function Sends a REST GET request to the Solr core and returns the result. 1
SolrConnectorInterface::coreRestPost public function Sends a REST POST request to the Solr core and returns the result. 1
SolrConnectorInterface::createSearchResult public function Creates a result from a response. 1
SolrConnectorInterface::execute public function Executes any query. 1
SolrConnectorInterface::executeRequest public function Executes a request and returns the response. 1
SolrConnectorInterface::extract public function Executes an extract query. 1
SolrConnectorInterface::getAutocompleteQuery public function Creates a new Solarium autocomplete query. 1
SolrConnectorInterface::getContentFromExtractResult public function Gets the content from an extract query result. 1
SolrConnectorInterface::getCoreInfo public function Gets information about the Solr Core. 1
SolrConnectorInterface::getCoreLink public function Returns a link to the Solr core, if the necessary options are set. 1
SolrConnectorInterface::getEndpoint public function Returns an endpoint. 1
SolrConnectorInterface::getExtractQuery public function Creates a new Solarium extract query. 1
SolrConnectorInterface::getFile public function Retrieves a config file or file list from the Solr server. 1
SolrConnectorInterface::getFinalizeTimeout public function Get the finalize timeout. 1
SolrConnectorInterface::getIndexTimeout public function Get the index timeout. 1
SolrConnectorInterface::getLuceneMatchVersion public function Gets the LuceneMatchVersion string. 1
SolrConnectorInterface::getLuke public function Gets meta-data about the index. 1
SolrConnectorInterface::getMoreLikeThisQuery public function Creates a new Solarium more like this query. 1
SolrConnectorInterface::getOptimizeTimeout public function Get the optimize timeout. 1
SolrConnectorInterface::getQueryHelper public function Returns a Solarium query helper object. 1
SolrConnectorInterface::getSchemaVersion public function Gets the schema version number. 1
SolrConnectorInterface::getSchemaVersionString public function Gets the full schema version string the core is using. 1
SolrConnectorInterface::getSelectQuery public function Creates a new Solarium update query. 1
SolrConnectorInterface::getServerInfo public function Gets information about the Solr server. 1
SolrConnectorInterface::getServerLink public function Returns a link to the Solr server. 1
SolrConnectorInterface::getSolrBranch public function Gets the current Solr branch name. 1
SolrConnectorInterface::getSolrMajorVersion public function Gets the current Solr major version. 1
SolrConnectorInterface::getSolrVersion public function Gets the current Solr version. 1
SolrConnectorInterface::getSpellcheckQuery public function Creates a new Solarium suggester query. 1
SolrConnectorInterface::getStatsSummary public function Gets summary information about the Solr Core. 1
SolrConnectorInterface::getSuggesterQuery public function Creates a new Solarium suggester query. 1
SolrConnectorInterface::getTermsQuery public function Creates a new Solarium terms query. 1
SolrConnectorInterface::getTimeout public function Get the query timeout. 1
SolrConnectorInterface::getUpdateQuery public function Creates a new Solarium update query. 1
SolrConnectorInterface::optimize public function Optimizes the Solr index. 1
SolrConnectorInterface::pingCore public function Pings the Solr core to tell whether it can be accessed. 1
SolrConnectorInterface::pingServer public function Pings the Solr server to tell whether it can be accessed. 1
SolrConnectorInterface::reloadCore public function Reloads the Solr core. 1
SolrConnectorInterface::search public function Executes a search query and returns the raw response. 1
SolrConnectorInterface::serverRestGet public function Sends a REST GET request to the Solr server and returns the result. 1
SolrConnectorInterface::serverRestPost public function Sends a REST POST request to the Solr server and returns the result. 1
SolrConnectorInterface::update public function Executes an update query and applies some tweaks. 1
SolrConnectorInterface::viewSettings public function Returns additional, connector-specific information about this server. 1