Gelbooru

Notice: We are now selling NEW Gelbooru Merch~! Domestic shipping is free on all orders! Do you have an artist tag on Gelbooru? Let us know so we can properly credit you!

Ticket Information - ID: #67


ID:Category:SeverityReproducibilityDate SubmittedUpdated By:
0000067Feature RequestLowN/A04/02/09 05:22AMbite
Reporterlozertuser
Assigned to:geltas
Resolution:Open
View StatusPublic
Version:0.2.0
Target Version:0.2.1
Summary:Add support for wildcard as the first character
Description:Add in support for searches that have a wildcard as the first character. I have no idea how this is going to work out as someone may type to search *a* and expect results for that, which I believe isn't really possible with our current system without unbelievable load.
Additional Info:Perhaps just do a regular MySQL query that isn't cached for those types of searches and limit them to logged in users of a certain group level?
th8827 replied at 2009-07-01 11:33:09
I would like to request this, as well.
My suggestion for the "*a*" problem is to do searches for "*a" and "a*" at first, until you figure out an efficent way to do both at the same time.

lozertuser replied at 2009-07-02 00:14:28
Reverse index perhaps would allow us to search and use the results returned and search the remaining tags? Maybe not, but it's worth investigation later on this year.

Thref replied at 2009-07-04 01:41:30
I don't know if this is relevant to the search mechanics of Gelbooru's search function, but take a gander at this.

Regular Expressions(I've added notes for myself to comprehend it):


. = a Wild Card for Any Single Character
\ = Escape Seqence for (Certain) Special Characters, Stated Directly After It
\. = Dot(Character)
\+ = Plus(Character)
\* = Asterisk(Character)
\? = Question Mark(Character)
\\ = Slash(Character)
\\\ = Double Slash(Characters)
empty String = The Insertion Point of Characters
+ = A Wild Card for any Character/s Stated Before It
* = A Wild Card of any Character Or Set of Characters Stated After It
? = A Wild Card for any Character/s & Character Sets Stated Before It
{#,#} = The Start & End Extents for a Set of Stated Characters
{#,} = Starting Point for a Set of Stated Characters, No Ending Limit
{0,} = *
{1,} = +
{0, 1} = ?
{#} = Match Just The Amount of Characters Stated; No More, No Less
^ = Matches Just The Beginning of The Character/s Stated, Stated Before It
$ = Matches Just The Ending of The Character/s Stated, Stated Before It
< = Matches any Characters Beginning with The Characters, Stated Before It
> = Matches any Characters Ending with The Characters, Stated Before It
() = Shell, Isolate
(()) = Nested Shell, Isolate+
(_?_)+ = Start With Characters Stated After ? & Include all Other Variants
Stated Before ? Afterwards, Such that, Characters Stated Before ?
Appear ONLY After Characters Stated After THE ? Appear
| = Pipe = Match Any Available Set That Matches = Such That
_(_|_|_|_)? = Match Anything That Starts with The Characters Stated Outside
The () With The Fallowing Items/Characters that are Stated
Inside The () to be Matched Afterwards; Include Partial Matches
In Regards to The Characters Stated Outside The Shell, As Well
[] = Field = All Characters Stated Within the Field are Considered Characters
Except for - AND ^
[_-_] And/Or [#-#] = The Min. & Max. Extents for a Set of Stated Characters
And/Or Including Numbers As Well; Also Applicable
to Capital Letters
[^_-_] And/Or [^#-#] = The NOT Min. & Max. Extents for a Set of Stated
Characters And/Or Including Numbers As Well;
Also Applicable to Capital Letters
\d = [0-9] = Matches Characters Numbers that contain Numbers 0-9
\D = [^0-9] = Matches Characters Numbers that DON'T contain Numbers 0-9
\w = [a-zA-Z0-9] = Matches Words With Numbers and Caps
\W = [^a-zA-Z0-9] = DOESN'T Match Any Words, Numbers Or Caps
\s = [ \t\n\r\f] = Matches a White Space
\S = [^ \t\n\r\f] = DOESN'T Match a White Space
*.[__]_ = Matches the Ending Characters That Start With any of the
Characters Stated in The [] and End With The Character/s Stated
Outside The []
.*\.___ = Match Anything that Ends With the Dot(.) Extension(___);
Match Items Only With The Extension .___
__*\.[__]__ = Match The Starting Characters, With Any Other Character/s &
Match The Dot(.) Extensions beginning with The Characters
Within [] That End with The Characters Outside of []



I found this in a Man page from a certain Small Linux Distro; VERY HELPFUL.
Your Welcome.

bite replied at 2016-12-21 10:27:43
bump, was about to submit a new issue for this

i noticed wildcard-as-first-character searches work on the tags page