code: def test_andnot_reverse():
      # Bitbucket issue 419
      docs = ["ruby", "sapphire", "ruby + sapphire"]
      schema = fields.Schema(name=fields.TEXT(stored=True))
      q = query.AndNot(
          query.Term("name", "ruby"), query.Term("name", "sapphire")
      )
  
      with TempIndex(schema) as ix:
          with ix.writer() as w:
              for name in docs:
                  w.add_document(name=u(name))
  
          with ix.searcher() as s:
              names_fw = [
                  hit["name"] for hit in s.search(q, limit=None)
              ]
  
      with TempIndex(schema) as ix:
          with ix.writer() as w:
              for name in reversed(docs):
                  w.add_document(name=u(name))
  
          with ix.searcher() as s:
              names_rv = [
                  hit["name"] for hit in s.search(q, limit=None)
              ]
  
      assert len(names_fw) == len(names_rv) == 1
      assert names_fw == names_rv
  
imports: from __future__ import with_statement
  import copy
  import pytest
  from whoosh import fields, qparser, query
  from whoosh.compat import b, u
  from whoosh.filedb.filestore import RamStorage
  from whoosh.qparser import QueryParser
  from whoosh.query import And
  from whoosh.query import AndMaybe
  from whoosh.query import ConstantScoreQuery
  from whoosh.query import DateRange
  from whoosh.query import DisjunctionMax
  from whoosh.query import Every
  from whoosh.query import FuzzyTerm
  from whoosh.query import Not
  from whoosh.query import NullQuery
  from whoosh.query import NumericRange
  from whoosh.query import Or
  from whoosh.query import Phrase
  from whoosh.query import Prefix
  from whoosh.query import Require
  from whoosh.query import Term
  from whoosh.query import TermRange
  from whoosh.query import Variations
  from whoosh.query import Wildcard
  from whoosh.query.spans import SpanContains
  from whoosh.query.spans import SpanFirst
  from whoosh.query.spans import SpanNear
  from whoosh.query.spans import SpanNot
  from whoosh.query.spans import SpanOr
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 24 for calling a global function with example usage: test_andnot_reverse() without return types