fix: preserve search input and add choseong lookup
This commit is contained in:
@@ -63,7 +63,14 @@ public sealed class LegacyParityStockSearchService : ILegacyStockLookup
|
||||
}
|
||||
|
||||
var masterCatalog = await GetMasterCatalogAsync(cancellationToken).ConfigureAwait(false);
|
||||
var searchTerm = query.ToUpper(CultureInfo.CurrentCulture);
|
||||
var isInitialSearch = HangulSearchMatcher.IsInitialConsonantQuery(query);
|
||||
// Keep the candidate set identical to the legacy provider searches.
|
||||
// In particular, NXT search joins the online tables while the complete
|
||||
// identity master intentionally does not. The master must therefore
|
||||
// never be used as the visible result set for an initial-only query.
|
||||
var searchTerm = isInitialSearch
|
||||
? string.Empty
|
||||
: query.ToUpper(CultureInfo.CurrentCulture);
|
||||
var names = new List<string>();
|
||||
|
||||
foreach (var profile in Profiles)
|
||||
@@ -77,7 +84,10 @@ public sealed class LegacyParityStockSearchService : ILegacyStockLookup
|
||||
AppendNames(table, profile.SearchTableName, names);
|
||||
}
|
||||
|
||||
return new LegacyStockSearchData(query, names, masterCatalog);
|
||||
var displayNames = isInitialSearch
|
||||
? names.Where(name => HangulSearchMatcher.IsMatch(name, query))
|
||||
: names;
|
||||
return new LegacyStockSearchData(query, displayNames, masterCatalog);
|
||||
}
|
||||
|
||||
private async Task<IReadOnlyList<LegacyStockIdentity>> GetMasterCatalogAsync(
|
||||
|
||||
Reference in New Issue
Block a user