From e32d297ae77eb4dc4f82c7de747dff62b657cfc1 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Fri, 29 Nov 2024 14:19:28 +0700 Subject: [PATCH] convert headword to lowercase when sorting in mongo --- backend/LfClassicData/LfClassicMiniLcmApi.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/LfClassicData/LfClassicMiniLcmApi.cs b/backend/LfClassicData/LfClassicMiniLcmApi.cs index cc7945e01..c8c25c8fa 100644 --- a/backend/LfClassicData/LfClassicMiniLcmApi.cs +++ b/backend/LfClassicData/LfClassicMiniLcmApi.cs @@ -206,7 +206,7 @@ private async IAsyncEnumerable Query(QueryOptions? options = null, string new BsonDocument("$ne", new BsonArray { new BsonDocument("$trim", new BsonDocument("input", $"$citationForm.{sortWs}.value")), "" }), }) }, - { "then", $"$citationForm.{sortWs}.value" }, + { "then", new BsonDocument("$toLower", $"$citationForm.{sortWs}.value") }, { "else", new BsonDocument("$cond", new BsonDocument { { "if", new BsonDocument("$and", new BsonArray @@ -216,7 +216,7 @@ private async IAsyncEnumerable Query(QueryOptions? options = null, string new BsonDocument("$ne", new BsonArray { new BsonDocument("$trim", new BsonDocument("input", $"$lexeme.{sortWs}.value")), "" }), }) }, - { "then", $"$lexeme.{sortWs}.value" }, + { "then", new BsonDocument("$toLower", $"$lexeme.{sortWs}.value") }, { "else", "" } }) }