drgrib / alfred-bear

Streamlined note searching and creation for Bear using Alfred

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search by multiple words (word parts) returns no results

preslavrachev opened this issue · comments

Not sure, if this has been mentioned before, but the search only seems to work with one keyword present. As soon as I add a second one (even if the first one is totally correct) it won't show any details. I have provided two screenshots below, to better illustrate the issue.

image

image

This has actually bothered me for a long time but I had given up on the problem because there is no way to make sqlite do fuzzy search without users manually installing Xcode and Homebrew and doing some brew installs .

However, I just checked this particular use case in the main Bear app and realized that, while they don't do fuzzy search either (probably for similar reasons), they do make multiple single word sqlite select queries and combine prioritized results. That will actually work both for your use case and my most common use case.

I'll put something together this week. Glad you brought this up. I'm excited to get it working.

Thanks, that would be great!

Or, we can revive the old idea I mentioned, about using something like Bleve for that. These tools are perfect for the kind of complex query scenarios one might come up with. Of course, building up an index all the time is kind of a tricky thing.

Right. Indexing still seems a little heavy of a process to add to me. I'm working on the branch right now. I'm pretty happy with the results but there are a lot more variations and metrics for doing this than I imagined before jumping in. I may keep it on my machine for personal use for a week and tweak it before releasing it.

Alright! Implemented in #28. Hope it works well for you.

Wow, exciting! Can't wait to get this installed. Thanks for the quick jump in!

@drgrib Works like a charm! Man, this is a game changer!

Thank you so much for the magnanimous endorsement :) I'm grateful for the positive publicity.

I'm also very happy the new search feature works as well for you as it did for me. I found myself rediscovering notes related to my test queries that I hadn't thought about in years. Thanks again for bringing the search feature to my attention.

Of course, it's totally well deserved! My hope is that your tool and my posts would trigger the attention of the Bear guys, about how important search is, once your database of notes grows out.

As always, I keep pushing forward for ways how to improve the search results even further. While I agree with you that keeping up a separate search index is an unnecessary complication, what makes me curious, is whether I can push SQLite to do this itself. Check this out: https://www.sqlitetutorial.net/sqlite-full-text-search/

I am not even sure, whether this is even supported on macOS, but it's worth trying. It's a bit invasive, since it requires creating a separate table inside the the Bear DB (not sure if that's allowed either), so I'd copy mine and give it a try. I'll let you know of the results.

As another beneficiary of the update, I just wanted to second the gratitude! I recently brought a sizeable set of notes into Bear, having used Sublime Text ever since nvALT began to expire, and this update is a great addition to what was already a tool without which, in all honestly, I wouldn't have moved to Bear in the first place. I simply had to replace “Go to anything” for quickly searching and opening notes, and the way this now works makes it just as effective as that ever was. I had been meaning to post my thanks here prior to the update, so now I'll thank you twice…

Just in case it's news, another workflow I have come across and begun using in my recent move to Bear is BearHunter. I tend to use this only for particular full-text searches, rather than title search/open – though I know your workflow does this too – because of the boolean operators. Not sure if it is being actively maintained, as I had to change the database location to get it going. I am nowhere near qualified to explore how this works differently or similarly with Bear's data, so won't even attempt to! But perhaps worth a look.