code: def test_lengths():
      schema = fields.Schema(id=fields.STORED, text=fields.TEXT)
      ix = RamStorage().create_index(schema)
  
      w = ix.writer()
      w.add_document(id=1, text=u("alfa bravo charlie delta echo"))
      w.add_document(id=2, text=u("bravo charlie delta echo foxtrot"))
      w.add_document(id=3, text=u("charlie needle echo foxtrot golf"))
      w.add_document(id=4, text=u("delta echo foxtrot golf hotel"))
      w.add_document(id=5, text=u("echo needle needle hotel india"))
      w.add_document(id=6, text=u("foxtrot golf hotel india juliet"))
      w.add_document(id=7, text=u("golf needle india juliet kilo"))
      w.add_document(id=8, text=u("hotel india juliet needle lima"))
      w.commit()
  
      with ix.searcher() as s:
          q = query.Or(
              [
                  query.Term("text", u("needle")),
                  query.Term("text", u("charlie")),
              ]
          )
          r = s.search(q, limit=2)
          assert not r.has_exact_length()
          assert r.estimated_length() == 7
          assert r.estimated_min_length() == 3
          assert r.scored_length() == 2
          assert len(r) == 6
  
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 17 for calling a global function with example usage: test_lengths() without return types