code: def _expected_value_for_question(
      question: Question,
  ) -> Dict[str, Any]:
      if question.type in [
          QuestionType.label_selection,
          QuestionType.multi_label_selection,
      ]:
          return {"type": "keyword"}
      elif question.type == QuestionType.text:
          return {"type": "text", "index": False}
      elif question.type == QuestionType.rating:
          return {"type": "integer"}
      elif question.type == QuestionType.ranking:
          return {"type": "nested"}
      else:
          return {}
  
file_path: argilla/tests/unit/server/search_engine/test_commons.py
imports: import random
  from typing import Any, Dict, List, Optional, Union
  import pytest
  import pytest_asyncio
  from argilla.server.enums import MetadataPropertyType, QuestionType, ResponseStatusFilter, SimilarityOrder
  from argilla.server.models import Dataset, Question, Record, User, VectorSettings
  from argilla.server.search_engine import FloatMetadataFilter, IntegerMetadataFilter, SortBy, SuggestionFilterScope, TermsFilter, TermsMetadataFilter, TextQuery, UserResponseStatusFilter
  from argilla.server.search_engine.commons import ALL_RESPONSES_STATUSES_FIELD, BaseElasticAndOpenSearchEngine, es_index_name_for_dataset
  from argilla.server.settings import settings
  from opensearchpy import OpenSearch
  from sqlalchemy.ext.asyncio import AsyncSession
  from sqlalchemy.orm import Session
  from tests.factories import DatasetFactory, FloatMetadataPropertyFactory, IntegerMetadataPropertyFactory, LabelSelectionQuestionFactory, MultiLabelSelectionQuestionFactory, QuestionFactory, RatingQuestionFactory, RecordFactory, ResponseFactory, SuggestionFactory, TermsMetadataPropertyFactory, TextFieldFactory, TextQuestionFactory, UserFactory, VectorFactory, VectorSettingsFactory
label_desc: Use image node_id 1 for calling a global function with example usage: _expected_value_for_question(question) and returns: dict, dict, dict, dict, dict