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!

Now Viewing: Wildcards before search term to find suffix?

Keep it civil, do not flame or bait other users. If you notice anything illegal or inappropriate being discussed, contact an administrator or moderator.

Thotty Group: Member - Total Posts: 1
Wildcards before search term to find suffix?
Posted on: 07/30/18 12:35AM
Is there a way to implement wildcards before a search term to show all results that end in that term?

I know it doesn't work, but something like "*term" where it would return 'Aterm', 'Bterm', 'Cterm', etc.

It's weird cuz in the 'tags' tab, I can search for "*term*", and it will return every tag that includes the term, prefix or suffix: 'Aterm', 'termB', and 'CtermD'

So why does this work when searching tags but not when searching works?


Jerl Group: Administrator's Pet - Total Posts: 4561
Posted on: 07/30/18 01:09AM
There's most likely a lot of underlying technical details for why this is the case, but the main reason for why it works on the tags page and not the post list is pretty straightforward:

The tags page uses a direct query to our SQL database, while the post list instead pulls results from our search indexer (Apache Solr) and doesn't touch the database at all for the search.

The inability to use wildcards at the start of a search term is a side effect of using Apache Solr. I don't know the exact details, and it's possible that there's a way to work around it that we just haven't implemented, but it isn't as easy as just copying the code from the tags list. The fact that we use Solr is also why we don't have a way to perform an OR search.

add_replyAdd Reply