Allow to search for tracks with artist/album hints
What is the problem you are facing?
Funkwhale's search engine doesn't permit to search in the title and on the album/artist name at the same time.
When searching for a track that only has common words (for example "Love", "You & I"), I can get tons of results. Sometimes the shorter path to finding that song is to first search for this album and go on its page, then to hit the song's "track details".
Possible solution and drawbacks
I see in the data model that Tracks have a body_text
field that tokenize the track title. Maybe it's an easy pick to add the artist's and album's name in the field?
The search can be a little slower, but if it's a real field (not a SQL JOIN), it should not be that much ifaik.
Also the field could get outdated when we change an artist or album name, but that doesn't happen a lot. I'd say that an imperfect implementation is better than none.
I saw in this issue something that seems to be close to what I'm suggesting:
What we could do to improve these results is what I've been discussing with @JuniorJPDJ privately - to create a dynamic field on the
Track
model that contains the track title, album title and artist name (all transliterated to support diacritics the 'easy way') and search it either by fuzzy matching or by words from the search query. My only concern to this approach is the performance, but I am not a back-end developer, so I can't tell if there would be a performance hit or not.