Search glitch with a dot

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Search glitch with a dot

Post by zer0 »

I believe that there is a glitch when it comes to search with presence/absence of a single dot/period/full stop making all the difference. To reproduce:

1. Create a structure of folders in a desired location where the first couple of words are the same. For example, like so:

Code: Select all

Star.Trek.First.Contact
Star.Trek.Generations
Star.Trek.III.The.Search.For.Spock
Star.Trek.IV.The.Voyage.Home
Star.Trek.Nemesis
Star.Trek.The.Motion.Picture
Star.Trek.The.Wrath.Of.Khan
Star.Trek.V.The.Final.Frontier
Star.Trek.VI.The.Undiscovered.Country
Star.Trek.Into.The.Darkness
2. While in that same location, after creating those folders, do a normal search for "star.trek". Outcome: the search shows all those folders.
3. Now do a search for "star.trek." -- notice the dot/period at the end of the string is added at the end. Outcome: the folders you've just created are miraculously not found.

This seems like a straight forward bug to me: the dot/period is present so, whether it is included or not, should not matter. I have searched the forum but found no threads on a similar subject -- maybe that search isn't working properly either :lol: -- which seems a bit surprising. Anyway, hopefully when Don comes back from self-imposed exile / holiday / etc, it can be cleared up.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Search glitch with a dot

Post by TheQwerty »

I think it might be a lack of smartness in the young no-extension handling - introduced in v15.00.0520, late April.
Possibly also a conflict with the habits formed by us thanks to XY's auto-wildcarding.


Ending the pattern with a period seems to put find into no-extension mode, where it ignores folders and only finds files which do not have an extension (and match the content before the dot).

In this particular case though the no-extension mode looks rather dumb since it would be impossible for a file named "star.trek" to not have an extension. :whistle:

Surrounding it with wildcards obviously works more like you'd expect ("*star.trek.*") as does making the final period a character class ("star.trek[.]").


I say if the query contains 2+ dots then the no-extension mode should not be enabled.
However, the question then becomes should "star." be a literal or no-extension search? For this I have no answer. :?


EDIT: Similar behavior is likely also seen in Visual Filters, Custom File Icons, and Portable File Associations, since the no-extension syntax was introduced for all of these at the same time.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Search glitch with a dot

Post by zer0 »

Thanks for chiming in TheQwerty. I am not a fan of this no-extension behaviour. I appreciate that I can modify the query to produce the expected results, but that should not be necessary when one tries to do a basic search for files/folders that contain a given name. This seems like one of those occasions where XY is trying to be too clever for its own good and is treating normal searches as special. If anything, if a search needs to go into this ninja "no extension" mode, the search string should be pre-/suffixed in a particular manner and. As it stands, ending a search with a dot -- which is fully legitimate -- messes things up quite a bit.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Search glitch with a dot

Post by admin »

Thanks, good find and good analysis. Fix comes:

Code: Select all

    ! Find Files Without Extension: The test for no-extension patterns was not 
      alright. A pattern "Star.Trek." was wrongly seen as a no-extension pattern and 
      hence would never match anything since it also included a dot in the 
      middle. Fixed. Now, the ONLY dot in a pattern has to be the last character 
      to make it a no-extension pattern.
      The same fix has been applied to Visual Filters, Custom File Icons, and 
      Portable File Associations.

Post Reply