feat: version string formatting yy.mm.dd.hhmmss, app icon, and test fixes
This commit is contained in:
1 parent
1752753fcc
commit
81aac7245b
17 files changed
+170
-412
No files matched your search
+13
-3
@@ -83,7 +83,7 @@ impl MemoryIndex {
|
||||
&self,
|
||||
query: &str,
|
||||
namespace: Option<&str>,
|
||||
) -> tantivy::Result<Vec<(String, String)>> {
|
||||
) -> tantivy::Result<Vec<(String, String, String, String, f32)>> {
|
||||
let searcher = self.reader.searcher();
|
||||
let query_parser = tantivy::query::QueryParser::for_index(
|
||||
&self.index,
|
||||
@@ -96,7 +96,7 @@ impl MemoryIndex {
|
||||
&tantivy::collector::TopDocs::with_limit(50).order_by_score(),
|
||||
)?;
|
||||
let mut results = Vec::new();
|
||||
for (_score, doc_address) in top_docs {
|
||||
for (score, doc_address) in top_docs {
|
||||
let retrieved_doc = searcher.doc::<tantivy::TantivyDocument>(doc_address)?;
|
||||
let id = retrieved_doc
|
||||
.get_first(self.id_field)
|
||||
@@ -108,6 +108,16 @@ impl MemoryIndex {
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("")
|
||||
.to_string();
|
||||
let title = retrieved_doc
|
||||
.get_first(self.title_field)
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("")
|
||||
.to_string();
|
||||
let body = retrieved_doc
|
||||
.get_first(self.body_field)
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("")
|
||||
.to_string();
|
||||
let doc_ns = retrieved_doc
|
||||
.get_first(self.namespace_field)
|
||||
.and_then(|v| v.as_str())
|
||||
@@ -118,7 +128,7 @@ impl MemoryIndex {
|
||||
{
|
||||
continue;
|
||||
}
|
||||
results.push((id, doc_type));
|
||||
results.push((id, doc_type, title, body, score));
|
||||
}
|
||||
Ok(results)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user