No search result for some queries

Tags: #<Tag:0x00007f2a56a317e0> #<Tag:0x00007f2a56a315b0>

Hi, while testing search APIs in my mirror server I found below:

ws/2/release-group/?query=Nevermind+AND+artist:Nirvana+AND+primarytype:album+AND+status:Official

This works well

ws/2/release-group/?query=Hot%20Fuss+AND+artist:The%20Killers+AND+primarytype:album+AND+status:Official

This does not.

Both work find on http://musicbrainz.org/ endpoint. Any clue how to fix it?

Btw,

ws/2/release-group/?query=Hot%20Fuss+AND+artist:The%20Killers

This just works.

Thanks much in advance!

You should put complete search strings innto quotes. artist:"The Killers" is a different query then "artist:The Killers. The first one does a search for artist “The Killers”, while the second one searches for an artist “The” and a general second keyword “Killers”.

This one works for me:

https://musicbrainz.org/ws/2/release-group/?query=%22Hot%20Fuss%22%20artist:%22The%20Killers%22%20primarytype:album%20status:Official&fmt=json

I left out the ANDs as I think this is the default anyway.

2 Likes

Thanks for replying. But the query without %22 works fine at:

https://musicbrainz.org/ws/2/release-group/?query=Hot%20Fuss%20artist:The%20Killers%20primarytype:album%20status:Official

Problem is the same query does not work on my mirror server.

So maybe the search index not up to date?

You should still use parentheses or quotes, because without the quotes the query is basically the same as Hot Fuss Killers+AND+artist:The, which is as I understand not what you want :wink:

The results are also different. Without the quotes it will return an album called “Killers” by “The Great Dictators” and one “Kissers and Killers” by “The Choir”. With the quotes it will only return results from “The Killers”

You should only use quotes if you want to search for exact term, though. Otherwise use parentheses to group the keywords, e.g. artist:(The Killers). This will do a keyword search for The and Killers only in the artist field.

2 Likes

Parentheses! Great tip! Thanks I’ll try. Yeah, also I may need to look search index. :slight_smile: