This commit is contained in:
2018-09-28 18:58:22 +00:00
parent 1e3ccfcc14
commit fcb61e7ad5
4 changed files with 53 additions and 11 deletions

View File

@@ -568,6 +568,7 @@ namespace AyaNova.Biz
//Get stopwords and CJKIndex flag value
LocaleWordBreakingData LocaleSearchData = GetLocaleSearchData(localeId);
int MAXWORDLENGTH = 255;
int MINWORDLENGTH = 2;//A word isn't a word unless it's got at least two characters in it
StringBuilder sbResults = new StringBuilder();
//List to temporarily hold parsed words
//used to easily ensure unique words only
@@ -824,10 +825,15 @@ namespace AyaNova.Biz
//from the word list
foreach (string s in tempParsedWords)
{
//Add only non stopwords
if (!LocaleSearchData.StopWords.Contains(s))
//Filter out short words if we are breaking for indexing
//but keep them if they are part of a wildcard search phrase
if (s.Length > MINWORDLENGTH || (KeepWildCards && s.Contains('%')))
{
ReturnList.Add(s);
//Add only non stopwords
if (!LocaleSearchData.StopWords.Contains(s))
{
ReturnList.Add(s);
}
}
}