pyvideo / pyvideo

A Python media index
https://pyvideo.org
GNU General Public License v3.0
251 stars 80 forks source link

Search results link to a 404 page video #218

Closed treyhunner closed 1 year ago

treyhunner commented 5 years ago

The first result here links to a URL which doesn't resolve: https://pyvideo.org/search.html?q=unicode+python+2+better+python+3

treyhunner commented 5 years ago

This may be related to #214

jonafato commented 1 year ago

97 is also related, although this appears to be an issue with the way the search service is generating links, whereas #97 is due to search using a commit from the data repository ahead of the one used by the static site generator.

zerok commented 1 year ago

Looks like the slugging algorithms for the website and the search indexer. Both are to some degree using the title stored within the video JSON files but the unicode handling is completely different. I'll check if I can find a different approach here where the unicode-handling is closer to the one for the static pages

zerok commented 1 year ago

I'm now deploying a fix for the first issue. Need to rebuild the index so there's going to be a short downtime.

jonafato commented 1 year ago

@zerok the site generator is using unidecode to handle this translation. Would it be possible to use a similar go library to avoid the need to make these sorts of one-off substitutions? I have not used https://github.com/mozillazg/go-unidecode, but it claims to be inspired by the Python library, so I imagine that it would be at least largely compatible in its behavior.

zerok commented 1 year ago

Yes, that would definitely an option. I'd suggest we wait with that change, though, until another concrete issue appears.

jonafato commented 1 year ago

You can find a bunch of similar issues by searching e.g. "PyCon JP" or "Moscow Python Conf", where much of the talk titles are being removed from the search result URL completely (vs. the links that are displayed from the event pages for these conferences).

zerok commented 1 year ago

Ah, good to know :) Then I will collect a handful of testcases and proceed from there :)

jonafato commented 1 year ago

Thanks!

zerok commented 1 year ago

JP and Moscow links look better now. Slugging still doesn't work in exactly the same way but I think we're getting closer. If you stumble upon a broken link in the index, please create a ticket for that and I will tune the function some more :)