class documentation

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_in_range Perform a range-limited search.
Instance Variable zim the ZIM archive this search is for
def __init__(self, zim):

The default constructor.

Parameters
zim:pyzim.archive.Zimthe ZIM archive this search is for
def close(self):

Perform any necessary cleanup.

This should be called before the instance is dismissed.

def search(self, term):

Perform a search.

Parameters
term:strterm to search for
Returns
SearchResultSetan object containing the search results
def search_in_range(self, term, start=None, n=20):

Perform 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:strterm to search for
start:intstart (1-based index) of the results to find
n:intnumber of results to fetch
Returns
list of SearchResultan object containing the search results

the ZIM archive this search is for