This commit is contained in:
@@ -394,18 +394,23 @@ namespace AyaNova.Biz
|
||||
|
||||
//ITERATE THROUGH THE KEYWORDS THAT DO *NOT* HAVE MATCHES IN THE SEARCHDICTIONARY AND ADD THEM TO THE SEARCH DICTIONARY, COLLECTING THEIR ID'S
|
||||
bool NewWordsAdded = false;
|
||||
var NewSearchDictionaryWordsList = new List<SearchDictionary>();
|
||||
foreach (string KeyWord in KeyWordList)
|
||||
{
|
||||
if (!ExistingKeywordMatches.ContainsValue(KeyWord))
|
||||
{
|
||||
ct.SearchDictionary.Add(new SearchDictionary() { Word = KeyWord });
|
||||
NewSearchDictionaryWordsList.Add(new SearchDictionary() { Word = KeyWord });
|
||||
NewWordsAdded = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Save the context in order to get the id's of the new words added
|
||||
if (NewWordsAdded)
|
||||
{
|
||||
//adding in a range sped this up noticeably
|
||||
ct.SearchDictionary.AddRange(NewSearchDictionaryWordsList);
|
||||
ct.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
//-----
|
||||
@@ -432,14 +437,18 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
//CREATE THE SEARCHKEY RECORDS FOR ALL THE KEYWORDS
|
||||
var NewSearchKeyList = new List<SearchKey>();
|
||||
foreach (MatchingDictionaryEntry E in MatchingKeywordIdList)
|
||||
{
|
||||
ct.SearchKey.Add(new SearchKey() { WordId = E.DictionaryId, InName = E.InName, ObjectId = objectID, ObjectType = objectType });
|
||||
NewSearchKeyList.Add(new SearchKey() { WordId = E.DictionaryId, InName = E.InName, ObjectId = objectID, ObjectType = objectType });
|
||||
//ct.SearchKey.Add(new SearchKey() { WordId = E.DictionaryId, InName = E.InName, ObjectId = objectID, ObjectType = objectType });
|
||||
}
|
||||
|
||||
ct.SearchKey.AddRange(NewSearchKeyList);
|
||||
ct.SaveChanges();
|
||||
|
||||
//---------------------------------
|
||||
|
||||
ct.SaveChanges();
|
||||
|
||||
|
||||
}//eoc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user