Skip to content

Commit

Permalink
convert headword to lowercase when sorting in mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Nov 29, 2024
1 parent 3223a25 commit e32d297
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/LfClassicData/LfClassicMiniLcmApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private async IAsyncEnumerable<Entry> 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
Expand All @@ -216,7 +216,7 @@ private async IAsyncEnumerable<Entry> 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", "" }
})
}
Expand Down

0 comments on commit e32d297

Please sign in to comment.