This module implements an index for the datastore.
The index is implemented as an SQLite 3 database.
It provides fast access to data about the current state of the site. History is not indexed, each access to it requires direct access to the DVCS repository.
Despite the database terminology, this is not a relational database index: the whole database works as an index to the data in the current revision of the DVCS.
The index format is not documented and changes often. The index_revision site property stored only in the index is used to determine which format is used. Access to an index file of different revision will fail, remove it and regenerate to use it with the current version of Lethe.
refer to the UI for syncing the index after it’s written and before there is separate usage documentation for this
Access to the index of a store.
If the index file is missing, it is created in the current revision.
if the index file exist and has a different revision than is used by the current version of Lethe
Close the index, freeing resources used.
Iterate nodes found by searching for text in all data that the index has, including node text words.
The argument is used as a query expression for SQLite FTS4 extension supporting its query syntax.
Return the lethe.datastore.Node instance of the given uuid.
Node data is loaded from the index. The uuid must be in the exact form used for node identification. Use lethe.datastore.store.get_node in your code, it handles user-specified UUIDs.
Add the node to the index.
Index site properties.
Iterate nodes found in the index.
Load site properties from the index.
Iterate nodes with a property of given key and value.
Iterate nodes found by searching for text in their UUIDs, titles, title aliases and slugs.
Reindex all nodes.
Iterate pairs of tag name and number of tagged nodes.
The results are sorted by tag names.
Iterate nodes with the given tag.
Remove the node from the index.
Exception rised when opening an index file of unsupported revision.