class_docstr: Group of functions related to elasticsearch filters
class_docstr_tok: ["Group","of","functions","related","to","elasticsearch","filters"]
code: def boolean_filter(
      filter_query: Optional[Dict[str, Any]] = None,
      must_query: Optional[Dict[str, Any]] = None,
      must_not_query: Optional[Dict[str, Any]] = None,
      should_filters: Optional[List[Dict[str, Any]]] = None,
      minimum_should_match: Union[int, str] = 1,
  ):
      es_query = {}
  
      if filter_query:
          es_query["filter"] = filter_query
  
      if must_query:
          es_query["must"] = must_query
  
      if must_not_query:
          es_query["must_not"] = must_not_query
  
      if should_filters:
          es_query["should"] = should_filters
          es_query["minimum_should_match"] = minimum_should_match or 1
  
      if not es_query:
          raise ValueError(
              "Must provide minimal data for boolean query"
          )
  
      return {"bool": es_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 1 for calling the filters obj's underlying member method code with example usage: obj.boolean_filter(filter_query, must_query, must_not_query, should_filters, minimum_should_match) and returns: dict