@JasonWalker @Aram
Getting the 5 latest makes sense to me to answer a what was recently touched type of question.
I too am puzzled at the “why” behind needing a reverse sort in relevance. Looking forward to that response from @KeepLearning.
To the exact query above, it’s just applying the same techniques for filtering for top 5, reversing, trimming and reversing a second time, then filtering and trimming off the sort at the end.
Much easier to do in JavaScript at the reporting layer instead of trying to get the client to do it locally with relevance.
q: files whose (name of it as lowercase ends with ".txt") of folder "c:\test"
A: "Abc_20210115612456.txt" "" "" "" ""
A: "Abc_20210120342156.txt" "" "" "" ""
A: "Abc_20210121225468.txt" "" "" "" ""
A: "Abc_20210123165009.txt" "" "" "" ""
A: "Abc_20210124184449.txt" "" "" "" ""
A: "Abc_20210125205107.txt" "" "" "" ""
A: "Abc_20210126224733.txt" "" "" "" ""
A: "DLV cscript command.txt" "" "" "" ""
A: "dlv.txt" "" "" "" ""
A: "Fake.txt" "" "" "" ""
A: "one more file 5.txt" "" "" "" ""
A: "test3_20210125205107.txt" "" "" "" ""
A: "test4_20210126224733.txt" "" "" "" ""
q: tuple string items 1 of items 1 of (item 0 of it, elements of item 1 of it) whose (item 0 of it = tuple string item 0 of item 1 of it) of (( (concatenation of characters (lengths of (following texts of (positions of it))) of it) of (tuple string items (0;1;2;3;4) of it) of concatenation of characters (lengths of (following texts of (positions of it))) of (it as string) of concatenation " ," of (following text of first "_" of preceding text of last "." of name of it|"") of files whose (name of it as lowercase ends with ".txt" and name of it as lowercase starts with "abc_") of folder "c:\test"),(set of (it as string) of (following text of first "_" of preceding text of last "." of name of it|"", name of it) of files whose (name of it as lowercase ends with ".txt" and name of it as lowercase starts with "abc_") of folder "c:\test"))
A: Abc_20210126224733.txt
A: Abc_20210125205107.txt
A: Abc_20210124184449.txt
A: Abc_20210123165009.txt
A: Abc_20210121225468.txt