mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-27 15:56:43 +00:00
feat(core): hubs, tag pages and types, with ffi, history and import support
Hubs and templates are page kinds; tags are pages of kind tag linked by a TAGGED edge; types are plain names on the page. Schema v5. Snapshots carry synapse-kind/tags/types. Also adapts search, import and server tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
91a8276966
commit
b800248d67
35 files changed
+7983
-141
No files matched your search
@@ -331,3 +331,21 @@ fn store_inside_graph_transaction_and_rename_delete() {
|
||||
assert!(s.search(&g, "ferris", &f, 10).unwrap().is_empty());
|
||||
assert_eq!(s.vector_counts(&g, "test/hash").unwrap(), (1, 0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hub_titles_and_descriptions_are_indexed() {
|
||||
let (_d, g) = setup();
|
||||
let h = g.create_hub("Anime", "Japanese animation series").unwrap();
|
||||
add(&g, "Other", "nothing related");
|
||||
let mut s = Search::open(&g).unwrap();
|
||||
s.sync(&g).unwrap();
|
||||
let f = Filter::default();
|
||||
let hits = s.search(&g, "animation", &f, 5).unwrap();
|
||||
assert_eq!(hits[0].kind, HitKind::Page);
|
||||
assert_eq!(hits[0].page_id, h.id);
|
||||
assert_eq!(s.search(&g, "anime", &f, 5).unwrap()[0].page_id, h.id);
|
||||
g.set_hub_description(h.id, "Cartoons from Japan").unwrap();
|
||||
s.sync(&g).unwrap();
|
||||
assert!(s.search(&g, "animation", &f, 5).unwrap().is_empty());
|
||||
assert_eq!(s.search(&g, "cartoons", &f, 5).unwrap()[0].page_id, h.id);
|
||||
}
|
||||
Reference in new issue
Block a user