about summary refs log tree commit diff
path: root/indexer/src/indexer_implementation.rs
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-04 16:13:42 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-04 17:23:33 +0100
commitda6b3752f5350d0fc789c047f66f221f77cd8a95 (patch)
treef7ded947ecb4bd67b7ee5da994f4ccc32389e2db /indexer/src/indexer_implementation.rs
parentIndexer: Make & implement the trait insert() taking a [word] for insert (diff)
downloadOSSE-da6b3752f5350d0fc789c047f66f221f77cd8a95.tar.gz
OSSE-da6b3752f5350d0fc789c047f66f221f77cd8a95.tar.bz2
OSSE-da6b3752f5350d0fc789c047f66f221f77cd8a95.zip
Indexer: Add and use language field in IndexedResource
Diffstat (limited to 'indexer/src/indexer_implementation.rs')
-rw-r--r--indexer/src/indexer_implementation.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/indexer/src/indexer_implementation.rs b/indexer/src/indexer_implementation.rs
index e3f0495..f24c2bd 100644
--- a/indexer/src/indexer_implementation.rs
+++ b/indexer/src/indexer_implementation.rs
@@ -30,8 +30,9 @@ impl crate::Indexer for IndexerImplementation {
         &mut self,
         words: &[String],
         url: &str,
-        title: Option<String>,
-        description: Option<String>,
+        title: &Option<String>,
+        description: &Option<String>,
+        language: &Option<String>,
         content: &str,
     ) -> Result<(), String> {
         for word in words {
@@ -39,8 +40,9 @@ impl crate::Indexer for IndexerImplementation {
                 url: url.to_string(),
                 priority: Self::calculate_word_priority(word, content, words),
                 word: Arc::new(word.to_string()),
-                title: title.as_ref().map(String::from),
-                description: description.as_ref().map(String::from),
+                title: title.clone(),
+                description: description.clone(),
+                language: language.clone(),
             };
 
             match self.database.get_mut(word) {