Let search for "CO2" match "CO₂" (with append small digit) too?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
pstein
Posts: 58
Joined: Thu Aug 07, 2014 6:18 pm

Let search for "CO2" match "CO₂" (with append small digit) too?

Post by pstein »

I have a lot of (.pdf and .png) files which contain "CO₂" as part of the file name. Mind the lower/small appended number!

When I search with the pattern "CO2" these files are not found.
I don't want to remember how to enter a low/small digit and search for it separately.

Whenever I enter "CO2" all files matching "CO₂" should be listed too.

Is there a way to include these file too?
Read: To let be 2 = ₂ ?

From my point of view its a kind of Diacritics. But I already enabled menu "Match Diacritics" and it doesn't help.
So this relationship should be added to the set of Diacritics or a new menu entry should be added.

Can you add it?

Thank you
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by void »

Everything will treat 2 and ₂ as the same.

Please make sure Match Diacritics is disabled under the Search menu.
Please make sure Regex is disabled under the Search menu.

Does the issue persist?
pstein
Posts: 58
Joined: Thu Aug 07, 2014 6:18 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by pstein »

Ok, after disabling Diacritics it works.

But: I want to have Diacritics search AND 2 = ₂ search at the same time.

How can I achieve this?
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by void »

Enabling Match Diacritics will cause Everything to treat A and Á as different characters.
Disabling Match Diacritics will cause Everything to treat A and Á as the same characters.

What characters are you searching for where you want Match Diacritics enabled?



Leave Match Diacritics enabled under the Search menu and prefix CO2 with nodiacritics:

nodiacritics:co2
pstein
Posts: 58
Joined: Thu Aug 07, 2014 6:18 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by pstein »

So when I want to have Diacritics enabled all the time
AND
Treat CO₂ as CO2 all the time

users have to enable Diacritics AND enter always manually

CO2 nodiacritics:co2

That very uncomfortable and user unfriendly.

Is there a user customizable entry field in Everything options where user can enter Everything flags/options which should be always automatically applied for every search?

This way users could enter a flag like "nodiacritics:co2" over there and don't care about it in future any more.
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by void »

Please consider the following filter:
  • In Everything, from the Search menu, click Add to filters....
  • Change the Name to: CO₂
  • Uncheck Match Diacritics.
  • Change the Search to: co2
  • Change the Macro to: co2
  • Click OK.
co2: is now replaced with nodiacritics:co2



Why do you have Match Diacritics enabled?
pstein
Posts: 58
Joined: Thu Aug 07, 2014 6:18 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by pstein »

Thank you for your (partial only) solution.

I followed you suggestion and setup a filter.
And yes it worked at first successfully.

But then, after some days, it didn't work any more.

When I go to menu

Search--->organize filters.....

I can see the previously created filter.
Everything is still as you suggested.

However when I enter now "CO2" (without quotes) then none of the CO₂ matches are shown.
Only if I enter manually "nodiacritics:co2" all the CO₂ files and folders are listed.
So they are all existing.

So it seems to be a bug.
Everything seems not to recognized the new filter any more.
Maybe its a cache or indexing problem?

Whats wrong?
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by void »

Please make sure you include a colon (:) after co2:

co2:
pstein
Posts: 58
Joined: Thu Aug 07, 2014 6:18 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by pstein »

Ok, this works.

However having manually to remember and add a colon ":" is tedious and user unfriendly.

is there any chance to add a kind of auto-completion to Everything?

Whenever a search term is entered for which a filter exists then Everything should automatically append a colon.
Or prepend it to "nodiacritics" flag?
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by void »

What version of Everything are you using?

Why do you have Match Diacritics enabled?
pstein
Posts: 58
Joined: Thu Aug 07, 2014 6:18 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by pstein »

I am using Everything v1.4.1.1024 on 64bit Windows

I need diacritics because I am occasionally searching files with foreign letters inside filenames.

If you consider Diacritics menu to be useless (as you seem to assume) then why is it built-in in Everything?
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by void »

Sorry, I don't have a good solution for Everything 1.4.


I need diacritics because I am occasionally searching files with foreign letters inside filenames.
That is exactly why the Match Diacritics option exists.
I just wanted to make sure Match Diacritics being enabled wasn't a mistake.



Consider renaming filenames containing CO₂ to CO2:
  • Search for:
    diacritics:CO₂
  • Select all results (Ctrl + A)
  • Press F2.
  • Check Regex
  • Change the old format to: \bCO₂\b
  • Change the new format to: CO2
  • Review the newly generated filenames.
  • Click OK.


Everything 1.5 will have the option to rewrite your searches:
  • In Everything 1.5, from the Search menu, click Add to filters....
  • Change the Name to: CO2 => CO₂
  • Change the Search to: #[regexreplace:$param:,"(?i)\bCO2\b","<CO2|CO₂>"#]:
  • Click OK.
When this filter is active, the word co2 is replaced with: <CO2|CO₂>
(I know this isn't the best solution, but it's all I have at the moment)

I have on my TODO list to add support for synonym lists.
pstein
Posts: 58
Joined: Thu Aug 07, 2014 6:18 pm

Re: Let search for "CO2" match "CO₂" (with append small digit) too?

Post by pstein »

void wrote: Fri Nov 03, 2023 10:13 am Everything 1.5 will have the option to rewrite your searches:
  • In Everything 1.5, from the Search menu, click Add to filters....
  • Change the Name to: CO2 => CO₂
  • Change the Search to: #[regexreplace:$param:,"(?i)\bCO2\b","<CO2|CO₂>"#]:
  • Click OK.
When this filter is active, the word co2 is replaced with: <CO2|CO₂>
Sounds good.
Looking forward to v1.5 release
Post Reply