alastair/python-musicbrainz-ngs — pull request #45 by JonnyJD (2012-03-20 16:08:29+00:00)
Title: include search query tests, re #36, re #4

In order to conclude how we do searches, we should have some general test material to check.

There are some tests in the tests suit, but these don't test "concatenation" of various fields and/or a query string. When the search api is finishee, we can also add similar tests to the test suite

Additionally, there is no usage information for searches in the
examples.

These are the 5 main ways of searching for a release "Big in Japan"
from the artist "Guano Apes".
They currently result in these searches:

simple:

- Big in Japan artist:(Guano Apes)

(note the missing quotation marks around "Big in Japan")
same as: Big OR in OR Japan OR artist:(Guano OR Apes)
- release:(Big in Japan) artist:(Guano Apes)

same as: relase:(Big OR in OR Japan) OR artist:(Guano OR Apes)

phrase:

- "Big in Japan" artist:(Guano Apes)

same as: "Big in Japan" OR artist:(Guano OR Apes)
note that we can't use phrases for the artist, because it is stripped

direct:

- "Big in Japan" AND artist:"Guano Apes"

only results where both is the case
not even remotely possible with simple searches atm
- "Big in Japan" OR artist:"Guano Apes"

one of both is enough, but still use phrases
the phrase search above comes closetst to this one

Explicit use of AND/OR in the query should only be used when no fields are set!
We could possibly lowercase the query when fields are set.