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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user