code: def test_results_filter():
      schema = fields.Schema(
          id=fields.STORED, words=fields.KEYWORD(stored=True)
      )
      ix = RamStorage().create_index(schema)
      w = ix.writer()
      w.add_document(id="1", words=u("bravo top"))
      w.add_document(id="2", words=u("alfa top"))
      w.add_document(id="3", words=u("alfa top"))
      w.add_document(id="4", words=u("alfa bottom"))
      w.add_document(id="5", words=u("bravo bottom"))
      w.add_document(id="6", words=u("charlie bottom"))
      w.add_document(id="7", words=u("charlie bottom"))
      w.commit()
  
      with ix.searcher() as s:
  
          def check(r, target):
              result = "".join(
                  s.stored_fields(d)["id"] for d in r.docs()
              )
              assert result == target
  
          r = s.search(query.Term("words", u("alfa")))
          r.filter(s.search(query.Term("words", u("bottom"))))
          check(r, "4")
  
imports: from __future__ import with_statement
  import pytest
  from whoosh import analysis, fields, formats, highlight, qparser, query
  from whoosh.codec.whoosh3 import W3Codec
  from whoosh.compat import u, xrange, text_type, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage, TempIndex
label_desc: Use image node_id 5 for calling a global function with example usage: test_results_filter() without return types