libzim.search
libzim search module
- Query to prepare a query from a string
- Searcher to perform a search over a libzim.reader.Archive
Usage:
archive = libzim.reader.Archive(fpath)
searcher = Searcher(archive)
query = Query().set_query("foo")
search = searcher.search(query)
for path in search.getResults(10, 10) # get result from 10 to 20 (10 results)
print(path, archive.get_entry_by_path(path).title)
Classes:
-
Query–ZIM agnostic Query-builder to use with a Searcher.
-
Search–Search request over a ZIM Archive.
-
SearchResultSet–Iterator over a Search result: entry paths.
-
Searcher–ZIM Archive Searcher.
Query
ZIM agnostic Query-builder to use with a Searcher.
Methods:
-
set_query–Set the textual query of the
Query.
Search
Search request over a ZIM Archive.
Methods:
-
getEstimatedMatches–Estimated number of results in Archive for the search.
-
getResults–Iterator over Entry paths found in Archive for the search.
getEstimatedMatches
method descriptor
getEstimatedMatches() -> int
Estimated number of results in Archive for the search.
Returns:
-
int–The number of estimeated results for this search.
getResults
method descriptor
getResults(start: int, count: int) -> SearchResultSet
Iterator over Entry paths found in Archive for the search.
Parameters:
-
start(int) –The beginning of the range to get (offset of the first result).
-
count(int) –The number of results to return.
Returns:
-
SearchResultSet–A set of results for this search.
SearchResultSet
Iterator over a Search result: entry paths.