class documentation
class BaseSearch(object):
Known subclasses: pyzim.search.TitleStartSearch, pyzim.search.XapianSearch
Constructor: BaseSearch(zim)
Base class for search and suggestion implementations.
| Method | __init__ |
The default constructor. |
| Method | close |
Perform any necessary cleanup. |
| Method | search |
Perform a search. |
| Method | search |
Perform a range-limited search. |
| Instance Variable | zim |
the ZIM archive this search is for |
overridden in
pyzim.search.TitleStartSearch, pyzim.search.XapianSearchThe default constructor.
| Parameters | |
zim:pyzim.archive.Zim | the ZIM archive this search is for |
overridden in
pyzim.search.XapianSearchPerform any necessary cleanup.
This should be called before the instance is dismissed.
overridden in
pyzim.search.TitleStartSearch, pyzim.search.XapianSearchPerform a search.
| Parameters | |
term:str | term to search for |
| Returns | |
SearchResultSet | an object containing the search results |
overridden in
pyzim.search.TitleStartSearch, pyzim.search.XapianSearchPerform a range-limited search.
This function is primarily a helper function used by SearchResultSet to iteratively fetch new results, but it can still be used independently. Just beware of the different return type.
| Parameters | |
term:str | term to search for |
start:int | start (1-based index) of the results to find |
n:int | number of results to fetch |
| Returns | |
list of SearchResult | an object containing the search results |