Indexed Search Syntax

This page describes the syntax for MusicBrainz indexed searches which use the Lucene text search engine. The search indexes for these types of searches are updated every 3 hours, and thus may not reflect up to the minute changes. The direct search searches the database directly: it can only carry out simple keyword searches with no boolean logic, but it is always up-to-date.

Overview

Lucene offers much flexibility in defining search queries for all needs imaginable. To make it easier to understand, this page was divided into subpages. While this one offers an introduction to the most commonly used features, the others explain more advanced search operators and constructs.

First some words on the the terminology used in these pages:

Query
A query is the complete expression you put in one of the search fields.
Term
A term is the smallest unit inside a query. In the default case each single word inside a query is a term of its own, except for ...
Phrases
A phrase is a groups of words surrounded by quotation marks. Even though it's containing more than one word, a phrase is handled like a term.
Operators
or search operators are special characters and words that define either how single terms are processed by the search system (e.g. in -house the - tells the search system, not to return anything with the word house) or how to terms are to be combined in the search (e.g. one AND love means search for anything that has both words one and love).

The sections below Query Syntax describe simple and commonly used operators, more advanced features can be found in the Lucene Search Syntax

But first take a look at a few simple examples which might show everything necessary for the majority of your searches.

Notes

  • It is not possible to search for an album based on its track length, however, it is possible to search via total number of tracks.

Example searches

Artists

"tori amos"
  • search artist, sortname and alias fields
comment:electronic
  • search for the word electronic in artist disambiguation (comment) fields
begin:1984 AND type:group
  • search for all groups formed in 1984

Releases

café del mar
  • search for all Café del Mar albums
"the understanding" AND artist:royksopp
  • search for the album The Understanding by the artist Röyksopp
date:1999 AND country:de AND rock
  • search for releases from Germany in 1999 with the word rock in them

Recordings

type:album AND amadeus
  • search for recordings with the title amadeus from albums
day life
  • will retrieve A Day In The Life
  • will retrieve Life In A Day
  • will retrieve This Day
  • will retrieve That's Life
day AND life
  • will retrieve A Day In The Life
  • will retrieve Life In A Day
  • will not retrieve This Day
  • will not retrieve That's Life
"day in the life"
  • will retrieve A Day In The Life
  • will not retrieve Life In A Day
  • will not retrieve This Day
  • will not retrieve That's Life
"voodoo people" AND artist:"the prodigy"
  • search for all recordings with the title Voodoo People by the artist The Prodigy

Query syntax

Wildcards

To perform a single character wildcard search use the "?" symbol. To perform a multiple character wildcard search use the "*" symbol. For example, to search for "text" or "test" you can use the search te?t, to search for "test", "tests" or "tester", you can use the search test*.

Note: You cannot use a * or ? symbol as the first character of a search.

Fuzzy searches

To do a fuzzy search use the tilde, "~", symbol at the end of a single word term. Optionally can specify the required similarity, a value is between 0 and 1. For example to search for a term similar in spelling to "roam" use the fuzzy search roam~ or roam~0.8

MusicBrainz-specific search fields

Artist

Search Fields

The artist index contains the following fields you can search:

FieldDescription
aliasan alias attached to the artist
areathe artist's main associated area
aridthe artist's MBID
artistthe artist's name (without accented characters)
artistaccentthe artist's name (with accented characters)
beginthe artist's begin date
beginareathe artist's begin area
commentthe artist's disambiguation comment
countrythe 2-letter code (ISO 3166-1 alpha-2) for the artist's main associated country, or “unknown”
endthe artist's end date
endareathe artist's end area
endeda flag indicating whether or not the artist has ended
genderthe artist's gender (“male”, “female”, or “other”)
ipian IPI code associated with the artist
sortnamethe artist's sort name
taga tag attached to the artist
typethe artist's type (“person”, “group”, ...)

Artist search terms with no fields specified search the artist, sortname and alias fields.

Release Group

Search Fields

The release group index contains the following fields you can search:

FieldDescription
aridMBID of the release group’s artist
artistrelease group artist as it appears on the cover (Artist Credit)
artistname“real name” of any artist that is included in the release group’s artist credit
commentrelease group comment to differentiate similar release groups
creditnamename of any artist in multi-artist credits, as it appears on the cover.
primarytypeprimary type of the release group (album, single, ep, other)
rgidMBID of the release group
releasegroupname of the release group
releasegroupaccentname of the releasegroup with any accent characters retained
releasesnumber of releases in this release group
releasename of a release that appears in the release group
reidMBID of a release that appears in the release group
secondarytypesecondary type of the release group (audiobook, compilation, interview, live, remix soundtrack, spokenword)
statusstatus of a release that appears within the release group
taga tag that appears on the release group
typetype of the release group, old type mapping for when we did not have separate primary and secondary types

