linkding
linkding copied to clipboard
Boolean Search
I just discovered Linkding, and haven't really used it yet - so maybe I just missed the feature - but seems like Linkding doesn't support it yet:
A search engine is so much more powerful when it allows me to hone my search using boolean logic. A side effect of having boolean search is usually a smaller and more manageable tag collection.
I would like to see:
- AND - I think this is default (current) behaviour?
- OR - one or the other: #utility OR #accessory
- NOT - for excluding tags: #utility NOT #iOS
- () - for grouping tags: (#utility OR #accessory) AND #macOS
This way I can find:
- #utility NOT #service
- (#utility OR #service) NOT #online
If this is not already supported, I hope to find time to add this.
No, this is not supported ATM. Currently all search terms (words and tags) are combined using AND
.
I understand your use-case, and if I would want to support complex queries then I would go for a textual query language instead of a visual query builder. But I can see this easily getting out of hand in terms of effort and complexity (which I have to maintain). Just some things from the top of my head:
- Would need to write a custom parser for the query syntax
- Syntax would still need to support entering multiple terms without operators as it does now, which introduces several edge-cases
- Would need to handle syntax errors when parsing and communicate them to the user in a reasonable way (preferrably not just
Unexpected token: abc
) - Query syntax needs to be documented so that it is actually discoverable by the user
- Complete reimplementation of the SQL query building logic
- Needs an extensive test suite
- Would need to make sure the search auto-complete still works correctly
If someone can provide that and verify that it works with a sufficient test suite then I would consider it.
This is a great suggestion, although I fully respect the complexity and sustainability of such a feature.
That said, I'd like to also a request for some smart logic such as:
site:github.com tag:dev issue linkding
Possible search syntax (and implementation) https://github.com/mchaput/whoosh (also implementats FTS, but query parser can be extracted.
Other option could be Haystacks for Django?