class_docstr: The Hit class is used to manage and access elements in a document.
  
  It inherits from the AttributeDict class and provides
  attribute-like access to its elements, similar to a dictionary.
class_docstr_tok: ["The","Hit","class","is","used","to","manage","and","access","elements","in","a","document",".","It","inherits","from","the","AttributeDict","class","and","provides","attribute-like","access","to","its","elements",",","similar","to","a","dictionary","."]
code: def __init__(self, document):
      data = {}
      if "_source" in document:
          data = document["_source"]
      if "fields" in document:
          data.update(document["fields"])
  
      super().__init__(data)
      super().__setattr__("meta", HitMeta(document))
  
imports: from __future__ import annotations
  from typing import Iterator
label_desc: Use image node_id 1 to create a new Hit object from inherited base classes: AttributeDict with example: obj = Hit(document)