Search code examples
lucenemusicbrainz

MusicBrainz API search provides different results from web page


I'm trying to work with MusicBrainz's API but I'm having some issues with the results of the search endpoint.

Let's have an example searching for Who's Who? - SIZE020 - Klack (Mix Two)

Searching from their site leads to this page, with an almost correct first result (probably because the 100% correct infos are not on the database at all).

Using the API leads to different situations which are causing some issues. I made some different attempts with no success, even if I think I know enough of Lucene's syntax to write a successful query for this service.

  • Take 1 - empty results with the query "Who's Who? - SIZE020 - Klack (Mix Two)"
  • Take 2 - completely wrong results with the query Who's+Who%3F+-+SIZE020+-+Klack+(Mix+Two) (same result with the unescaped ? character)
  • Take 3 - empty results with the query "Who's" AND "Who?" AND "SIZE020" AND "Klack" AND "Mix" AND "Two"

Now, I know that SIZE020 shouldn't be in the query, but I don't want to deal with file names on client side so I'm just pushing the query to their service hoping that everything will work. And it works, but only if I query the service through their website, making me think that my query syntax is wrong and leaving me clueless.

Do you have any hint on why I get different results between website and xml API?

EDIT: as a side question, given a random file name, what's the better way to submit the query? I'm getting good result using the web version and submitting the typical mp3 filenames (like artist_-_title_(version).mp3 but I'm not getting anything good from my client.


Solution

  • Searching via the web service always uses the "indexed search with advanced query syntax" search method, this can't be changed.