Release group search terms with no fields search the releasegroup field only.

Release

Search Fields

The release index contains these fields you can search:

fieldDescription
aridartist id
artistcomplete artist name(s) as it appears on the release
artistnamean artist on the release, each artist added as a separate field
asinthe Amazon ASIN for this release
barcodeThe barcode of this release
catnoThe catalog number for this release, can have multiples when major using an imprint
commentDisambiguation comment
countryThe two letter country code for the release country
creditnamename credit on the release, each artist added as a separate field
dateThe release date (format: YYYY-MM-DD)
discidstotal number of cd ids over all mediums for the release
discidsmediumnumber of cd ids for the release on a medium in the release
formatrelease format
laidThe label id for this release, a release can have multiples when major using an imprint
labelThe name of the label for this release, can have multiples when major using an imprint
langThe language for this release. Use the three character ISO 639-3 codes to search for a specific language. (e.g. lang:eng)
mediumsnumber of mediums in the release
primarytypeprimary type of the release group (album, single, ep, other)
puidThe release contains recordings with these puids
qualityThe quality of the release (low, normal, high)
reidrelease id
releaserelease name
releaseaccentname of the release with any accent characters retained
rgidrelease group id
scriptThe 4 character script code (e.g. latn) used for this release
secondarytypesecondary type of the release group (audiobook, compilation, interview, live, remix, soundtrack, spokenword)
statusrelease status (e.g official)
taga tag that appears on the release
trackstotal number of tracks over all mediums on the release
tracksmediumnumber of tracks on a medium in the release
typetype of the release group, old type mapping for when we did not have separate primary and secondary types

Release search terms with no fields search the release field only.

Recording

Search Fields

The recording index contains the following fields you can search:

fieldDescription
aridartist id
artistartist name is name(s) as it appears on the recording
artistnamean artist on the recording, each artist added as a separate field
creditnamename credit on the recording, each artist added as a separate field
commentrecording disambiguation comment
countryrecording release country
daterecording release date
durduration of track in milliseconds
formatrecording release format
isrcISRC of recording
numberfree text track number
positionthe medium that the recording should be found on, first medium is position 1
primarytypeprimary type of the release group (album, single, ep, other)
qdurquantized duration (duration / 2000)
recordingname of recording or a track associated with the recording
recordingaccentname of the recording with any accent characters retained
reidrelease id
releaserelease name
rgidrelease group id
ridrecording id
secondarytypesecondary type of the release group (audiobook, compilation, interview, live, remix soundtrack, spokenword)
statusRelease status (official, promotion, Bootleg, Pseudo-Release)
tidtrack id
tnumtrack number on medium
tracksnumber of tracks in the medium on release
tracksreleasenumber of tracks on release as a whole
tagfolksonomy tag
typetype of the release group, old type mapping for when we did not have separate primary and secondary types or use standalone for standalone recordings
videotrue to only show video tracks

Recording search terms with no fields search the recording field only

Label

Search Fields

The label index contains the following fields you can search:

FieldDescription
aliasthe aliases/misspellings for this label
arealabel area
beginlabel founding date
codelabel code (only the figures part, i.e. without "LC")
commentlabel comment to differentiate similar labels
countryThe two letter country code of the label country
endlabel dissolution date
endedtrue if know ended even if do not know end date
ipiipi
labellabel name
labelaccentname of the label with any accent characters retained
laidMBID of the label
sortnamelabel sortname
typelabel type
tagfolksonomy tag

Label search terms with no fields specified search the label, sortname and alias fields.

Work

Search Fields

The work index contains these fields you can search:

fieldDescription
aliasthe aliases/misspellings for this work
aridartist id
artistartist name, an artist in the context of a work is an artist-work relation such as composer or lyricist
commentdisambiguation comment
iswcISWC of work
langLyrics language of work
tagfolksonomy tag
typework type
widwork id
workname of work
workaccentname of the work with any accent characters retained

Work search terms with no fields specified search the work and alias fields.

Annotations

Search Fields

The annotation index contains the following fields you can search:

FieldDescription
namethe annotated entity's name or title
entitythe annotated entity's MBID
textthe annotation's content (includes wiki formatting)
typethe annotated entity's entity type

Query terms without a field specifier will search the name, text and type fields.

FreeDB Releases

CD Stubs

Search Fields

The CD stub index contains the following fields you can search:

FieldDescription
artistthe artist name set on the CD stub
barcodethe barcode set on the CD stub
commentthe comment set on the CD stub
discidthe CD stub's Disc ID
titlethe release title set on the CD stub
tracksthe CD stub's number of tracks

Query terms without a field specifier will search the artist and title fields.