How to Tag/Query Like in Logseq

What I’m trying to do

I am currently using Logseq, but want to switch to Obsidian (why?.. #1. because none of the plugins work on Android :frowning: #2 I really need some folders/pages structure like in Obsidian) .

In Logseq I can tag a parent block and when I run a query, I can get the parent AND all the children blocks. For example:

  • Here are some things I need to pack for my hiking trip #pack (parent)
    * Tent (child)
    * Sleeping Bag (child)
    * Food (child)
    In Logseq, I can run a query for #pack and it shows the parent AND the children.

When I do the same, in DataView, I only get the parent.

Things I have tried

I guess I could tag each of the children, but that would be a pain.

Any ideas???

Thanks for your help!!

You can try with an embedded query, with the query control plugin which allows you to have an option to display more context, it shows you all the subtitles of the result.

I think there is also a way with dataview but I don’t know enough about it, maybe with a regex. This one for example allows you that, but I don’t know exactly how to integrate it into dataview: /\-\s.*#pack(.*)?(\n\t+-\s.*)*/

Tags officially apply to whole notes. They effectively also apply to single lines because of how the search result previews work. Anything in between is a problem, unfortunately. As suggested above, it may require a complicated regular expression search — and that would be a plain-text search, not a proper tag search, so it won’t match any tags in properties.

Thanks for the info.

Bummer that it is not just a simple switch or plugin :frowning:

Cheers,

Thanks for the info.

I’m a novice Obsidian user… but I will give it a try.

I was hoping there might be a plug-in for this.

Cheers,

You could try putting the tag in both the first and last lines of the section, probably with a little something extra to indicate which is which. Then you could do a plain-text (not proper tag) search for everything between them. (This just occurred to me now so I have tried it or thoroughly thought it thru.)

Generally I try to tag lines that either stand alone or work as summaries. Your example is actually a good example of this — on search so would see “Here are some things I need to pack for my hiking trip #pack”, which would tell me I’ve found what I’m looking for, and then I’d click it to see the whole list.

If I wanted to embed the list I would give it a heading and then embed that.

If you want to go into more detail about how you used the feature in Logseq, we might be able to find a different technique to address it.

@JJinWI
you may try obsidian query with this plugin. obsidian://show-plugin?id=better-search-views. even though tags in obsidian is “tagged” to entire notes, using “block” search and this particular plugin allow you to display the results constrained to the “block”

```query
block: #ACMECorp 
```

3 Likes

Eureka!!! It works!!!

(Not as “pretty” as Logseq, but good enough!)

Is there a way to have the results fill a page???

Thanks for the tip!!!

Cheers,

This CSS snippet:

/*Allow full height of embedded searches instead of limiting to a scrolling box.

Courtesy of sailKite: https://discord.com/channels/686053708261228577/702656734631821413/1141539855969550437 */

.internal-query .search-result-container {
    max-height: unset;
}
3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.