Improve search results with underscore and dash/hyphen package names (#649)
* Create underscore & dash separated variants for wildcard search * frontend: simplify list uniqueness --------- Co-authored-by: Naïm Favier <n@monade.li>
This commit is contained in:
parent
eb2910bffa
commit
1ecb696edd
|
@ -1240,6 +1240,11 @@ searchFields query mainField fields =
|
||||||
)
|
)
|
||||||
|> List.concat
|
|> List.concat
|
||||||
|
|
||||||
|
queryWordsWildCard =
|
||||||
|
(String.replace "_" "-" query :: String.replace "-" "_" query :: queryWords)
|
||||||
|
|> Set.fromList
|
||||||
|
|> Set.toList
|
||||||
|
|
||||||
queryWords =
|
queryWords =
|
||||||
String.words (String.toLower query)
|
String.words (String.toLower query)
|
||||||
in
|
in
|
||||||
|
@ -1271,7 +1276,7 @@ searchFields query mainField fields =
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
queryWords
|
queryWordsWildCard
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue