Properties: Support searching for number property like [property:5]

Steps to reproduce

  1. Add a number property to a note:
---
rating: 5
---

My note
  1. Search using this query: [rating:5] or ["rating":5]

Expected result

The file should appear in the search results.

Actual result

No files appear.

Environment

SYSTEM INFO:
	Obsidian version: v1.4.5
	Installer version: v1.2.8
	Operating system: Arch Linux
	Login status: logged in
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none
3 Likes

Try /rating: 5/.

  • It is regex format but no need to escape anything here. Should work.
1 Like

Moved to Help.

BTW, if you want to use double-quotes, do it like this:
"rating: 5"

I just prefer the slash version because when dealing with multi-word strings /foo bar/ finds ‘foo bars’ as well, but "foo bar" does not.

Every now and then I find myself doing something like line: (rating 5) to search for properties with some value. The line operator usually is a good enough limiter for my searches to yield good results.

I’ve even used this syntax for coloring nodes in the graph view. I.e. it lends itself very easily for matching against one tag in a list of tags.

I cannot test, and I certainly do not want to test you, but I would have thought line: (foo bar) produces an OR logical operator? So any note with lines having ‘foo’ and ‘bar’ on them will be displayed?
So line: ("foo bar") would target exact matches. In which case the brackets and even line: are superfluous.

Edit:
My mistake.
It is by default an AND operator but the matches don’t need to come in that order. And I almost never search for short lines such as the frontmatter or dataview properties.

  • Would be nice to have the search matches panel show the line numbers as well.

this hasn’t been implemented yet.

1 Like

Thanks for all your answers!

I only talk about the new property feature.

We can use a search query like [title:learning], but not a number property like [rating:5].

I thought it was a bug, but if it’s not implemented yet, I will wait and use the "rating: 5" workaround.

I had the same issues but I’m glad it’s going to be implemented yet, but I would like to know/suggest that when it’s implemented if we could search for intervals like [age: 10-15] to show all notes with this property in that interval, or only above or below a certain value like [age: >18].

3 posts were merged into an existing topic: Properties: Support searching for Boolean/Checkbox state like [completed:true]

will be implemented in v1.5. No ETAs.

2 Likes

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