bahnzumberg / zuugle-api

Public repositority for backend components of www.zuugle.at
https://www.zuugle.at
GNU General Public License v3.0
2 stars 3 forks source link

Result ordering by language is not working #117

Closed martinheppner closed 2 months ago

martinheppner commented 3 months ago

Opening https://www.zuugle.si/suche?city=ljubljana&map=true shows me at first german tours.

Image

When I execute the SQL below I see that 2.278 tours are reachable from Ljubljana (column text_lang = sl ), which should be the first results. This is why we did the UNION SQLs, to maintain the language order. Something might be broken (since the map)?

SELECT 
COUNT(*),
t.text_lang
FROM fahrplan AS f
INNER JOIN tour AS t
ON t.hashed_url=f.hashed_url
WHERE f.city_slug='ljubljana'
GROUP BY t.text_lang
diditrummer commented 3 months ago

We have checked the code. Following two remarks:

  1. When no search term is given the language of the tour seems to play no role in the ordering. Are you really sure that we had once this feature that without a search term the selected language determins which tours come first?
  2. Even when there is a search term the selected language is not "forced" to be on top. The search term needs to fit quite well to make a difference.

We want to talk to you about your expectations...

martinheppner commented 2 months ago

Completely new search SQL - one for all usecases. Very fast.