Expand description
Seshat - a full text search library for Matrix clients.
There are two modes of operation for Seshat, adding live events as they come in:
use seshat::{Database, Event, Profile};
use tempfile::tempdir;
let tmpdir = tempdir().unwrap();
let mut database = Database::new(tmpdir.path()).unwrap();
/// Method to call for every live event that gets received during a sync.
fn add_live_event(event: Event, profile: Profile, database: &Database) {
database.add_event(event, profile);
}
/// Method to call on every successful sync after live events were added.
fn on_sync(database: &mut Database) {
database.commit().unwrap();
}The other mode is to add events from the room history using the
/room/{room_id}/messages Matrix API endpoint. This method supports
storing checkpoints which remember the arguments to continue fetching events
from the /room/{room_id}/messages API:
database.add_historic_events(events, old_checkpoint, new_checkpoint)?;Once events have been added a search can be done:
let result = database.search("test", &SearchConfig::new()).unwrap();Structs§
- Config
- Configuration for the seshat database.
- Connection
- A Seshat database connection that can be used for reading.
- Crawler
Checkpoint - A checkpoint that remembers the current point in a room timeline when fetching the history of the room.
- Database
- The Seshat database.
- Database
Stats - Statistical information about the database.
- Event
- Matrix event that can be added to the database.
- Load
Config - Configuration for the event loading methods.
- Profile
- A users profile information at the time an event was posted.
- Receiver
- The receiving half of Rust’s
channel(orsync_channel) type. This half can only be owned by one thread. - Recovery
Database - Database that can be used to reindex the events.
- Recovery
Info - Info about the recovery process.
- Search
Batch - A batch of search results that were returned during a search.
- Search
Config - Search configuration A search configuration allows users to limit the search to a specific room or limit the search to specific event types. The search result can be configured in various ways as well.
- Search
Result - A search result
- Searcher
- The main entry point to the index and database.
Enums§
- Checkpoint
Direction - Error
- Seshat error types.
- Event
Type - Matrix event types.
- Language
- Load
Direction
Type Aliases§
- Result
- Result type for seshat operations.