Zettelkasten Forum


Search behavior in The Archive with seemingly similar tags

Please direct me to the proper discussion if the following has already been discussed in somewhere else in the forum. I tried searching in advance but without success...

My question is whether there is a way to search for notes with a specific tag without including notes using tags that the search term is part of?

In Finnish we have way too many compound words, and hence the tags might end up being very similar (e.g. #sielu #sielunhoito #sielunvaellus). I know I can use NOT operator for some edge cases with knowingly few conflicting tags but there are cases when it just doesn't apply at all. I suppose the same difficulty occurs with German language also :smiley:

(I wish I could use regular expressions!)

Comments

  • The simpliest solution I can come up with: "#tag " (put a space behind the tag between the quotation marks)

    I am a Zettler

  • Thanks Sascha! For same cases that works indeed, but when the tag is the very last word in the line (or the only one) it doesn't work anymore.

  • The only (sadly annoying) solution would be to search for "#tag " OR "#tag[whatever line break is]"

    But as I am thinking. In German, we have an abundance of compounds, too. It doesn't affect me that much. Perhaps your issues might be workflow-related?

    If you go into more detail with a use case, I could help you more.

    I am a Zettler

  • I also ran into this problem with tags. In my case, I spent some time deepening my understanding of what a method is (in Spanish, #método). But then I started studying specific methods, such as the Finite Difference Method (#método-de-diferencias-finitas) and the Complex Difference Method (#método-de-diferencias-complejas), which led to a problem very similar to the one you describe.

    My solution (recommended by Sascha) was to accept that tags are not as important or valuable as they might seem. It is valuable to identify an object using an object tag, but retrieving notes via tags does not scale well as the number of notes grows. In that sense, fixing the specific problem you describe is not very valuable in the long run, because you don't want to rely on retrieving notes this way anyway. What does scale well with number of notes is a combination of structure notes and double-hash tags to quickly access the desired structure notes.

    Another solution I considered was changing the tag syntax to something like :sielu:, :sielunhoito:, and :sielunvaellus:. With this approach, searching for :sielu: would return only notes with that exact tag, while searching for :sielu (without the closing colon) would retrieve all notes with tags that start with "sielu".

    However, this approach goes against the standard tag syntax accepted by the community. You can go against it (there is no tag syntax police :-) ), but I believe the good solution is the first one I described.

    Creative work doesn’t play by conventional rules · Author at eljardindegestalt.com

  • edited February 11

    @jwa said:
    My question is whether there is a way to search for notes with a specific tag without including notes using tags that the search term is part of?

    Sounds like a feature request.

    A search for hashtag #cat should not return #cats, #catch22 or#catalog.

    (I wish I could use regular expressions!)

    That sounds like another sensible feature request.

    @FernandoNobel said:
    (…) fixing the specific problem you describe is not very valuable in the long run, because you don't want to rely on retrieving notes this way anyway.

    Hashtags are a very valuable way to retrieve notes, if you combine them smartly with other ways to retrieve notes.

    Your tools influence your workflow. For example Obsidian's powerful search feature is one of the reasons why it became my main tool for note-making. The developers understand hashtags. For example you can easily search for multiple hashtags, eg #tutorial and #math.

    I wouldn't use hashtags as you do. I wouldn't use hashtags for that. If I wanted to understand, what a método is, I would start with a definition note called método and work my way from there. It's not how Sascha would do it, but it works for me.

  • @harr How many notes does your ZK have?

    I am a Zettler

  • edited February 11

    @Sascha said:
    @harr How many notes does your ZK have?

    More than 20k notes (ZK and non-ZK). Hundreds of tags.

  • Thank you all for the answers.

    @Sascha said:
    Perhaps your issues might be workflow-related?

    This might be true in some sense. I am leaning heavily on structure notes in my workflow and mostly tags do not play a big role when retrieving knowledge from my Zettelkasten. However, once in a while there indeed are cases when tags are the most meaningful way to have an overview on topic(s).

    @harr said:
    A search for hashtag #cat should not return #cats, #catch22 or#catalog.

    The example above describes better a scenario when the overlapping is problematic – even when it is not about compound words.

    @FernandoNobel said:
    Another solution I considered was changing the tag syntax to something like :sielu:, :sielunhoito:, and :sielunvaellus:. With this approach, searching for :sielu: would return only notes with that exact tag, while searching for :sielu (without the closing colon) would retrieve all notes with tags that start with "sielu".

    Actually, I can see here a seed for a working solution meanwhile The Archive doesn't support explicit tag search, thank you! Why didn't I think of this way already? :smiley: Maybe I just add an underscore or similar character at the end of every tag. That way there is no need to move away from standard syntax.

  • @harr said:

    @Sascha said:
    @harr How many notes does your ZK have?

    More than 20k notes (ZK and non-ZK). Hundreds of tags.

    Just your ZK. :)

    I am a Zettler

  • edited February 11

    @Sascha said:
    Just your ZK. :)

    A few hundred, growing slowly. I keep the number down, because they share the same system with other note types and because I find other note types easier to work with.

    For example, I explore academic humility in:

    • two book notes "Eco (1977)" and "Eco (2015)" for the italian and english editions of How to write a thesis.
    • a definition note called "umiltà scientifica (Eco)" that unpacks Eco's definition in chapter IV.2.4 of the book. (I'd create separate definition notes for other uses of the term, eg in catholic literature from the 19th century.)
    • Zettels for general ideas like "We can learn from anyone" and "In order to learn from other people, we have to listen respectfully", because they are possible connections to other authors.

    I didn't create a zettel for the principle to "not exclude any source", because that principle is already discussed in the definition note.

    I haven't created zettels yet for other interesting aspects of umiltà scientifica. But I've prepared statements in the definition note, that could become zettels. For example: "Academic humility does not require humility", ""academic humility is a matter of pride", "take pride in learning from unpleasant, unimportant or ignorant people" or "take pride in evaluating sources, that other people ignore". The ideas are already being explored in the system. They can be found, just not as zettels.

    All those notes can link each other. And all those notes can be sprinkled with hashtags.

  • edited February 11

    @jwa said:
    Maybe I just add an underscore or similar character at the end of every tag. That way there is no need to move away from standard syntax.

    According to Wikipedia some Chinese sites use a hash sign to close hashtags, because text doesn't usually have spaces: #cat#

    The advantage of an underscore (_) would be compatibility with editors that do support hashtags. In the most minimal form a hashtag can have letters, numerals and underscore: #cat_

  • According to Wikipedia some Chinese sites use a hash sign to close hashtags, because text doesn't usually have spaces: #cat#

    This was new interesting peace of knowledge.

    While contemplating the freshly-solved tag searching problem against all the answers once more, I can see there is still room for applying systems thinking to my Zettelkasten. It is so easy to get lost tightening unnecessary screws when the biggest leak in the boat is somewhere else...

  • @jwa said:

    While contemplating the freshly-solved tag searching problem against all the answers once more, I can see there is still room for applying systems thinking to my Zettelkasten. It is so easy to get lost tightening unnecessary screws when the biggest leak in the boat is somewhere else...

    That's the feeling that helped me move past the tag problem :-)

    Creative work doesn’t play by conventional rules · Author at eljardindegestalt.com

  • @FernandoNobel said:
    Another solution I considered was changing the tag syntax to something like :sielu:, :sielunhoito:, and :sielunvaellus:. With this approach, searching for :sielu: would return only notes with that exact tag, while searching for :sielu (without the closing colon) would retrieve all notes with tags that start with "sielu".

    VimWiki uses this exact syntax. Works well and allows for chaining tags together. See the VimWiki manual

    However, this approach goes against the standard tag syntax accepted by the community. You can go against it (there is no tag syntax police :-) ), but I believe the good solution is the first one I described.

    I would use this tagging system.

  • edited February 24

    @jtmusky said:

    @FernandoNobel said:
    Another solution I considered was changing the tag syntax to something like :sielu:, :sielunhoito:, and :sielunvaellus:. With this approach, searching for :sielu: would return only notes with that exact tag, while searching for :sielu (without the closing colon) would retrieve all notes with tags that start with "sielu".

    VimWiki uses this exact syntax. Works well and allows for chaining tags together. See the VimWiki manual

    However, this approach goes against the standard tag syntax accepted by the community. You can go against it (there is no tag syntax police :-) ), but I believe the good solution is the first one I described.

    I would use this tagging system.

    I started my Zettelkasten in VimWiki, that is why I introduced the : tag syntax to the discussion :-) But, eventually, I decided to switch to hashtags so I could be closer to the ZK.de community.

    Other advantage of this syntax is that the double-hashtags syntax looks relatively nice ::sielu:.

    In Obsidian, they solve the tag search problem by using a special search syntax, such as tags:#sielu. A similar solution could be implemented in the Archive, but it would go against the links-as-search philosophy.

    Creative work doesn’t play by conventional rules · Author at eljardindegestalt.com

  • (I wish I could use regular expressions!)

    If this is something you would use enough, perhaps its worth making a plugin for?

    A quick test seems to indicate you could use apt.prompt , type in a tag, then use that input along with JS regex to get what you wanted, presumably something like /\#mytag\b/.

  • @Thai said:

    (I wish I could use regular expressions!)

    If this is something you would use enough, perhaps its worth making a plugin for?

    That is something I'll have to consider about. I've been playing around with the plugin system recently and it shouldn't be that complicated to make it work indeed. On the other hand, it is more straightforward to run the grep from the cli while I am considering whether I truly need any tags at all :D

Sign In or Register to comment.