Path appears to be ignored
macbikegeek opened this issue ยท comments
Obsidian search string of
path: "๐บ TV Shows" tag: #to-watch
returns one note which is in the ๐บ TV Shows folder and has the #to-watch tag. There is another file in the folder without the tag which is not displayed.
```note-gallery
query: 'path: "๐บ TV Shows"'
query: tag:#to-watch
sort: asc
debugQuery: true
limit: 15
```
returns all notes in my vault with the tag #to-watch, including the correct one in ๐บ TV Shows.
I've tried multiple permutations with and without the single and/or double quotes and space after path:. Most return the same result set while a couple return an error.
@macbikegeek it's a little difficult to help you debug your issue as I don't see what question is being asked. Based on reading your issue, I feel that everything you mention is operating correctly.
In your first search string you are asking for path: TV Shows
AND tag: #to-watch
. Obsidian will only return the note matching both of those filters.
In the code-block you provided as an example, you have query
defined twice, so the second one is taking precedence...
You should try to build your query with the obsidian search menu or use debugQuery: true
. Please, let me know if you figure it out or what you want exactly...
The correct syntax is query: 'search string'
, for example:
~~~~note-gallery
query: 'path: Atlas tag: #test'
debugQuery: true
~~~~
![SCR-20240205-ujgi](https://private-user-images.githubusercontent.com/673857/302457183-a3476f16-1d75-4cf0-8e4e-7b750e696b55.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMjc4NDAsIm5iZiI6MTcyMjAyNzU0MCwicGF0aCI6Ii82NzM4NTcvMzAyNDU3MTgzLWEzNDc2ZjE2LTFkNzUtNGNmMC04ZTRlLTdiNzUwZTY5NmI1NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyNlQyMDU5MDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yYTllYWFjMWQ3OWEyM2IxODRhYWIwMWEyMTBhODI0MDA4NDE2NWYxMTA3NWYyYTJiY2YwMGU4N2ExNGFmN2E0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.aZ1KA_TzzjoQqUKj9qo8kl1byLWrfok5lqlDWK8iDag)
Thanks, I mistook the examples that show multiple query lines as meaning each element of the Obsidian query syntax needed to be in a separate query string. Thanks for the clarification - with both path and tag in the single query string the query is working as expected. Thanks for the awesomely quick response!