Behavior of searching multi tags maybe it's a bug?

Steps to reproduce

Behavior of searching multi tags maybe it’s a bug?

What is the difference between adding and not adding ‘#’ symbols?

The reason is that when I find that searching for multiple, it will cause the tag to find the title

file:tag1 and tag2:

---
tags:
  - tag1
  - tag2
---

### tag1 tag2

file:only tag2:

---
tags:
  - tag2
---

# tag1
## tag1
### tag1

When I expected to search only tags in metadata:

Then I found out that the official documents stated that

Find tag in file.
Example: tag:#work.
Note: Since tag: ignores matches in code blocks and in non-Markdown content, it’s often faster and more accurate than a normal full-text search for #work.

I tried add the ‘#’ sign, try to accurately match:

It’s too strange to understand

Did you follow the troubleshooting guide? [Y/N]

y

Expected result

Multiple tag queries work well

This problem is also applicable in the search box

Actual result

  1. Accurately match multiple tags when searching

  2. Is it normal to match the title? If it is not normal, you need to exclude

Environment

SYSTEM INFO:
Obsidian version: v1.6.7
Installer version: v1.6.3
Operating system: Windows 10 Enterprise 10.0.22631
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none

Additional information

Please forgive my translated expression

If you’re looking to match #tag1 and #tag2, then the search syntax should be: tag:tag1 tag:tag2. A space in the search query means you are starting a new search token.

Some operators even allow you to add a nested search term within parentheses, for example: task:(call OR email) .

how can I use it if I want to search for multiple?

Multi-tag search doesn’t seem to support:

image

And exclude it doesn’t support too:

image

How can I achieve the effect of many tag search?
like this:
tag: targetA targetB -MOC -excludeA -excludeB -excludeC -excludeD ....

Goal Syntax
exclude -tag:tagA
find files with either tagA or tagB tag:tagA OR tag:tagB
find files containing both tagA and tagB tag:tagA tag:tagB
Complex query tag:targetA tag:targetB -tag:MOC -tag:excludeA -tag: excludeB -tag:excludeC -tag:excludeD
1 Like

This solves my questions, thanks!

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