Topic: Adding quotes.. when is needed?

Here are 2 examples:

http://musicbrainz.org/ws/2/release-group/?query=artist:%22Guns%20N'%20Roses%22+AND+type:album+AND+status:official

http://musicbrainz.org/ws/2/release-gro … ruction%22

As we can see, only the first query return something (which is more accurate because search the entire phrase).

The second query return 0 unless I remove the quote. I wonder if is possible to do a query for rel-group taking the whole phrase (e.g. "Kill 'Em All")

Re: Adding quotes.. when is needed?

Well the 2nd query isn't really correct. Since you're already querying the release group resource, you don't need to specific release-group as the title of the queried resource is essentially the default term:

http://musicbrainz.org/ws/2/release-gro … ruction%22

Quotes mean that the whole string is treated as one fixed search term. Without quotes each word is queried independently and then possible matches are scored. Note that if you remove the quotes in the above, you will get many more possible matches.

WS "query=" searches are analogous to doing advanced query indexed searches via the website, e.g. http://musicbrainz.org/search?query=%22 … d=advanced

They both go via the Lucene search server, rather than custom web service or server search code. The syntax and queryable fields are documented at http://musicbrainz.org/doc/Indexed_Search_Syntax

Re: Adding quotes.. when is needed?

zenon wrote:

The second query return 0 unless I remove the quote.

The reason this happens is that when you remove the quote it does a search, essentially, for

release-group:Appetite
OR
"for"
OR
"destruction"

Since "release-group" is not a valid field for a release-group resource, it is ignored. So you're getting the same results as
http://musicbrainz.org/ws/2/release-gro … estruction

Re: Adding quotes.. when is needed?

Very explicative, as always !

Thank you :-)