Database schema optimization - part 6
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) = ¶m.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
|
||||
|
||||
Reference in New Issue
Block a user