Tag searches when tags are in the "tags" field of properties has wrong count and broken preview

Steps to reproduce

  1. Tag multiple notes using the “tags” field in Properties.
  2. Add the same tag using a “#” within the note itself.
  3. Do a search for the tag using Core Search plugin

Did you follow the troubleshooting guide?

Yes

Expected result

I expect to see -

  • A list of notes which have the tag regardless of whether I tagged it within the note using a # or using “tags” property
  • A correct count of the number of times the tag was used
  • Additional context as to a preview of the line within the note where the tag was found

Actual result

  • I do get a list of notes which have the tag. This part is not bugged
  • The count is wrong. It only counts the tags within the note using the #. The tags within the properties are not counted. They are shown in the preview but they are not counted.
    • If I have 3 tags within notes and 1 tag within properties, and I search for the tag, I see 4 results and “3 results” in the count.
    • If I have 1 tag within notes and 3 tags within properties and I search for the tag, I see 4 results and “1 result” in the count
    • If I use tags only within properties and tag 3 notes using properties and search for the tag, I see 3 results and “0 result” in the count
  • The preview of the line is not shown. I guess this is to be expected because I’m not sure what I’m expecting with this one. Maybe the line within the YAML where tag is added?

Attached a screenshot to emphasise the bug. I have added the tag “evergreen” via “tags” property to three notes and added “evergreen” to the “Link Notes” note.


Additional information

I can’t reproduce in 1.5.4.
Let me know if you still have the problem when you get it