fix: preserve search input and add choseong lookup

This commit is contained in:
2026-07-21 11:23:42 +09:00
parent 5ccf8b8ffd
commit b6208c0971
11 changed files with 801 additions and 64 deletions

View File

@@ -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(