code: def test_addfield():
      schema = fields.Schema(
          id=fields.ID(stored=True), content=fields.TEXT
      )
      with TempIndex(schema, "addfield") as ix:
          w = ix.writer()
          w.add_document(id=u("a"), content=u("alfa"))
          w.add_document(id=u("b"), content=u("bravo"))
          w.add_document(id=u("c"), content=u("charlie"))
          w.commit()
  
          ix.add_field("added", fields.KEYWORD(stored=True))
  
          w = ix.writer()
          w.add_document(
              id=u("d"), content=u("delta"), added=u("fourth")
          )
          w.add_document(id=u("e"), content=u("echo"), added=u("fifth"))
          w.commit(merge=False)
  
          with ix.searcher() as s:
              assert ("id", "d") in s.reader()
              assert s.document(id="d") == {
                  "id": "d",
                  "added": "fourth",
              }
              assert s.document(id="b") == {"id": "b"}
  
file_path: whoosh/tests/test_flexible.py
imports: from __future__ import with_statement
  from whoosh import fields
  from whoosh.compat import u, b
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 1 for calling a global function with example usage: test_addfield() without return types