Loading elasticsearch_search_api.install +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; Loading @@ -19,4 +24,3 @@ function elasticsearch_search_api_install() { UtilityHelper::configureSearchIndexViewMode($content_type); } } modules/elasticsearch_search_api_example/src/Controller/ExampleSearchController.php +1 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading modules/elasticsearch_search_api_example/src/Search/ExampleElasticSearchParamsBuilder.php +10 −3 Original line number Diff line number Diff line Loading @@ -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 = []; Loading @@ -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()}"; Loading @@ -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(); Loading @@ -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); Loading modules/elasticsearch_search_api_example/src/Search/PageTypeFacetControl.php +1 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading src/Commands/SearchCommands.php +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
elasticsearch_search_api.install +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; Loading @@ -19,4 +24,3 @@ function elasticsearch_search_api_install() { UtilityHelper::configureSearchIndexViewMode($content_type); } }
modules/elasticsearch_search_api_example/src/Controller/ExampleSearchController.php +1 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading
modules/elasticsearch_search_api_example/src/Search/ExampleElasticSearchParamsBuilder.php +10 −3 Original line number Diff line number Diff line Loading @@ -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 = []; Loading @@ -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()}"; Loading @@ -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(); Loading @@ -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); Loading
modules/elasticsearch_search_api_example/src/Search/PageTypeFacetControl.php +1 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading
src/Commands/SearchCommands.php +3 −3 Original line number Diff line number Diff line Loading @@ -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