chrisgrieser / shimmering-obsidian

Alfred Workflow with dozens of features for controlling your Obsidian vault.
https://alfred.app/workflows/chrisgrieser/shimmering-obsidian/
MIT License
817 stars 40 forks source link

Feature Request: Intelligent Sorting for Search Results & More Specific Search for File Sections #147

Closed PenguinDang closed 11 months ago

PenguinDang commented 11 months ago

Feature Requested

1. Intelligent Sorting for Search Results: When I search using Alfred, I notice that the results aren't always as relevant as I'd like them to be. For instance, when I have multiple pages containing the term "python", some are web clippings with the word "python" in the title, while others are pages related to Python. Inside Obsidian, the first result is usually the file named "python.md", which is very convenient. However, when using this plugin, less relevant pages often appear at the top, with the actual "python.md" file appearing much later in the search results. It would be great if the plugin could prioritize search results based on recent access history or the relevance of the title.

2. More Specific Search for File Sections: I often find myself needing to search for specific headings within a file. For a Python beginner like me, I might frequently search for the "dict" section under the H2 heading in the "python.md" file. However, simply searching for "dict" returns too many results. It would be useful if I could refine my search with queries like "python dict" or "python h2 dict" to precisely locate the "dict" section within the "python.md" file.

Relevant Screenshot

No response

Checklist

chrisgrieser commented 11 months ago

re 1:

re 2:

chrisgrieser commented 11 months ago

re 1: I just improved the sorting so that files that have been opened in Obsidian, but not opened via this Alfred workflow, are also prioritized in the sorting. https://github.com/chrisgrieser/shimmering-obsidian/releases/download/4.1.0/shimmering-obsidian.alfredworkflow

That's the best that's possible on my side, for the rest (exact match prioritization), it would require changes on Alfred's side

PenguinDang commented 11 months ago

Firstly, I'd like to express my gratitude for the improvements in version 4.1.0. I'm now able to search both file names and internal headings, which is fantastic. However, I've noticed that the plugin currently doesn't support simultaneous searches for aliases and internal headings. It would be a significant enhancement if this feature could be integrated. Thank you for your continued efforts!

chrisgrieser commented 11 months ago

However, I've noticed that the plugin currently doesn't support simultaneous searches for aliases and internal headings.

That's working fine for me?

You could try oupdate to manually refresh the metadata, in case it is out of date, but it definitely searches headings, files and aliases simultaneously for me. In case it's not working, I'd suggest you open a bug report, since the form asks for various kinds of further information I'd need to further look into it

PenguinDang commented 11 months ago

I've reinstalled the Alfred workflow and the two Obsidian plugins, and ensure there's no issue with my original data export. When I input a file name, not only does it display the file, but it also automatically shows the headings within that file. I can then continue typing to refine my search by the heading. However, when I type in an alias, it only displays the file associated with that alias and does not show the headings within the file. Consequently, continuing to type in the heading after the alias yields no search results. image image image image

chrisgrieser commented 11 months ago

When I input a file name, not only does it display the file, but it also automatically shows the headings within that file. I can then continue typing to refine my search by the heading. However, when I type in an alias, it only displays the file associated with that alias and does not show the headings within the file.

that is actually somewhat intentional, since having the headings also match via alias would create a lot of noise and make it harder to find a specific note. While dong so has the benefit of allowing to use an alias and then continue filtering, that mostly covers a quite niche case, as opposed to the cost of increasing noise for all other searches as well. Unfortunately, there is no perfect solution, but I think the current implementation is the best compromise.

PenguinDang commented 11 months ago

When I input a file name, not only does it display the file, but it also automatically shows the headings within that file. I can then continue typing to refine my search by the heading. However, when I type in an alias, it only displays the file associated with that alias and does not show the headings within the file.

that is actually somewhat intentional, since having the headings also match via alias would create a lot of noise and make it harder to find a specific note. While dong so has the benefit of allowing to use an alias and then continue filtering, that mostly covers a quite niche case, as opposed to the cost of increasing noise for all other searches as well. Unfortunately, there is no perfect solution, but I think the current implementation is the best compromise.

Understand. Thank you, and this is really a great workflow!