Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1424 from ec-europa/ISAICP-4898
Browse files Browse the repository at this point in the history
ISAICP-4898: content type boosts are not working anymore
  • Loading branch information
claudiu-cristea authored Nov 23, 2018
2 parents b7bedb3 + 76d77a7 commit ada02fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions tests/features/joinup_search/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ Feature: Global search
| title | Bird outposts in the wild |
| description | Exotic wings and where to find them. |
| state | validated |
And collection:
| title | Ornithology: the study of birds |
| description | Ornithology is a branch of zoology. |
| state | validated |
| affiliates | Bird outposts in the wild |
And collections:
| title | description | state | affiliates |
| Ornithology: the study of birds | Ornithology is a branch of zoology. | validated | Bird outposts in the wild |
| Husky Flying Xylophone | A strange instrument. | validated | |
And custom_page content:
| title | body | collection |
| Disturbed birds | Flocks of trained pigeons flying off. | Ornithology: the study of birds |
And news content:
| title | body | collection | state |
| Chickens are small birds | Domesticated in India. | Ornithology: the study of birds | validated |
| title | body | collection | state |
| Chickens are small birds | Birds domesticated in India. | Ornithology: the study of birds | validated |
| Found a xylophone from 1600 in Asia | Oldest instrument of this type. | Husky Flying Xylophone | validated |
And event content:
| title | body | collection | state |
| Bird spotting | Roosters crow at dawn. | Ornithology: the study of birds | validated |
Expand Down
9 changes: 6 additions & 3 deletions web/modules/custom/joinup_search/joinup_search.module
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,15 @@ function joinup_search_search_api_solr_field_mapping_alter(IndexInterface $index
* Implements hook_search_api_solr_query_alter().
*/
function joinup_search_search_api_solr_query_alter(SolariumQueryInterface $solarium_query, QueryInterface $query): void {
if (
!$solarium_query instanceof Query
) {
if (!$solarium_query instanceof Query) {
return;
}

// Keep the edismax parser to allow document boosting to work properly.
// @todo remove when document boosting is reimplemented by search_api_solr
// @see https://webgate.ec.europa.eu/CITnet/jira/browse/ISAICP-4907
$solarium_query->addParam('defType', 'edismax');

/** @var \Drupal\search_api_field\Plugin\Field\FieldType\SearchItem $item */
if (!$item = $query->getOption('search_api_field item')) {
return;
Expand Down

0 comments on commit ada02fc

Please sign in to comment.