Closed shrddr closed 10 years ago
when searching for something like this: $brainz->search(new ReleaseFilter(array("artist" => "John Scofield")));
there are lots of weird results by artists "John John", "John St. John", "DJ John John", etc.
that's because the query is: http://musicbrainz.org/ws/2/release/?fmt=json&query=artist:John%20Scofield
which according to Lucene query syntax performs a search for 'artist:John OR release:Scofield'. that's totally unexpected and is not indicated in any way by ReleaseFilter syntax.
in order to get reasonable search results parameters should be double quoted: (http://musicbrainz.org/ws/2/release/?fmt=json&query=artist:"John%20Scofield")
alternatively, it can be achieved by appending field name to every word: http://musicbrainz.org/ws/2/release/?fmt=json&query=artist:John%20AND%20artist:Scofield
This has been fixed in the develop branch. https://github.com/mikealmond/MusicBrainz/blob/develop/src/MusicBrainz/Filters/AbstractFilter.php#L67-72
develop
Merged into master
master
when searching for something like this: $brainz->search(new ReleaseFilter(array("artist" => "John Scofield")));
there are lots of weird results by artists "John John", "John St. John", "DJ John John", etc.
that's because the query is: http://musicbrainz.org/ws/2/release/?fmt=json&query=artist:John%20Scofield
which according to Lucene query syntax performs a search for 'artist:John OR release:Scofield'. that's totally unexpected and is not indicated in any way by ReleaseFilter syntax.
in order to get reasonable search results parameters should be double quoted: (http://musicbrainz.org/ws/2/release/?fmt=json&query=artist:"John%20Scofield")
alternatively, it can be achieved by appending field name to every word: http://musicbrainz.org/ws/2/release/?fmt=json&query=artist:John%20AND%20artist:Scofield