4 ms·
Seems like a case of adding "ORDER BY number_of_previous_visits, distance" to a SQL query...
by SmellyGeekBoy 9y ago
Seems like a case of adding "ORDER BY number_of_previous_visits, distance" to a SQL query...
- mattmanser 9y agoHaving actually programmed search functionality like this I can assure you, it's really not. That's what you start with. Even if you put aside that distance is something that has to be calculated through triangulation as many systems now include that. Especially when you add in rankings, you start having to think about sorting by multiple layers, circles of distance with ranking sorted by that. So the really good match 20 miles away is shown lower than the pretty good match 5 miles away, but they're both shown above the bad match 7 miles away. And that's before you add categories, past history, any paid ranking, etc. And then the queries get really expensive and you've got to decide what to fudge or not to keep the system responsive and stop your search system eating all your CPU. And you can bet people will still find scenarios where they'll say "why's it doing this? I'd expect the order to be different". This is pattern matching and value assignment, something humans are amazing at and computers aren't.
- coldtea 9y ago>Having actually programmed search functionality like this I can assure you, it's really not. That's what you start with. Even if you put aside that distance is something that has to be calculated through triangulation as many systems now include that. It already prints a distance. It could use that. Or, if it is some kind of point to point distance, it could calculate a driving distance and use that if it wanted to be extra smart. Add the type of place it shows, and be done with it. >Especially when you add in rankings, you start having to think about sorting by multiple layers, circles of distance with ranking sorted by that. We've been doing multiple criteria sorting for millennia. It's not rocket science either. >So the really good match 20 miles away is shown lower than the pretty good match 5 miles away, but they're both shown above the bad match 7 miles away. Why is one "really good" and the other's (that are also of the same store) not? They are bloody stores of a franchize. Don't try to be clever and define what's "good" and just show them to me sorted by distance AND type (in case there's a city called that too or something). End of story. >And you can bet people will still find scenarios where they'll say "why's it doing this? I'd expect the order to be different". People might or might not say anything. But way fewer will be confused by a distance sorted list + an indication of what the item they saw is (store, city, village etc), than with this clusterfuck of a result.
- mattmanser 9y agoThere's a massive difference to printing 10 distances from your result set, and calculating 10 million. I'm not sure why you had to exaggerate "millennia". How does a computer know that searching "Wawa" means you want the store and not the town? You haven't even considered that. It's a search term. And a really good system would clearly takes a load of things you're not considering into account, relevance, rank, personal relevance, historical relevance age, etc. A really good system might even helpfully try to include traffic density, how busy a store was, etc. What if all the stores near him have 1 star google reviews? What if some of those Wawas are paying for adverts and some aren't? What if some of them have opening times set up, and some don't? As I say, their ranking system might be working great for other things, but something like this it spits out crap.
- coldtea 9y ago>There's a massive difference to printing 10 distances from your result set, and calculating 10 million. Well, no reason to calculate 10 million. If another way to select a list of top suggestions to show is less costly, you can just calculate the distance for the existing suggestions they're already about to show - and then show them sorted by the distance). Having the unknown criteria they used to pick the suggestions reflected in the order they show them is not useful to anyone though. >I'm not sure why you had to exaggerate "millennia". Not exaggerating -- pointing to the fact that we know techniques to do it, and we have been doing it (obviously manually before computers) for millennia. >How does a computer know that searching "Wawa" means you want the store and not the town? You haven't even considered that. I did, and I mention it in 2 places in my response above: they could either sort all by distance and display what each entry is next to it (e.g. town, store, etc), or give sorted lists for different types of results (e.g. locations vs businesses). >And a really good system would clearly takes a load of things you're not considering into account, relevance, rank, personal relevance, historical relevance age, etc. Whatever the above system "took into account" it failed. And it's a case that's common to 99% of the population (search for a business). Searching for a location is another 99% common case. Historical relevance and age? Who cares besides tourists (and even them, when they're not searching for a location or a business but for sightseeing)? A system should have sane defaults and hide those other things under user enabled search/sort criteria.