feat(search): index + return recording_date on search hits (#61)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 13:41:17 +02:00
parent d37ac821f0
commit 1cdfa21259
4 changed files with 10 additions and 0 deletions
+3
View File
@@ -19,6 +19,7 @@ fn doc(id: &str, object_name: &str, fields_text: &[&str]) -> SearchDocument {
brief_description: None,
current_owner: None,
recorder: None,
recording_date: None,
visibility: "draft".to_string(),
fields_text: fields_text.iter().map(|s| s.to_string()).collect(),
}
@@ -66,6 +67,7 @@ async fn search_objects_returns_hits_with_highlight_filter_and_paging() {
&["cast bronze with green patina"],
);
bronze_a.visibility = "public".to_string();
bronze_a.recording_date = Some("1962-04-03".to_string());
let mut bronze_b = doc(&b.to_string(), "Ceremonial bowl", &["bronze alloy rim"]);
bronze_b.visibility = "public".to_string();
let mut bronze_c = doc(&c.to_string(), "Door fitting", &["bronze hinge"]);
@@ -87,6 +89,7 @@ async fn search_objects_returns_hits_with_highlight_filter_and_paging() {
"snippet must mark the match"
);
assert!(snippet.contains(search::HL_POST));
assert_eq!(hit.recording_date.as_deref(), Some("1962-04-03"));
let public = client
.search_objects("bronze", Some("public"), 0, 20)