Is it possible to sort the results by the number of search terms that match the filename?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
tingfzy
Posts: 3
Joined: Tue Dec 10, 2024 4:33 am

Is it possible to sort the results by the number of search terms that match the filename?

Post by tingfzy »

For example, when I search for "BBB|AAA|CCC .txt", there are three files:

AAA BBB B.txt
AAA BBB CCC.txt
AAA CAA.txt

However, I would like the results to be sorted as follows:

AAA BBB CCC.txt
AAA BBB B.txt
AAA CAA.txt
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is it possible to sort the results by the number of search terms that match the filename?

Post by void »

Not really possible with Everything.
I have on my TODO list to sort by relevance.

For now, in Everything 1.5:

Code: Select all

<<BBB AAA CCC a:=3> | <BBB AAA a:=2> | <BBB CCC a:=2> | <AAA CCC a:=2> | <AAA a:=1> | <BBB a:=1> | <CCC a:=1>> sort:a-descending
tingfzy
Posts: 3
Joined: Tue Dec 10, 2024 4:33 am

Re: Is it possible to sort the results by the number of search terms that match the filename?

Post by tingfzy »

Thanks for replying and I look forward to that feature being added.
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Is it possible to sort the results by the number of search terms that match the filename?

Post by NotNull »

Still not really possible, but in another way (requires Everything 1.5):

Code: Select all

AAA | BBB | CCC  addcol:A  A:=REGEX_COUNT($name:,"(?i)AAA|BBB|CCC")  sort:A-descending
When not interested in the exact number of matches, leave out "addcol:A"

regex syntax


@void: did not expect regexcount() to be case sensitive. Should it be?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is it possible to sort the results by the number of search terms that match the filename?

Post by void »

Yes, it should be, use the following for a case-insensitive search:

addcol:A A:=REGEX_COUNT($name:,"(?i)AAA|BBB|CCC") sort:A-descending
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Is it possible to sort the results by the number of search terms that match the filename?

Post by NotNull »

OK, thanks.
(edited original query to reflect this)
Post Reply