code: def get_index():
      global _ix
  
      if _ix is not None:
          return _ix
  
      charfield = fields.FieldType(
          formats.Characters(),
          analysis.SimpleAnalyzer(),
          scorable=True,
          stored=True,
      )
      schema = fields.Schema(text=charfield)
      st = RamStorage()
      _ix = st.create_index(schema)
  
      w = _ix.writer()
      for ls in permutations(domain, 4):
          w.add_document(text=u(" ").join(ls), _stored_text=ls)
      w.commit()
  
      return _ix
  
imports: from __future__ import with_statement
  from whoosh import analysis, fields, formats
  from whoosh.compat import u, xrange, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.query import spans
  from whoosh.query import And, Or, Term, Phrase
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 1 for calling a global function with example usage: get_index() and returns: _ix, _ix