Tatoeba / tatoeba2

Tatoeba is a platform whose purpose is to create a collaborative and open dataset of sentences and their translations.
https://tatoeba.org
GNU Affero General Public License v3.0
714 stars 132 forks source link

Allow searching through favorites #3074

Closed jiru closed 1 year ago

jiru commented 1 year ago

This PR solves #1069 in a simple way.

jiru commented 1 year ago

This PR uses SQL LIKE operator on sentence text, which is not supposed to perform very good, so I did some measurements on dev.tatoeba.org on a user having 450k+ favorites. It turns out the full scan only takes 0.8 to 0.9 seconds, so I think this is acceptable for a worst-case scenario. Among all members having favorites on Tatoeba now, 99.26% of them have less than 1000 favorites anyway.