code: def test_filter_by_result():
      schema = fields.Schema(
          title=fields.TEXT(stored=True),
          content=fields.TEXT(stored=True),
      )
  
      with TempIndex(schema, "filter") as ix:
          words = u("foo bar baz qux barney").split()
          with ix.writer() as w:
              for x in xrange(100):
                  t = u("even" if x % 2 == 0 else "odd")
                  c = words[x % len(words)]
                  w.add_document(title=t, content=c)
  
          with ix.searcher() as searcher:
              fq = query.Term("title", "even")
              filter_result = searcher.search(fq)
              assert filter_result.docset is None
  
              q = query.Term("content", "foo")
  
              # filter_result.docs()
              result = searcher.search(q, filter=filter_result)
              assert all(
                  x["title"] == "even" and x["content"] == "foo"
                  for x in result
              )
  
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 26 for calling a global function with example usage: test_filter_by_result() without return types