class documentation

A search for finding entries using a xapian database.

Class Method open_fulltext Open the xapian fulltext index.
Class Method open_title Open the xapian title index.
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 _database Undocumented
Instance Variable _fd Undocumented
Instance Variable _full_url Undocumented
Instance Variable _queryparser Undocumented
Instance Variable _stemmer Undocumented
Property _offset Return the offset of the database in the ZIM file

Inherited from BaseSearch:

Instance Variable zim the ZIM archive this search is for
def open_fulltext(cls, *args, **kwargs):

Open the xapian fulltext index.

Parameters
*args:tupleadditional arguments that will be passed to XapianSearch.__init__
**kwargs:dictadditional keyword arguments that will be passed to XapianSearch.__init__
Returns
XapianSearcha xapian search using the fulltext index of a ZIM
Raises
pyzim.exceptions.ZimFeatureMissingwhen the ZIM files does not include a xapian title index
pyzim.exceptions.MissingDependencywhen the xapian library could not be imported
def open_title(cls, *args, **kwargs):

Open the xapian title index.

Parameters
*args:tupleadditional arguments that will be passed to XapianSearch.__init__
**kwargs:dictadditional keyword arguments that will be passed to XapianSearch.__init__
Returns
XapianSearcha xapian search using the title index of a ZIM
Raises
pyzim.exceptions.ZimFeatureMissingwhen the ZIM files does not include a xapian title index
pyzim.exceptions.MissingDependencywhen the xapian library could not be imported
def __init__(self, *args, full_url='Xfulltext/xapian', **kwargs):

The default constructor.

All arguments that are not specific for this method will be passed to the superclass.

Parameters
*argsUndocumented
full_url:strfull URL of xapian database to use
**kwargsUndocumented
Raises
pyzim.exceptions.ZimFeatureMissingwhen the ZIM files does not include a xapian index at the specified full url
pyzim.exceptions.MissingDependencywhen the xapian library could not be imported
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
_database =

Undocumented

_fd =

Undocumented

_full_url =

Undocumented

_queryparser =

Undocumented

_stemmer =

Undocumented

_offset: int =

Return the offset of the database in the ZIM file