class_docstr: Group of functions related to elasticsearch filters
class_docstr_tok: ["Group","of","functions","related","to","elasticsearch","filters"]
docstr: Filter records matching text query
docstr_tok: ["Filter","records","matching","text","query"]
code: def text_query(text_query: Optional[str]) -> Dict[str, Any]:
      """Filter records matching text query"""
      if text_query is None:
          return filters.match_all()
      return filters.boolean_filter(
          must_query={
              "query_string": {
                  "default_field": "text",
                  "default_operator": "AND",
                  "query": text_query,
              }
          },
      )
  
imports: from enum import Enum
  from typing import Any, Dict, List, Optional, Type, Union
  from argilla.server.commons.models import TaskStatus
  from argilla.server.daos.backend.mappings.helpers import mappings
  from argilla.server.pydantic_v1 import BaseModel
label_desc: Use image node_id 10 for calling the filters obj's underlying member method code with example usage: obj.text_query(text_query) and returns: filters, filters