Files
tools/search/src/lib.rs
T

32 lines
732 B
Rust
Raw Normal View History

2026-06-08 19:33:49 -04:00
mod error;
mod index;
mod schema;
2026-08-05 11:21:25 -04:00
pub mod subtitles;
pub mod rdf;
pub mod language;
2026-06-08 19:33:49 -04:00
2026-08-05 11:21:25 -04:00
use oxigraph::model::NamedNodeRef;
2026-06-08 19:33:49 -04:00
pub use tantivy::TantivyDocument as SearchDocument;
2026-06-09 10:36:13 -04:00
pub use tantivy::doc;
2026-08-05 11:21:25 -04:00
pub use tantivy::schema::document::{Document, Value};
pub use tantivy::indexer::IndexWriter;
2026-06-08 19:33:49 -04:00
pub use error::{Result, SearchError};
pub use index::{SearchIndex, SearchIndexBuilder};
2026-08-05 11:21:25 -04:00
pub use schema::Schema;
pub enum DocType {
RdfProperty = 0,
RdfsClass = 1,
SkosConcept = 2,
Person = 3,
}
impl DocType {
pub fn from_named_node(node: NamedNodeRef) -> Option<Self> {
match node.as_str() {
"http://rdaregistry.info/Elements/c/C10004" => Some(DocType::Person),
_ => None,
}
}
}