class_docstr: Encapsulates logic about the communication, queries and index mapping
  transformations between DAOs layer and the elasticsearch backend.
code: def _configure_metadata_fields(
      self, index: str, metadata_values: Dict[str, Any]
  ):
      def check_metadata_length(metadata_length: int = 0):
          if metadata_length > settings.metadata_fields_limit:
              raise MetadataLimitExceededError(
                  length=metadata_length,
                  limit=settings.metadata_fields_limit,
              )
  
      def detect_nested_type(v: Any) -> bool:
          """Returns True if value match as nested value"""
          return isinstance(v, list) and isinstance(v[0], dict)
  
      check_metadata_length(len(metadata_values))
      check_metadata_length(
          len(
              {
                  *self.client.get_property_type(
                      index=index,
                      property_name="metadata",
                      drop_extra_props=True,
                  ),
                  *[f"metadata.{k}" for k in metadata_values.keys()],
              }
          )
      )
  
      index_mappings = {}
      for field, value in metadata_values.items():
          if field.startswith(PROTECTED_METADATA_FIELD_PREFIX):
              index_mappings[
                  f"metadata.{field}"
              ] = mappings.protected_non_searchable_field()
          elif detect_nested_type(value):
              index_mappings[
                  f"metadata.{field}"
              ] = mappings.nested_field()
  
      self.client.set_index_mappings(index, properties=index_mappings)
  
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 13 for calling the GenericElasticEngineBackend obj's underlying member method code with example usage: obj._configure_metadata_fields(index, metadata_values) and returns: unknown