Searching by Release Date

api
search
Tags: #<Tag:0x00007f2a05c82248> #<Tag:0x00007f2a05c82090>

#1

When searching releases by specific Release Date, the search engine returns releases where exact release date is unknown. For example, searching by “2019-01-10” returns releases with release date “2019” or “2019-01”. Is there any way to exclude such records from search results? Because of this issue my application has to process much more records than necessary.

Example of query:
https://musicbrainz.org/search?query=date%3A2019-01-10&type=release&limit=25&method=advanced

Same for Search API:
http://musicbrainz.org/ws/2/release/?query=date:2019-01-10


#2

Unfortunately, there is no way to exclude such records from search results for now.


#3

What exactly is it doing because although

http://musicbrainz.org/ws/2/release/?query=date:2019-01-10

returns some dates just set to 2019, it only returns 106 results whereas

http://musicbrainz.org/ws/2/release/?query=date:2019-01

returns 1679 results

and

http://musicbrainz.org/ws/2/release/?query=date:2019

returns 2135 results !


#4

This is because MusicBrainz supports partial dates. For example:

  • A release with date 2019-01 has actually been released at some day of January 2019.

Search returns every release with date that potentially matches the requested date. Thus:

  • Query date:2019-01-10 returns every release with date among:
    • 2019-01-10,
    • 2019-01,
    • 2019;
  • Query date:2019-01 returns every release with date among:
    • 2019-01-DD (any day of 2019-01),
    • 2019-01,
    • 2019;
  • Query date:2019 returns every release with date among:
    • 2019-MM-DD (any day of 2019),
    • 2019-MM (any month of 2019),
    • 2019;

But there is no other comparison operator for the field date at the moment. That should certainly be added to the search engine.


#5

Thanks, ok got it but its definently counter intuitive. So if you enter 2019-01-10 and it will return 2019-01-10 and 2019-01 but not 2019-01-11.

I don’t know if it is designed on purpose to support partial dates but it should not, it makes no sense. Of course the other way round is okay, if you just enter 2019 it should indeed return any date that includes 2019.


#6

It’s interesting that in the previous version of the search engine it worked as expected - it was returning only exact matches when searching by full date. The current behavior turned up after migrating to the new version of the search engine in July 2018. I agree with ijabz that current behavior is counter intuitive.

From practical point of view, when my application wants to retrieve all releases issued on specific date of 2018, it has to make 18-20 requests to retrieve 1800-2000 records (one request can’t return more than 100 records) where most of the records are irrelevant and useless. Previously it had to make only 2 or 3 requests.