Closed sjehuda closed 2 months ago
I believe the --deep
option is meant to cover this sort of thing:
--deep match substrings ('pen' matches 'opens')
…Though it's likely only implemented for --sany
/--sall
(and --sreg
doesn't search for it in the first place).
That being said, you're likely meant to use additional tags if you want to use them as search criteria (i.e. code
in addition to code:bash
if you want to search for all code-related bookmarks); and UX-wise it may be better to collect the list of all existing tags and provide them as available options to the user instead of requesting for arbitrary input.
I might want to exxclude columns. Suppose title is "Software directory for niche: Bookmarks" (please notice the colon), a search will detect that titile if niche:
is searched for, yet I might only want to search the tags that begin with niche:
.
Alternatively you could implement search-with-markers, like it's done in Bukubrow: the prompt
title substring :url substring :https > description substring #tag substring: # another tag *global substring
searches for a bookmark with title substring
as a substring within the title, url substring
& https
as substrings within the URL (though naked whitespaces are rather uncommon there I believe), description substring
as a substring within the description, tag substring:
& another tag
as substrings within tags (commas aren't legal here but the same tag can match multiple tokens), and global substring
within any of these fields.
(The split regex used there is \s+[:>#*]
, if that wasn't obvious.)
Alternatively you could implement search-with-markers
…Come to think of it, I might give it a shot (albeit with slightly altered syntax); the current lack of search field distinction (particularly stuff like "finding a specific URL that I just added") had been kind of bothering me lately :sweat_smile:
Note: my implementation is slightly different from the Bukubrew one:
*
); to search within title only, use .
prefix--deep
in CLI) affects all substrings except for the tags-only ones (#
); and when applying a global substring to tags, non-deep search matches exact tags instead of full words#,
), it contains exact tags (otherwise they're partial); when applying a global substring to tags, this exact/partial behaviour is based on current Deep Search mode--regex
in CLI) works with markers, but splitting tags by comma (as well as Deep Search and All Keywords Search) is not done in this mode; regular expressions are applied as-is, with the markers used only for splitting and field selectionQuick search in Bukuserver navbar uses the same options which are enabled by default in the index page search (markers + all-keywords); these are default primarily because markers don't interfere with most searches unless used explicitly, but also because there's no splitting done with markers disabled.
You may want to document this in the wiki somewhere.
You may want to document this in the wiki somewhere.
https://github.com/jarun/buku/wiki/Searching-and-ordering
(The Markers section describing this logic can be found in the article ToC.)
Thank you!
Feature requests
Search bookmarks with tags that contain
string
.At the moment it is only possible to select bookmarks with tags that exactly match to the string that is input with
-t, --stag
(in code:args.stag
), and it is not possible to select bookmarks that - for instance - contain tags that begin with a given string (e.g.code:
,interface:
,niche:
,software:
etc.).Currently, the only fashion to do so is by an SQLite software; for example:
I intend to write code which does this.
I would be glad to receive guidance to add this feature.
I am still contemplating
Suppose this feature is added.
Next time, someone might ask to search only titles (metadata) or descriptions (desc) or URLs (urls), so I might want to make this possible, now, instead of writing code specific to tags.
So I might want to add these search options: