class_docstr: Uses an ExpansionModel to expand the set of query terms based on the top
  N result documents.
code: def add_document(self, docnum):
      ixreader = self.ixreader
      if self.ixreader.has_vector(docnum, self.fieldname):
          self.add(ixreader.vector_as("weight", docnum, self.fieldname))
      elif self.ixreader.schema[self.fieldname].stored:
          self.add_text(
              ixreader.stored_fields(docnum).get(self.fieldname)
          )
      else:
          raise Exception(
              "Field %r in document %s is not vectored or stored"
              % (self.fieldname, docnum)
          )
  
imports: from __future__ import division
  import random
  from collections import defaultdict
  from math import log
  from whoosh.compat import xrange, iteritems
label_desc: Use image node_id 3 for calling the Expander obj's underlying member method code with example usage: obj.add_document(docnum) without return types