Database schema optimization - part 6

This commit is contained in:
mdecimus
2025-11-05 16:42:11 +01:00
parent a7815ffd6b
commit f33b5f5d66
24 changed files with 679 additions and 2113 deletions

View File

@@ -358,7 +358,7 @@ impl ArchivedCalendarEvent {
.filter(|e| e.component_type.is_scheduling_object())
{
for entry in component.entries.iter() {
let (is_lang, field) = SearchField::Calendar(match entry.name {
let (is_lang, field) = match entry.name {
ArchivedICalendarProperty::Summary => (true, CalendarSearchField::Title),
ArchivedICalendarProperty::Description => {
(true, CalendarSearchField::Description)
@@ -368,7 +368,8 @@ impl ArchivedCalendarEvent {
ArchivedICalendarProperty::Attendee => (false, CalendarSearchField::Attendee),
ArchivedICalendarProperty::Uid => (false, CalendarSearchField::Uid),
_ => continue,
});
};
let field = SearchField::Calendar(field);
if index_fields.is_empty() || index_fields.contains(&field) {
for value in entry

View File

@@ -265,7 +265,7 @@ impl ArchivedContactCard {
let mut detector = LanguageDetector::new();
for entry in self.card.entries.iter() {
let (is_text, field) = SearchField::Contact(match entry.name {
let (is_text, field) = match entry.name {
ArchivedVCardProperty::N => (false, ContactSearchField::Name),
ArchivedVCardProperty::Nickname => (false, ContactSearchField::Nickname),
ArchivedVCardProperty::Org => (false, ContactSearchField::Organization),
@@ -280,7 +280,8 @@ impl ArchivedContactCard {
ArchivedVCardProperty::Uid => (false, ContactSearchField::Uid),
ArchivedVCardProperty::Member => (false, ContactSearchField::Member),
_ => continue,
});
};
let field = SearchField::Contact(field);
if index_fields.is_empty() || index_fields.contains(&field) {
for value in entry.values.iter() {
@@ -310,7 +311,7 @@ impl ArchivedContactCard {
for param in entry.params.iter() {
if let ArchivedVCardParameterValue::Text(value) = &param.value {
let lang = if is_text {
detector.detect(v.as_str(), MIN_LANGUAGE_SCORE);
detector.detect(value.as_str(), MIN_LANGUAGE_SCORE);
Language::Unknown
} else {
Language::None