class_docstr: Encapsulates logic about the communication, queries and index mapping
  transformations between DAOs layer and the elasticsearch backend.
code: def _compute_metric(
      self,
      index: str,
      metric_id: str,
      query: Optional[BaseQuery] = None,
      params: Optional[Dict[str, Any]] = None,
  ) -> Dict:
      metric = self.find_metric_by_id(metric_id)
      data = self.client.compute_index_metric(
          index=index,
          metric=metric,
          query=query,
          params=params or {},
      )
      return data
  
imports: from typing import Any, Dict, Iterable, List, Optional, Tuple
  from argilla.logging import LoggingMixin
  from argilla.server.commons.models import TaskType
  from argilla.server.constants import PROTECTED_METADATA_FIELD_PREFIX
  from argilla.server.daos.backend.base import IndexNotFoundError, InvalidSearchError
  from argilla.server.daos.backend.client_adapters.base import IClientAdapter
  from argilla.server.daos.backend.client_adapters.factory import ClientAdapterFactory
  from argilla.server.daos.backend.mappings.datasets import DATASETS_INDEX_NAME, datasets_index_mappings
  from argilla.server.daos.backend.mappings.helpers import mappings, tasks_common_mappings, tasks_common_settings
  from argilla.server.daos.backend.mappings.text2text import text2text_mappings
  from argilla.server.daos.backend.mappings.text_classification import text_classification_mappings
  from argilla.server.daos.backend.mappings.token_classification import token_classification_mappings
  from argilla.server.daos.backend.metrics import ALL_METRICS
  from argilla.server.daos.backend.metrics.base import ElasticsearchMetric
  from argilla.server.daos.backend.search.model import BackendRecordsQuery, BaseDatasetsQuery, BaseQuery, BaseRecordsQuery, SortableField, SortConfig
  from argilla.server.errors import BadRequestError, EntityNotFoundError
  from argilla.server.errors.task_errors import MetadataLimitExceededError
  from argilla.server.pydantic_v1 import BaseModel, Field
  from argilla.server.settings import settings
label_desc: Use image node_id 27 for calling the GenericElasticEngineBackend obj's underlying member method code with example usage: obj._compute_metric(index, metric_id, query, params) and returns: data