How to find the most popular songs to dance to

The core mission of music4dance.net is to help you find music to dance to, whether you’re a ballroom dancer, social dancer, or really any kind of dancer. Sometimes I look at the site and say, “This could be better.” Or “Here’s a place that I’ve wanted to improve for a while but couldn’t figure out how; maybe I should try something different.” I had an “aha” moment when I was going through the site for my annual Holiday Music post. I’ve been frustrated that many of the lists of songs on music4dance.net default to some nearly random order that tended to put songs on top that only one or two people had voted for. In the Holiday Music catalog, if you choose a specific dance (like Foxtrot), the list is sorted by the number of votes for that dance. But that wasn’t true of the main list, and there wasn’t an obvious way to sort that list by dance votes.

So I took a step back to think about the general problem of getting the songs with the most dance votes to the top of lists and search results and started digging into the corner cases, which is generally where I get stuck on this kind of problem. For song sorting, I was particularly worried about an issue that a customer brought up when I first implemented the general search like google feature that enabled full-text search. In that case, I was sorting by most recent by default, and when the customer tried to do a full-text search, the song he was looking for ended up on the second page of results because there were a bunch of songs that matched his search less well but had been added more recently.

After thinking about this for a while and looking through search history, I concluded that there are two main ways people search for songs to dance to on music4dance.net. The most common search is for a specific song or artist, in which case you want the song you’re searching for to end up as close to the top of the list as possible, whether or not it is highly rated. The other way is to build lists to browse or create playlists from. In these cases, having the most popular songs at the top makes sense (unless you’ve specified something else like tempo).

Given the above, I’m more explicitly handling the case where you don’t specify a sort order as a special “default” case. If you search for specific text, I assume that’s the most important part of your search, and I sort by most relevant to the text part of the search. This part should take care of the customer I  mentioned above and folks doing that kind of search. In all other cases, I’ll sort by dance votes. You can, of course, always use the Advanced Search page to specify a sort order to override the default.

One of the reasons that I didn’t do this a long time ago is that there are some other corner cases. The biggest one is that there is no way in the underlying search engine to sort on the sum of the votes for different dances. So I can sort on votes for Rumba or even votes on Rumba, then votes for Cha Cha, but I can’t sort by the sum of the votes for Rumba and Cha Cha or even on the most total votes. I still haven’t fully solved this problem, but I have reduced it to a corner case that I believe is a better compromise than the random sort I started with.

I added a new sortable field in the database representing the sum of all dance votes on each song. With the new field, when looking at the default song list you see when you go to the Song Library, you’ll see the most popular songs on the first page. That also helps pages like the main Holiday Dance Music page, where you’ll also see the most popular songs first. The dance-specific pages were already sorted by dance votes for the Holiday, Broadway, and Halloween pages but not for the main dance lists (e.g., East Coast Swing Songs). That’s now fixed.

Unfortunately, in cases where you search for multiple dance styles, I can’t sort by the sum of the votes of those styles. Instead, I sort by each dance style vote in the order you specified them. So, if you search for all songs with Rumba, Bolero, and Cha Cha votes, you’ll get a list starting with the songs with the most votes for Rumba, then Bolero, and finally by Cha Cha votes. It’s not a perfect solution, but I think it’s still an improvement over the previous random ordering in these cases. What do you think?

Following the line of reasoning that started this post, I’m sure there are things that aren’t quite working for many of you when searching on music4dance. Please let me know. Sometimes, I just need to see the problem to come up with a fix. That’s especially true if you’re using the site in a way I didn’t expect, so even if everything is working smoothly, I’d love to hear how it’s helping you.

In addition to the specific ask above, I’m always happy to hear ideas about this post or the site by commenting below or using other feedback mechanisms listed here. And if you enjoy the site or the blog (or both), please consider contributing in whatever way makes sense for you.

One thought on “How to find the most popular songs to dance to”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.