code: def es_mapping_for_question(question: Question) -> dict:
      question_type = question.type
  
      if question_type == QuestionType.rating:
          # See https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
          return {"type": "integer"}
      elif question_type == QuestionType.text:
          # TODO: Review mapping for label selection. Could make sense to use `keyword` mapping instead.
          #  See https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html
          #  See https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html
          return {"type": "text", "index": False}
      elif question_type in [
          QuestionType.label_selection,
          QuestionType.multi_label_selection,
      ]:
          return {"type": "keyword"}
      elif question_type == QuestionType.ranking:
          return {
              "type": "nested",
              "properties": {
                  "rank": {"type": "integer"},
                  "value": {"type": "keyword"},
              },
          }
      else:
          raise Exception(
              f"ElasticSearch mappings for Question of type {question_type} cannot be generated"
          )
  
imports: import dataclasses
  from abc import abstractmethod
  from typing import Any, Dict, Iterable, List, Optional, Union
  from uuid import UUID
  from argilla.server.enums import FieldType, MetadataPropertyType, RecordSortField, ResponseStatusFilter, SimilarityOrder
  from argilla.server.models import Dataset, Field, MetadataProperty, Question, QuestionType, Record, Response, ResponseStatus, Suggestion, Vector, VectorSettings
  from argilla.server.search_engine.base import AndFilter, Filter, FilterScope, FloatMetadataFilter, FloatMetadataMetrics, IntegerMetadataFilter, IntegerMetadataMetrics, MetadataFilter, MetadataFilterScope, MetadataMetrics, Order, RangeFilter, RecordFilterScope, ResponseFilterScope, SearchEngine, SearchResponseItem, SearchResponses, SortBy, SuggestionFilterScope, TermsFilter, TermsMetadataFilter, TermsMetadataMetrics, TextQuery, UserResponseStatusFilter
label_desc: Use image node_id 14 for calling a global function with example usage: es_mapping_for_question(question) and returns: dict, dict, dict, dict