Commit c28a755d authored by Jeroen Opdebeeck's avatar Jeroen Opdebeeck Committed by Robin De Herdt
Browse files

Issue #3318082: Coding standards scan

parent 9036d9db
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
<?php

/**
 * @file
 * Install, update and uninstall functions.
 */

use Drupal\elasticsearch_search_api\Utility\UtilityHelper;
use Drupal\node\Entity\NodeType;

@@ -19,4 +24,3 @@ function elasticsearch_search_api_install() {
    UtilityHelper::configureSearchIndexViewMode($content_type);
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ use Drupal\elasticsearch_search_api\Form\SearchForm;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Class ExampleSearchController.
 * Controller for the 'example/search' page.
 */
class ExampleSearchController extends SearchController {

+10 −3
Original line number Diff line number Diff line
@@ -242,10 +242,12 @@ class ExampleElasticSearchParamsBuilder extends ElasticSearchParamsBuilder {
  /**
   * Dynamically generate a list of fields to add to the query.
   *
   * This list will include a basic field query + optionally include an ngram query.
   * This list will include a basic field query
   * and optionally include an ngram query.
   * Every list item will contain boosting.
   *
   * @return array
   *   An array of fields.
   */
  protected function buildMultimatchFields($include_ngram = TRUE) {
    $multi_match_fields = [];
@@ -266,10 +268,11 @@ class ExampleElasticSearchParamsBuilder extends ElasticSearchParamsBuilder {
   *
   * Format: field_paragraph_title^5
   *
   * @param \Drupal\search_api\Item\FieldInterface
   * @param \Drupal\search_api\Item\FieldInterface $field
   *   A configured search api field.
   *
   * @return string
   *   Field identifier string with boosting value.
   */
  protected function buildBasicFieldMatch(FieldInterface $field) {
    return "{$field->getFieldIdentifier()}^{$field->getBoost()}";
@@ -285,10 +288,11 @@ class ExampleElasticSearchParamsBuilder extends ElasticSearchParamsBuilder {
   * using the NGRAM_FIELD_BOOST_EXCEPTIONS constant, to provide
   * field specific ngram boosting.
   *
   * @param \Drupal\search_api\Item\FieldInterface
   * @param \Drupal\search_api\Item\FieldInterface $field
   *   A configured search api field.
   *
   * @return string
   *   Field name as a string concatenated with ngram boosting value.
   */
  protected function buildNgramFieldMatch(FieldInterface $field) {
    $field_name = $field->getFieldIdentifier();
@@ -303,6 +307,9 @@ class ExampleElasticSearchParamsBuilder extends ElasticSearchParamsBuilder {

  /**
   * Build the multi match queries.
   *
   * @return array
   *   The multi match query in array format.
   */
  protected function buildMultiMatchQueries($keyword) {
    $quoted_phrase = UtilityHelper::extractQuotedString($keyword);
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ use Drupal\elasticsearch_search_api\Search\Facet\Control\TermFacetBase;
use Drupal\elasticsearch_search_api\Search\Facet\FacetValueMetaDataTreeStorageInterface;

/**
 * Class PageTypeFacetControl.
 * TermFacet for the page_type vocabulary.
 */
class PageTypeFacetControl extends TermFacetBase {

+3 −3
Original line number Diff line number Diff line
@@ -7,13 +7,13 @@ use Drupal\search_api\Entity\Index;
use Drush\Commands\DrushCommands;

/**
 * Class SearchCommands.
 * Defines Drush commands for the ElasticSearch Search API.
 */
class SearchCommands extends DrushCommands {

  /**
   * Index.
   *f
   * The index.
   *
   * @var \Drupal\search_api\Entity\Index
   */
  private $index;
Loading