Jump to content

Anyway to Tag Search on Substring of a Tag?


Recommended Posts

Is there a way to search tags based on a substring contained within the tab?   If I have a tag with the value "what - home projects" I can search for Notes that use this tag with either of:

tag:"what - home projects"

tag:"what*"

So I can enter the full tag string or I can enter a leading substring with a trailing wildcard character.   But what if I want to find all tags that contain the substring "home"?  Is there a syntax for tag search that will find that tag?

Link to comment
  • Level 5*
4 hours ago, persistentone said:

But what if I want to find all tags that contain the substring "home"?  Is there a syntax for tag search that will find that tag?

No, you can only use a trailing wildcard in searches

As a work-around, you could break your tag into separate components
tag:Projects   tag:Home

Link to comment
  • Level 5*
7 hours ago, persistentone said:

Is there a way to search tags based on a substring contained within the tab?   If I have a tag with the value "what - home projects" I can search for Notes that use this tag with either of:

tag:"what - home projects"

tag:"what*"

So I can enter the full tag string or I can enter a leading substring with a trailing wildcard character.   But what if I want to find all tags that contain the substring "home"?  Is there a syntax for tag search that will find that tag?

Not in search.  But if you have Match tags by prefix in the tag picker checked (Tools - Options - Navigation in Windows), you can go to tag picker in all notes context type home and get a list of tags that start with home or where home follows a space or period within the tag.  If you have a lot of such tags they may not all appear in the list.  FWIW.

Link to comment
16 hours ago, csihilling said:

Not in search.  But if you have Match tags by prefix in the tag picker checked (Tools - Options - Navigation in Windows), you can go to tag picker in all notes context type home and get a list of tags that start with home or where home follows a space or period within the tag.  If you have a lot of such tags they may not all appear in the list.  FWIW.

 

If I am reading the documentation correctly, "Match tags by prefix" turns off substring matching.   So that not only doesn't give me a way to search inside the tag, but it actually makes it worse in that the useful matching on substring prefixes stops working.

Link to comment
  • Level 5*
12 minutes ago, persistentone said:

If I am reading the documentation correctly, "Match tags by prefix" turns off substring matching.   So that not only doesn't give me a way to search inside the tag, but it actually makes it worse in that the useful matching on substring prefixes stops working.

Actually prefix match works whether the option is checked or not.   Non-prefix works when the option is not checked, eg xxhome would be returned for home..

I read your request as having structured tags where home would be at the beginning of the tag or after a delimiter in the tag.   If you set this option that will limit the found tags to that type thereby no false positives.  If home exists anywhere in the tag then, yes, don't select the option.  

Did you try tag picker, Shift - Alt - T, to see for yourself.  Easy enough test.

ScreenClip.png.edb7289c293214ff5eaf35a00fa09123.png

Link to comment
7 minutes ago, csihilling said:

Actually prefix match works whether the option is checked or not.   Non-prefix works when the option is not checked, eg xxhome would be returned for home..

I read your request as having structured tags where home would be at the beginning of the tag or after a delimiter in the tag.   If you set this option that will limit the found tags to that type thereby no false positives.  If home exists anywhere in the tag then, yes, don't select the option.  

Did you try tag picker, Shift - Alt - T, to see for yourself.  Easy enough test.

ScreenClip.png.edb7289c293214ff5eaf35a00fa09123.png

 

The "Tag Picker" is the line where it says "Add tag" inside each Note?    With or without the "Match tags by prefix" option selected, when I type in "home" it fails to find any of several tags where home is a substring in the middle of the tag.   The word home has a space on either side of it in all cases.

Link to comment
  • Level 5*
Just now, persistentone said:

The "Tag Picker" is the line where it says "Add tag" inside each Note?

Nope, tag picker has nothing to do with adding tags.  Adding a tag only matches from the beginning of the tag.  Your request had to do with searching tags.  You can look at your tags using the tag picker, Shift - Alt -T or by using the dropdown.

ScreenClip.png.4c3a0926b4918d6a3aa273fbc5450516.png

Link to comment
19 hours ago, csihilling said:

Nope, tag picker has nothing to do with adding tags.  Adding a tag only matches from the beginning of the tag.  Your request had to do with searching tags.  You can look at your tags using the tag picker, Shift - Alt -T or by using the dropdown.

 
 

That is very useful for searching globally for Notes that contain tags, thanks.

Summarizing the other use cases:

* There is no way to search on a substring in the middle of a tag when adding tags.

* There is no way to design a saved search that would search tags based on the presence of a substring in the middle of a tag.

Link to comment
  • Level 5*
6 hours ago, persistentone said:

That is very useful for searching globally for Notes that contain tags, thanks.

Summarizing the other use cases:

* There is no way to search on a substring in the middle of a tag when adding tags.

* There is no way to design a saved search that would find multiple tags based on the presence of a substring in the middle of a tag.

Correct.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...