From 1b2923f7c0c01094834475be174d8d5d57b0adc2 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 20 Jun 2023 10:14:25 +0200 Subject: [PATCH] Return the vector in the output of the search routes --- meilisearch/src/search.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meilisearch/src/search.rs b/meilisearch/src/search.rs index f1fb341a2..a85c0a437 100644 --- a/meilisearch/src/search.rs +++ b/meilisearch/src/search.rs @@ -233,6 +233,8 @@ pub struct SearchHit { pub struct SearchResult { pub hits: Vec, pub query: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub vector: Option>, pub processing_time_ms: u128, #[serde(flatten)] pub hits_info: HitsInfo, @@ -515,7 +517,8 @@ pub fn perform_search( let result = SearchResult { hits: documents, hits_info, - query: query.q.clone().unwrap_or_default(), + query: query.q.unwrap_or_default(), + vector: query.vector, processing_time_ms: before_search.elapsed().as_millis(), facet_distribution, facet_stats,