class_docstr: Helper class that creates a search index based on the doctrees
  passed to the `feed` method.
class_docstr_tok: ["Helper","class","that","creates","a","search","index","based","on","the","doctrees","passed","to","the","`","feed","`","method","."]
docstr: Create a usable data structure for serializing.
docstr_tok: ["Create","a","usable","data","structure","for","serializing","."]
code: def freeze(self) -> dict[str, Any]:
      """Create a usable data structure for serializing."""
      docnames, titles = zip(*sorted(self._titles.items()))
      filenames = [self._filenames.get(docname) for docname in docnames]
      fn2index = {f: i for (i, f) in enumerate(docnames)}
      terms, title_terms = self.get_terms(fn2index)
  
      objects = self.get_objects(fn2index)  # populates _objtypes
      objtypes = {
          v: k[0] + ":" + k[1] for (k, v) in self._objtypes.items()
      }
      objnames = self._objnames
  
      alltitles: dict[str, list[tuple[int, str]]] = {}
      for docname, titlelist in sorted(self._all_titles.items()):
          for title, titleid in titlelist:
              alltitles.setdefault(title, []).append(
                  (fn2index[docname], titleid)
              )
  
      index_entries: dict[str, list[tuple[int, str]]] = {}
      for docname, entries in self._index_entries.items():
          for entry, entry_id, main_entry in entries:
              index_entries.setdefault(entry.lower(), []).append(
                  (fn2index[docname], entry_id)
              )
  
      return dict(
          docnames=docnames,
          filenames=filenames,
          titles=titles,
          terms=terms,
          objects=objects,
          objtypes=objtypes,
          objnames=objnames,
          titleterms=title_terms,
          envversion=self.env.version,
          alltitles=alltitles,
          indexentries=index_entries,
      )
  
imports: from __future__ import annotations
  import dataclasses
  import functools
  import html
  import json
  import pickle
  import re
  from importlib import import_module
  from os import path
  from typing import IO, TYPE_CHECKING, Any
  from docutils import nodes
  from docutils.nodes import Element, Node
  from sphinx import addnodes, package_dir
  from sphinx.environment import BuildEnvironment
  from sphinx.util.index_entries import split_index_msg
  from sphinx.search.en import SearchEnglish
label_desc: Use image node_id 6 for calling the IndexBuilder obj's underlying member method code with example usage: obj.freeze() and returns: dict