Fivefold / linkding-injector

Injects search results from the linkding bookmark service into search pages like google and duckduckgo
MIT License
216 stars 8 forks source link

Doesn't match against link tags unless use # #8

Closed adamshand closed 1 year ago

adamshand commented 1 year ago

Hello,

To my surprise, I just realised that linkding-injector doesn't seem to substring search tags. For example, I just added a link with a tag interviewing, but when I go to DDG and search for interviewing it doesn't show up (it does show up if I search for #interviewing).

It would be great if tags were searched along with everything else.

Thanks again for a great addition to linkding, I use it every day!

Cheers, Adam.

Fivefold commented 1 year ago

Hey Adam, thanks for the feature request.

tl;dr: Unfortunately this is kind of out of scope. This extension just sends a search request to your linkding instance (using the linkding API) and returns it's results.


In other words, search with linkding-injector works exactly as it does as if you were to access linkding directly yourself. There, searches in tags are started with #, like you mentioned. You can also search with something like personal #interviewing, which would mean "search for bookmarks with 'personal' in the title or description and interviewing as tag". Searches for several tags are possible too, e.g. #interviewing #personal.

I don't think it's implemented in any form yet, but for the future (of linkding) I could also imagine negative tag searches, e.g.#interviewing !personal which would mean "search for any bookmarks that have the tag interviewing but don't have the tag personal".

All of the above can't be done if searches match title, description and tags every time.

Now I could technically implement a search with your expected behaviour on top of the linkding API, but I'd rather keep consistency with the way linkding searches work and keep the search logic on linkding's side of things. While I can understand your use case, and the philosophy of this extension is kinda "don't think about bookmarks, get reminded of them" other users might not expect this behaviour to differ from the linkding homepage one.

Feel free to make a feature request for this in the official linkding repository though. I don't think @sissbruecker will change the way the search works, but there's an (admittedly slim) chance he would add a second search API function with your intended behaviour if you ask. In that case I could implement it easily with a setting.

Fivefold commented 1 year ago

Even though I closed this you are free to share any thoughts.

sissbruecker commented 1 year ago

I've thought about automatically including tags through search terms, as sometimes I also get annoyed of having to type the # to match a tag, event though I already know that there isn't a lot of overlap between that tag name and other bookmark contents.

Doing this by default is probably not an option, as it would also increase the search results, and in possibly unexpected ways. But I would consider adding a user-profile option that allows you to match search terms against (full) tag names in bookmark searches.

Anyway, opening an issue in the linkding repo as Fivefold suggested, is probably a good start 🙂.

adamshand commented 1 year ago

I missed that it was a behaviour of linkding itself rather than the injector. Whoops!

Thanks for the responses, I have opened a new ticket over at linkding: https://github.com/sissbruecker/linkding/issues/409

Cheers, Adam.