Description
Checklist
- I am using an up-to-date version.
- I have read the documentation.
- I have searched existing issues.
TagStudio Version
Alpha 9.3.1
Operating System & Version
Windows 11
Description
I was experimenting with tagging some of my saved digital art when I noticed some very strange and inconsistent interactions with certain parent tags and the search function. I'll use specific examples to make sure I don't miss any details.
First, I created a tag for the character Princess Zelda. I named it %princess_zelda and gave it the shorthand zelda and the alias princess zelda. Then I gave it the parent tag $tears_of_the_kingdom, which has the shorthand totk and the alias tears of the kingdom. Then I gave the $tears_of_the_kingdom tag the parent tag of $the_legend_of_zelda, which has the shorthand tloz and the alias the legend of zelda. Then I tagged an image with only the %princess_zelda tag.
When I search princess zelda or zelda, the image shows up. But when I search %princess_zelda, it doesn't, meaning only the shorthand and the aliases of the tag are showing up in the search, and not the tag itself. When I search totk, the image shows up, but when I search tears of the kingdom or $tears_of_the_kingdom, it doesn't, meaning only the shorthand of the parent tag is showing up in the search. When I search tloz or the legend of zelda, the image shows up, but when I search $the_legend_of_zelda it doesn't, meaning only the shorthand and the aliases of the grandparent tag are showing up in the search.
However, this behavior differs slightly from the behavior of a different image that I tagged with a similar structure. The image is tagged only with %gemma, which has the shorthand gemma. %gemma has the parent tag $monster_hunter_wilds, which has the shorthand mhwilds and the alias monster_hunter_wilds. $monster_hunter_wilds has the parent tag $monster_hunter, which has the shorthand monster hunter.
When I search gemma the image shows up, but it also shows up when I search %gemma, which is different from the first example, where searching the exact tag name did not return the image. When I search mhwilds the image shows up, but not when I search monster hunter wilds or $monster_hunter_wilds, which is identical behavior to the first example, where only the shorthand returned the image. But when I search monster hunter or $monster_hunter, the image doesn't show up, which is different from the first example where searching the shorthand and aliases of the grandparent tag did return the image.
For good measure, I tagged a third image to see if I could figure out any sort of pattern. The third image is tagged only with %marina, which has the shorthand marina. %marina has the parent tag $splatoon_2, which has the shorthand splatoon_2. $splatoon_2 has the parent tag $splatoon, which has the shorthand splatoon.
When I search %marina or marina, the image shows up, which is the same as the second example. When I search splatoon_2 the image shows up, but not when I search $splatoon_2, which is the same as both examples. When I search splatoon or $splatoon, the image shows up, which is different from both examples because searching the exact name of the grandparent tag did not return the image in the other examples.
So in summary:
FIRST EXAMPLE
Tags (%princess_zelda, zelda, princess zelda): shorthand and alias return image. (2/3)
Parent Tags ($tears_of_the_kingdom, totk, tears of the kingdom): only shorthand returns image. (1/3)
Grandparent Tags ($the_legend_of_zelda, tloz, the legend of zelda): shorthand and alias return image. (2/3)
SECOND EXAMPLE
Tags (%gemma, gemma): exact name and shorthand return image. (2/2)
Parent Tags ($monster_hunter_wilds, mhwilds, monster hunter wilds): only shorthand returns image. (1/3)
Grandparent Tags ($monster_hunter, monster hunter): nothing returns image. (0/2)
THIRD EXAMPLE
Tags (%marina, marina): exact name and shorthand return image. (2/2)
Parent Tags ($splatoon_2, splatoon 2): only shorthand returns image. (1/2)
Grandparent Tags ($splatoon, splatoon): exact name and shorthand return image. (2/2)
Obviously this is a very small dataset, so take my analysis with a grain of salt, but here are the patterns I was able to identify:
-Tags with underscores never return the image.
-The only instances where searching the exact name of the tag returned the image was with tags that are one word and have no underscores.
-Only the shorthand will return the image when searching parent tags.
The main thing that baffles me is how inconsistent the aliases with spaces are. I just have no idea why searching the legend of zelda works, but tears of the kingdom and monster hunter wilds and monster hunter don't.
I'm not very familiar with coding, so I don't know what might be causing this, but hopefully this information is helpful for whenever the search function gets revamped.
Expected Behavior
As for the expected behavior, I would expect an image to show up in the search if you search any of its tags, parent tags, or grandparent tags, etc, or if you search any of the shorthands/aliases of those tags, parent tags, or grandparent tags.
Steps to Reproduce
For the steps to reproduce, just create a few tags with parent and grandparent tags and give them shorthands and/or aliases. Maybe experiment with including symbols, underscores, and spaces. Then just tag some images with only the base tags and see whether they show up when you search certain parent tags and aliases.
Logs
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status