idk how true this is but I once saw a post saying the search function is basically a database query that replaces spaces with wildcards
hexbear
Hexbear Meta Community
Posts should be a a Proposal (idea for changing the site), Feedback (regarding non-technical aspects of the site, for technical please use https://hexbear.net/c/feedback), or Appeals (regarding admin/moderator actions).
Discussion regarding these will be within comments under the post, appeals and feedback that is resolve may be removed as well as duplicate posts.
The following behavior will result in mod action:
-
People that are frequently making vague posts or comments.
-
People that are hostile, taking the least charitable interpretation or engaging in bad-faith
-
People that are maliciously trying to stir up drama
Line 288:
pub fn fuzzy_search(q: &str) -> String {
let replaced = q
.replace('\\', "\\\\")
.replace('%', "\\%")
.replace('_', "\\_")
.replace(' ', "%");
format!("%{replaced}%")
}
You can link directly to a line, or even multiple. Clicking on the line number highlights it, shift+clicking on another highlights all in between the two selected.
I kept searching for "My Little Pony" in users' posts who said Star Wars was for babies and the mods had to ruin search to prevent this from continuing to occur on a regular basis.
The search is basic. As far as I can tell FunkyStuff is wrong in regards to "the words can be in a completely different order", no it has to be in order. But two things:
- The words can be surrounded by any number of letters, so long as the word itself is found it is satisfied. So searching for "un", " unoriginal" will satisfy it.
- While the words have to be in order, there can be any number of words in between. So searching for "the things", the first paragraph of this comment would satisfy that search. As you can see, "the" is the very first word, and "things" is the very last word in that paragraph.
Oops, yeah I mixed up order vs being contiguous.
I'll add that doing search well is a lot of work; just about anything you would do to "improve" it will introduce some drawback as well. I'm sure the lemmy devs just haven't had the time or inclination to focus on it past the basic functionality.
Yeah, I doubt I could put in a meaningful PR for search itself, but maybe the chronological filter bug might be easier to tackle.
That's very silly
I am just a user, but I'll say my workaround has been to sort by new. The things that come up are usually the things I'm looking for and they're sorted chronologically.
object permanence is the super power that turns you into a socialist, so I usually am looking for stuff from like 3 years ago and this tactic does not work.
Okay it's more of a pain in the ass, but the move I do in that case is search, sort by new, hit next and then the url has a numeral in it for what page of results you're on. Manually set that to a higher number to skip through a bunch of results pages.
It requires some playing around because I'm not aware of a way to find out the total number of pages, but you can usually find what you need with trial and error.
Because of woke...
For real though, I don't know
AFAIK the reason for getting irrelevant results is that the search function doesn't have a way to figure out which posts are closer to what you searched and which ones just happen to have the words but in a completely different order. That's why it sorts by points instead of sorting by relevance.
The time filter thing is just broken across the board, though. You can see it in profiles too.
edit: As Edie pointed out, the search does need the words to be in order. It's actually just replacing spaces with wildcards.
sorry i ate a lot of beans and then farted in the server room and now the search function can't pick its way through all the methane i released into the air
Sort by new just like you should be doing for everything else on Hexbear and it's pretty useful