GetGroupedSearches method FlowChart
2017-04-03 17:09:15 0 举报
GetGroupedSearches方法流程图展示了一个用于获取分组搜索结果的算法。首先,该方法接收一组搜索关键词作为输入。接着,它将这些关键词进行分类和分组,以便在后续步骤中进行更高效的搜索。然后,对于每个分组,该方法执行一个搜索操作,以获取与该组关键词相关的信息。这些搜索操作可能包括查询数据库、调用API或执行其他数据检索任务。接下来,该方法将每个分组的搜索结果进行汇总和整合,以便为用户提供一个统一的搜索结果集。最后,该方法返回这个分组后的搜索结果集,用户可以进一步浏览和筛选所需的信息。整个过程旨在提高搜索效率和用户体验,使用户能够更快地找到他们感兴趣的内容。
作者其他创作
大纲/内容
Y
N
LOOP 3 (i)
tokens: List<List<List<string>>>
wordRegex1.IsMatch(word)
searchTerm.Class == \"place\" && searchTerm.Type == \"postcode\"
search.HouseNumber = word
Add search into newWordSetSearches
search.SearchRank < MaxRank
Add searchTerm.WordId into currentSearch.FullNameAddresses
search.Postcode = word
Loop tokens
search = null
search.SearchRank += 2
Get searchTerm from validTokens[tmpWord]
LOOP 4
Add searchTerm.WordId into search.Names
!validTokens.ContainsKey(word) || word.IndexOf(\" \") != -1
i + 1 != wordset.Count && n + 1 != tokens.Count
string.IsNullOrEmpty(search.Postcode)
search.SearchRank++
Loop 6
Get searchTerm from validTokens[word]
n > 1
End loop
search != null && search.SearchRank < MaxRank
Create newGroupedSearches and searches objects
Recreate searches object
Set search.CountryCode by searchTerm.CountryCode
search.Names.Count == 0
Foreach newWordSetSearches and add items into newPhraseSearches
validTokens.ContainsKey(tmpWord)
Get top 50 items from newPhraseSearches
LOOP 5.2
searchTerm.Class == \"place\" && searchTerm.Type == \"house\"
string.IsNullOrEmpty(searchTermToken.CountryCode) && Math.Abs(searchTermToken.Lat - double.MinValue) < double.Epsilon && string.IsNullOrEmpty(searchTermToken.Class)
Get currentSearch from wordsetSearches
Is the last loop
Add searchTerm.WordId into search.Addresses
Loop token
Get top 50 items from newWordSetSearches as wordsetSearches
Create newPhraseSearches and newWordSetSearches objects
string.IsNullOrEmpty(search.Class)
string.IsNullOrEmpty(search.HouseNumber)
search.SearchRank += 5
LOOP 2 (index)
Clone searches as wordsetSearches
Clone currentSearch as search
Sort totalSearches by item.SearchRank and set sorted value into newGroupedSearches
Get word from wordset
Terminator
Create totalSearches object
LOOP 5.1
Loop validTokens[tmpWord]
Sort newWordSetSearches by item.SearchRank
Sort newPhraseSearches by SearchRank
validTokens contains word key
Loop validTokens[word]
string.IsNullOrEmpty(search.CountryCode)
Add searchTerm.WordId into search.AddressesNonSearch
!string.IsNullOrEmpty(searchTerm.CountryCode)
searchTerm.Class == \"shop\" || searchTerm.Class == \"amenity\" && searchTerm.Type == \"doctors\"
!string.IsNullOrEmpty(search.CountryCode)
wordFrequencyScores[searchTerm.WordId] < 50000
Start
Current loop count > 120 || End loop
!string.IsNullOrEmpty(searchTerm.Class) && !string.IsNullOrEmpty(searchTerm.Type) && searchTerm.Type != \"house\" && searchTerm.Type != \"postcode\"
Return newGroupedSearches object
wordRegex0.Matches(word).Count > 2
search.Names.Count > 0
search.SearchRank == 0 && searchTerm.Type != \"house\" && searchTerm.Type != \"postcode\"
wordFrequencyScores: span style=\"font-size: inherit;\
!currentSearch.FullNameAddresses.Contains(searchTerm.WordId)
Create tmpWord by \" word\"
Clear newWordSetSearches
Foreach newPhraseSearches and add items into totalSearches
!string.IsNullOrEmpty(searchTerm.WordId)
search.Operator = search.Names.Count > 0 ? \"name\" : \"near\"
Get wordset from token
Remove duplicated items from newPhraseSearches
LOOP 1 (n)
searchTerm.Operator.Length == 0
Get token from tokens
Loop wordset
Loop wordsetSearches
validTokens contains tmpWord key
Recreate newWordSetSearches
Clone currentSearch as search
Group totalSearches by item.SearchRank
Added newSearches item value into searches
0 条评论
下一页