Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/searching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ To limit the amount of time a search can take::
with myindex.searcher() as s:
# Get a collector object
c = s.collector(limit=None, sortedby="title_exact")
# Wrap it in a TimeLimitedCollector and set the time limit to 10 seconds
tlc = TimeLimitedCollector(c, timelimit=10.0)
# Wrap it in a TimeLimitCollector and set the time limit to 10 seconds
tlc = TimeLimitCollector(c, timelimit=10.0)

# Try searching
try:
Expand Down
2 changes: 1 addition & 1 deletion src/whoosh/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ class TimeLimitCollector(WrappingCollector):
does not complete within a certain number of seconds::

uc = collectors.UnlimitedCollector()
tlc = TimeLimitedCollector(uc, timelimit=5.8)
tlc = TimeLimitCollector(uc, timelimit=5.8)
try:
mysearcher.search_with_collector(myquery, tlc)
except collectors.TimeLimit:
Expand Down
8 changes: 4 additions & 4 deletions src/whoosh/searching.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class NoTermsException(Exception):


class TimeLimit(Exception):
"""Raised by :class:`TimeLimitedCollector` if the time limit is reached
"""Raised by :class:`TimeLimitCollector` if the time limit is reached
before the search finishes. If you have a reference to the collector, you
can get partial results by calling :meth:`TimeLimitedCollector.results`.
can get partial results by calling :meth:`TimeLimitCollector.results`.
"""

pass
Expand Down Expand Up @@ -688,9 +688,9 @@ def collector(self, limit=10, sortedby=None, reverse=False, groupedby=None,
# Create a TopCollector
c = mysearcher.collector(limit=10)

# Wrap it with a TimeLimitedCollector with a time limit of
# Wrap it with a TimeLimitCollector with a time limit of
# 10.5 seconds
from whoosh.collectors import TimeLimitedCollector
from whoosh.collectors import TimeLimitCollector
c = TimeLimitCollector(c, 10.5)

# Search using the custom collector
Expand Down