Commit 6d8a6f1c authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/441-dev-ngrams-table-sorting-fix' into dev-merge

parents 2733aad4 eade954a
......@@ -604,10 +604,13 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where
where
colNames = TT.ColumnName <$> ["Show", "Select", "Map", "Stop", "Terms", "Score"] -- see convOrderBy
ngramsTableOrderWith :: Maybe (TT.OrderByDirection TT.ColumnName)
-> Seq.Seq NgramsElement
-> Seq.Seq NgramsElement
ngramsTableOrderWith orderBy =
case convOrderBy <$> orderBy of
Just ScoreAsc -> sortWith \x -> x ^. _NgramsElement <<< _occurrences
Just ScoreDesc -> sortWith \x -> Down $ x ^. _NgramsElement <<< _occurrences
Just ScoreAsc -> sortWith \x -> x ^. _NgramsElement <<< _occurrences <<< to Set.size
Just ScoreDesc -> sortWith \x -> Down $ x ^. _NgramsElement <<< _occurrences <<< to Set.size
Just TermAsc -> sortWith \x -> x ^. _NgramsElement <<< _ngrams
Just TermDesc -> sortWith \x -> Down $ x ^. _NgramsElement <<< _ngrams
_ -> identity -- the server ordering is enough here
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment