Interfacee to xapian
Common interface for IO
Reader Class
- class xettel.zxapian.reader.ZXReader(folder: str)
Class for reading the Xapian database
- db_to_zk() xettel.impl.xapian.ZettelkastenX.ZettelkastenX
Export the database to a Zettelkasten
- search(querystring: str, sort: bool = False, n: Optional[int] = None) xapian.MSet
Search the database (with limitations) Basically no wrapper around Xapian
The method also implements a different way of querying the full database when
querystring
is'*'
thanZXReader.db_to_zk
. Instead of rebuilding the Zettelkasten, this returns axapian.MSet
. This allows for an efficient sorting which is done byxapian
, as well as a limited subset of the results.
- search_zk(querystring: str, sort: bool = False, n: Optional[int] = None) xettel.impl.xapian.ZettelkastenX.ZettelkastenX
Search the database and returns a Zettelkasten with only the matching zettels.
Writer Class
- class xettel.zxapian.writer.ZXWriter(folder: str)
- delete_in_database(zettelkasten: Zettelkasten[ZFT], stored_zk: Optional[ZettelkastenX[ZFT]] = None) int
Delete Zettels not present in provided Zettelkasten from the db
Returns the number of deleted zettels
- index_zettel(zettel: xettel.zxapian.writer.ZFT) None
Indexes a single zettel into the xapian database.
Given that the indexing strategy is to map ZK UIDs, this eventually overwrites a previous zettel indexed with the same UID.