Skip to content

Commit

Permalink
Normalize all name tokens to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Jul 28, 2024
1 parent c569a1e commit 5903f7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Share/Postgres/Search/DefinitionSearch/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ searchTokenToText shouldAddWildcards = \case
makeSearchToken nameType (reversedNameText name) Nothing
& addWildCard
TypeMentionToken (Left name) occ ->
makeSearchToken typeMentionTypeByNameType (reversedNameText name) (Just occ)
-- We normalize the name to lowercase for case-insensitive search, but only for type name
-- mentions.
makeSearchToken typeMentionTypeByNameType (Text.toLower $ reversedNameText name) (Just occ)
& addWildCard
TypeMentionToken (Right sh) occ ->
makeSearchToken typeMentionTypeByHashType (into @Text @ShortHash sh) (Just occ)
Expand Down

0 comments on commit 5903f7f

Please sign in to comment.