code: def test_column_query():
      schema = fields.Schema(
          id=fields.STORED,
          a=fields.ID(sortable=True),
          b=fields.NUMERIC(sortable=True),
      )
      with TempIndex(schema, "columnquery") as ix:
          with ix.writer(codec=W3Codec()) as w:
              w.add_document(id=1, a=u("alfa"), b=10)
              w.add_document(id=2, a=u("bravo"), b=20)
              w.add_document(id=3, a=u("charlie"), b=30)
              w.add_document(id=4, a=u("delta"), b=40)
              w.add_document(id=5, a=u("echo"), b=50)
              w.add_document(id=6, a=u("foxtrot"), b=60)
  
          with ix.searcher() as s:
  
              def check(q):
                  return [
                      s.stored_fields(docnum)["id"]
                      for docnum in q.docs(s)
                  ]
  
              q = query.ColumnQuery("a", u("bravo"))
              assert check(q) == [2]
  
              q = query.ColumnQuery("b", 30)
              assert check(q) == [3]
  
              q = query.ColumnQuery("a", lambda v: v != u("delta"))
              assert check(q) == [1, 2, 3, 5, 6]
  
              q = query.ColumnQuery("b", lambda v: v > 30)
              assert check(q) == [4, 5, 6]
  
file_path: whoosh/tests/test_columns.py
imports: from __future__ import with_statement
  import inspect, random, sys
  from whoosh import columns, fields, query
  from whoosh.codec.whoosh3 import W3Codec
  from whoosh.compat import b, u, BytesIO, bytes_type, text_type
  from whoosh.compat import izip, xrange, dumps, loads
  from whoosh.filedb import compound
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempIndex, TempStorage
label_desc: Use image node_id 8 for calling a global function with example usage: test_column_query() and returns: unknown