Task-todo search fails with negation

Steps to reproduce

  1. Create “Page” with contents - [ ] abc
  2. Search for task-todo:(-d)

Expected result

The task should be listed under “Page” in search results.

Actual result

The task is not listed but:

  • The task is detected by the search (if you change it to task-todo:(-c) then “Page” disappears from the search results as expected)
  • “Explain search term” shows the search string has been correctly interpreted

Environment

  • Operating system: macOS 11.5
  • Obsidian version: 0.12.10
1 Like

Can confirm of this bug that affects me in a similar way. I have 3 sub-tags on the tag #priority : #priority/low #priority/medium #priority/high . When I query something like task-todo:"" -tag:priority/low (so, only medium and high priority), it only shows the medium priority. Same with other combinations of task-todo.

Using Obsidian 0.12.19 on Windows 10.

I just saw this bug report.
To the OP @stevelw we don’t support nested operators in tasks.

@luisandresgonzalez: you are describing another problem. I want to remind you that tag: is page level filter.

Hi, thanks @WhiteNoise.
I discussing this in the Spanish group with @argentum and I was wondering then how is it that when y query line:"" tag:(priority/low) it shows me the exact line of the tag with context, but line:"" -tag:(priority/low) shows me just the file name (no context this time)?

because tag filters at file level, line filters at line level.

tag:(priority/low) selects only the files that have a priority/low tag, not all lines in all the files that have priority/low

https://help.obsidian.md/Plugins/Search#Search+operators

1 Like

Thanks. So if I understood correctly, the reason that I get context when I query line:"" tag:(priority/low) is because it matches the file, but it only shows you the block that matches the query, right?
I mean this:
image