You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that on many searches, results scoring < 100 actually contain the correct release I am looking for. Here's a snippet of the code which I am currently using to obtain the first-known-release of a recording by artist.
foreach($recordings as $recording){
// If recording score is lower than what we have now, we want 100, but have found
// 99 is acceptable in most cases to properly match on the original first recording
// for this release.
if (null != $lastScore && $lastScore < 99) {
break;
}
$lastScore = $recording->getScore();
$releaseDates = $recording->getReleaseDates();
$oldestReleaseKey = key($releaseDates);
// Only compare the year of the release so we format the date field to just the year
if( $releaseDates[$oldestReleaseKey]->format('Y') <= $firstRecording['releaseDate']->format('Y')){
$firstRecording = array(
'query' => $args,
'release' => $recording->releases[$oldestReleaseKey],
'releaseDate' => $recording->releases[$oldestReleaseKey]->getReleaseDate(),
'release-count' => count($recording->releases),
'recording' => $recording,
'artist' => $recording->getArtist(),
'recordingId' => $recording->getId(),
'trackLength' => $recording->getLength(),
'execution' => new stdClass(), // used for debugging
);
}
}
While, it's not really an issue, I thought it best to share this here. For some reason, I have found that many scores of 99 are being returned with the correct results, while scores of 100 have sometimes been returning incorrect results. By lowering the score threshold to 99, it seems to be giving me results much closer to the actual "First" recording.
The text was updated successfully, but these errors were encountered:
I've found that on many searches, results scoring < 100 actually contain the correct release I am looking for. Here's a snippet of the code which I am currently using to obtain the first-known-release of a recording by artist.
While, it's not really an issue, I thought it best to share this here. For some reason, I have found that many scores of 99 are being returned with the correct results, while scores of 100 have sometimes been returning incorrect results. By lowering the score threshold to 99, it seems to be giving me results much closer to the actual "First" recording.
The text was updated successfully, but these errors were encountered: