Handler not working for Search API

Created on 7 June 2019, over 5 years ago
Updated 3 May 2024, 8 months ago

The module doesn't work with Search API. Given that this is a temporary module, I recommend any other punters out there having the same problem create a custom function similar to the following:

/**
 * Implements hook_views_data_alter().
 */
function MYMODULE_views_data_alter(array &$data) {

  $data['search_api_index_MYSEARCHINDEX']['FIELDMACHINENAME']['filter'] = [
    'title' => t('MYFIELD filter'),
    'help' => t('MYFIELD date.'),
    'field' => 'FIELDMACHINENAME_value',
    'table' => 'node__FIELDMACHINENAME',
    'id' => 'views_daterange_filters_daterange',
    'field_name' => 'FIELDMACHINENAME',
    'entity_type' => 'node',
  ];
}

The above uses a node entity type. Further substitutions necessary for other types.

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇳🇿New Zealand kent@passingphase.nz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024