Products > Database > DatabaseDocumentation > DatabaseSchema > Search Tables
Database Schema: Search Tables
See the Database Schema page for an overview of the MusicBrainz Database and links to pages which describe each parts of the schema in more detail (like this page).
Each of the search indexes for artists, releases and tracks works exactly the same way (err, almost. See below). We will just consider tracks for now, to keep things simple. The name of track is read in and "tokenized" - broadly speaking this means that it has its accents removed, is converted to lower case, then split up into separate words.
To store a single track's name in the search index, each word is either looked up in the wordlist table, or it is added there. Then a row is added to the trackwords table for each word in the tokenized name.
Releases are dealt with in exactly the same way as tracks. Artists are only fractionally different, in that the aliases for each artist are indexed too. (The words used in the alias link back to the main artist record).
Finally, from time to time (currently it's once a week) the number of times each word (in wordlist) is used by artists, releases, and tracks is counted, and the results stored in the artistusecount, albumusecount and trackusecount columns. This is used to optimize the search function, by looking for the less common words first, then successively filtering on the more common words.
CategoryWikiDocsPage CategoryDevelopment







