Closed Markhenn closed 1 year ago
This is by design. I.e. in parsing an ambiguous query like #word1 word2
as #tag-word1 tag-word2
or #tag-word query-word
, the workflow defaults to the latter.
I'll add that Bear itself doesn't seem particularly friendly to spaced tag names. E.g. there is no clear way to author one on the fly in a note as far as I can tell.
Unfortunately, I don't see a good resolution but I am open to suggestions.
Would be able implement the same trick that bear uses in their multitag search?
In bear I need to have the pound sign #
at the beginning and the end of the search term to show that it is a multiword tag.
I guess you are using regex to parse the text. I have no idea how you set it up, but the following regex selects everything between the first and the second pound sign (including the pound signs).
/(#.*?\b#)/g
Maybe this will help.
Sure thing. I can't guarantee when I would be able to work on this but that is a reasonable solution for eliminating ambiguity.
All cool!
I had a look into the core file and it seems more complicated than changing a regex.
I'd be happy if you would have a chance to work on it.
It would be great if we could get this to work. I just installed this workflow on Bear 2 and since all of my hierarchy tags have a space in them, I can't search for any tag. Thanks for taking a look!
Implemented in #60
Thank you!!!
It is working as advertised. I know my setup may be a little different. One of my tags inlcudes a last name and first name separate by a comma ,. For example #tag/multi word/lastname, firstname#. In this case, I noticed that the debugging in Alfred showed me that it stopped at lastname. In other words, it seems the comma is being interpreted as a break EVEN THOUGH in my list of hits inside Alfred, it is showing the tag correctly. When I hit enter, it loads the tag correctly but when I perform the search in Bear with that tag, it doesn't work in THIS scenario. Other scenarios it is working just fine. Any ideas? Thanks.
I'm having trouble following what you are saying isn't working about it. When I try in a test it parses fine:
{
name: "multiword tag with comma",
arg: "#tag/multi word/lastname, firstname#",
expected: core.Query{
Tokens: []string{"#tag/multi", "word/lastname,", "firstname#"},
Tags: []string{"#tag/multi word/lastname, firstname#"},
LastToken: "firstname#",
WordString: "",
},
},
So what doesn't work?
Let me see if I can provide more details...
When I enter this text... bs #multi/word search... I can see the multi word tag in the list (i.e.) "#multi/word search#. If I click on "enter/return" it places that full text into the search window. I see a list of all search results that use that tag. So, this is working. Is it possible to go to that tag in Bear? When I hold down the option key, it does say "Search query in Bear" but nothing happens. If I do the same with the search results list, it DOES take me to the select note just fine. So, that too is working. I guess my question is... is it possible to do a search on the tag or go to the related tag in Bear? That way it would bring that tag into focus and I could continue in Bear at that moment. Hopefully, this helps to understand the scenario. I do appreciate your work!
Please post a screen recording of your issue (you can use QuickTime Player with File->New Screen Recording). Everything I test, including "Search query in Bear" works for multiword tags on my end.
Implemented in #60
Thank you very much! It is working on my end!
I could make a video but I think I have found that when there is an & (ampersand) in the tag name, it fails. I have searched for other tags and they all work just fine. But a multi-word tag that happens to have & seems to fail. Can you confirm? Thanks.
I can confirm that using &
in title names causes some strange behavior, likely because it is difficult to translate into the command URLs. I'm unlikely to go through the hassle of adding support for unusual character uses in tags as it seems like a lot of effort for a very unusual use case.
I understand. I'll review my naming convention. Thanks for your time!
Hey Guys,
the search for tags doesn't work when there is a space in tag name.
I saw that this issue has come up already, but haven't found a solution in the other issues.