You are here

function search_api_update_8108 in Search API 8

Add configuration for boost factors.

File

./search_api.install, line 348
Install, update and uninstall functions for the Search API module.

Code

function search_api_update_8108() {
  $settings = \Drupal::configFactory()
    ->getEditable('search_api.settings');
  $data = $settings
    ->getRawData();
  $data += [
    'boost_factors' => [
      0.0,
      0.1,
      0.2,
      0.3,
      0.5,
      0.6,
      0.7,
      0.8,
      0.9,
      1.0,
      1.1,
      1.2,
      1.3,
      1.4,
      1.5,
      2.0,
      3.0,
      5.0,
      8.0,
      13.0,
      21.0,
    ],
  ];
  $settings
    ->setData($data)
    ->save(TRUE);
}