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

Commit

Permalink
Merge pull request #154 from froboy/patch-3
Browse files Browse the repository at this point in the history
Resolve "facets having mincount of 0 are not supported..."
  • Loading branch information
podarok authored Mar 10, 2022
2 parents 67fb719 + 07ec62f commit 5625c4a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/optional/search_api.index.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ field_settings:
label: 'Max Age'
datasource_id: 'entity:node'
property_path: field_session_max_age
type: integer
type: string
dependencies:
config:
- field.storage.node.field_session_max_age
Expand All @@ -245,7 +245,7 @@ field_settings:
label: 'Min Age'
datasource_id: 'entity:node'
property_path: field_session_min_age
type: integer
type: string
dependencies:
config:
- field.storage.node.field_session_min_age
Expand Down
27 changes: 27 additions & 0 deletions openy_activity_finder.install
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,30 @@ function openy_activity_finder_update_8403() {
$cim->importConfigs(['search_api.index.default']);
}
}

/**
* Update configs for search index.
*/
function openy_activity_finder_update_8404() {
_af_config_import();
}

/**
* Update configs for search index. Configs should be sent in an array where the
* key is the directory and the value is an array of config files.
*/
function _af_config_import($import = ['optional' => ['search_api.index.default']]) {
$cim = \Drupal::service('config_import.importer');
// Loop through keys as directories...
foreach ($import as $dir => $configs) {
$cim->setDirectory(\Drupal::service('extension.list.module')->getPath('openy_activity_finder') . '/config/'. $dir);
// Now process each config to be imported.
foreach ($configs as $name) {
$config = \Drupal::config($name);
if (!$config->isNew()) {
// Import config only in the case that it already exists.
$cim->importConfigs([$name]);
}
}
}
}

0 comments on commit 5625c4a

Please sign in to comment.