scambier / obsidian-omnisearch

A search engine that "just works" for Obsidian. Supports OCR and PDF indexing.
GNU General Public License v3.0
1.19k stars 60 forks source link

[Feature request] Better presentation of where in the note the search keyword was found #109

Closed ma-sadeghi closed 1 year ago

ma-sadeghi commented 2 years ago

Is your feature request related to a problem? Please describe. Let's say I search for the keyword "xyz". The way Omnisearch currently works is that it shows a list of items, each with a title (the note title) and optinally a subtitle, which shows where exactly in the note was matched. There are two issues:

  1. The matched keyword is shown as bold, which is ok, but still not perfect for visibility, especially in night mode. I suggest highlighting it. Here's a screenshot of how it currently works. As you can see, the keyword "global tortuosity" is not very distinguishable from the rest of the snippet. Highlighting the matched keyword would help a lot with visibility.

Edit 1: I just learned that this can be added via CSS, so it's all good :)

image

  1. The second issue is that the snippet shown doesn't respect newline characters, which makes it difficult to parse. Let me explain: in the screenshot, the snippets was supposed to be a bullet list, but it's shown as a paragraph, which makes it psycologically difficult to parse at the first glance. In this particular case, since I knew that the result should be in a list, I almost ignored the first hit shown by Omnisearch at the first glance. Again, it's a minor thing, but showing the newline characters, I think, really helps the experience to be much smoother.

Describe the solution you'd like First, I'd appreciate it if you could make the matched keyword in the search result highlighted(maybe both highlighted and bolded, but at least highlited), and second, it'd be great if you could somehow render newline characters in the optional subtitle snippet, so that's it's easier to parse.

Describe alternatives you've considered None.

Additional context None.

Thank you so much for creating this amazing plugin!

scambier commented 1 year ago

The line returns look better than I anticipated, so I added that as an opt-out setting. Will be published with the next beta release