You are here

class Query in Search API Solr 8

Same name and namespace in other branches
  1. 8.3 src/Solarium/Autocomplete/Query.php \Drupal\search_api_solr\Solarium\Autocomplete\Query
  2. 8.2 src/Solarium/Autocomplete/Query.php \Drupal\search_api_solr\Solarium\Autocomplete\Query
  3. 4.x src/Solarium/Autocomplete/Query.php \Drupal\search_api_solr\Solarium\Autocomplete\Query

Autocomplete query.

Hierarchy

  • class \Drupal\search_api_solr\Solarium\Autocomplete\Query extends \Solarium\Core\Query\AbstractQuery implements \Solarium\Component\ComponentAwareQueryInterface uses \Solarium\Component\ComponentAwareQueryTrait, \Solarium\Component\QueryTraits\SpellcheckTrait, \Solarium\Component\QueryTraits\SuggesterTrait, \Solarium\Component\QueryTraits\TermsTrait

Expanded class hierarchy of Query

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

File

src/Solarium/Autocomplete/Query.php, line 20

Namespace

Drupal\search_api_solr\Solarium\Autocomplete
View source
class Query extends AbstractQuery implements ComponentAwareQueryInterface {
  use ComponentAwareQueryTrait;
  use SpellcheckTrait;
  use SuggesterTrait;
  use TermsTrait;

  /**
   * Default options.
   *
   * @var array
   */
  protected $options = [
    'handler' => 'autocomplete',
    'resultclass' => Result::class,
  ];

  /**
   * Constructs a Query object.
   */
  public function __construct($options = NULL) {
    $this->componentTypes = [
      ComponentAwareQueryInterface::COMPONENT_SPELLCHECK => Spellcheck::class,
      ComponentAwareQueryInterface::COMPONENT_SUGGESTER => Suggester::class,
      ComponentAwareQueryInterface::COMPONENT_TERMS => Terms::class,
    ];
    parent::__construct($options);
  }

  /**
   * {@inheritdoc}
   */
  public function getType() : string {
    return 'autocomplete';
  }

  /**
   * {@inheritdoc}
   */
  public function getRequestBuilder() : RequestBuilderInterface {
    return new RequestBuilder();
  }

  /**
   * {@inheritdoc}
   */
  public function getResponseParser() : ResponseParserInterface {
    return new ResponseParser();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Query::$options protected property Default options.
Query::getRequestBuilder public function
Query::getResponseParser public function
Query::getType public function
Query::__construct public function Constructs a Query object.