You are here

function search_api_index_edit_fields in Search API 7

Changes an index' indexed field settings.

Parameters

int|string $id: The ID or machine name of the index whose fields should be changed.

array $fields: The new indexed field settings.

Return value

int|false 1 if the field settings were changed, 0 if they already had the desired values. FALSE on failure.

File

./search_api.module, line 2958
Provides a flexible framework for implementing search services.

Code

function search_api_index_edit_fields($id, array $fields) {
  $index = search_api_index_load($id, TRUE);
  $options = $index->options;
  $options['fields'] = $fields;
  $ret = $index
    ->update(array(
    'options' => $options,
  ));
  return $ret ? 1 : $ret;
}