Search API view fields how to add operations?

I’m using Search API module. I have created Content Search Index.

By default it’s not providing Operations (Edit/Delete).

In module.theme file

    function HOOK_views_data_alter(array &$data) {
      $data['search_api_index_content_search']['custom_operations'] = array(
        'title' => t('Operations links'),
        'field' => array(
          'title' => t('Operations links'),
          'help' => t('Provides links to perform entity operations.'),
          'id' => 'custom_operations',

Then I have created Views Field file.


    namespace Drupalmy_modulePluginviewsfield;
    use DrupalviewsResultRow;
    use DrupalviewsPluginviewsfieldFieldPluginBase;
    class CustomOperations extends FieldPluginBase {
      public function render(ResultRow $values) {
        $entity = $this->getValue($values);
        $operations['edit'] = [
            'title' => $this->t('Edit'),
            'url' => DrupalCoreUrl::fromRoute('<front>'),
        $build = [
          '#type' => 'operations',
          '#links' => $operations,

        return $build;

Here I’m not able to get Entity. How to get that & pass correct URL?

Drupal version: