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 in near real time. 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.
  • Any search for a specific date will currently also return any results that match the year or year and month alone. For example, a search for "1980-01-22" will also return all matches for "1980-01" and "1980". This is a known issue reported as SEARCH-634.

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

Regular expressions

You can use regular expressions in your searches. For that you should put the expression between forward slashes (/regex/). Regular expression search generally searches only inside each token (word), so you cannot search for combinations of words as a regular expression. For an example, to find releases credited to either of the two common transliterations of Сергей Рахманинов, "Rachmaninov" and "Rachmaninoff", you can pass artist:/Rachmanino(ff|v)/ to the release search.

MusicBrainz-specific search fields

Area

Search Fields

The Area index contains the following fields you can search

FieldDescription
aidthe area's MBID
alias(part of) any alias attached to the artist (diacritics are ignored)
area(part of) the area's name (diacritics are ignored)
areaaccent(part of) the area's name (with the specified diacritics)
beginthe area's begin date (e.g. "1980-01-22")
comment(part of) the area's disambiguation comment
endthe area's end date (e.g. "1980-01-22")
endeda boolean flag (true/false) indicating whether or not the area has ended (is no longer current)
isoan ISO 3166-1, 3166-2 or 3166-3 code attached to the area
iso1an ISO 3166-1 code attached to the area
iso2an ISO 3166-2 code attached to the area
iso3an ISO 3166-3 code attached to the area
sortnameequivalent to name (areas no longer have separate sort names)
tag(part of) a tag attached to the area
typethe area's type

If you don't specify a field, the terms will be searched for in the area field.

Artist

Search Fields

The Artist index contains the following fields you can search

FieldDescription
alias(part of) any alias attached to the artist (diacritics are ignored)
primary_alias(part of) any primary alias attached to the artist (diacritics are ignored)
area(part of) the name of the artist's main associated area
aridthe artist's MBID
artist(part of) the artist's name (diacritics are ignored)
artistaccent(part of) the artist's name (with the specified diacritics)
beginthe artist's begin date (e.g. "1980-01-22")
beginarea(part of) the name of the artist's begin area
comment(part of) the artist's disambiguation comment
countrythe 2-letter code (ISO 3166-1 alpha-2) for the artist's main associated country
endthe artist's end date (e.g. "1980-01-22")
endarea(part of) the name of the artist's end area
endeda boolean flag (true/false) indicating whether or not the artist has ended (is dissolved/deceased)
genderthe artist's gender (“male”, “female”, “other” or “not applicable”)
ipian IPI code associated with the artist
isnian ISNI code associated with the artist
sortname(part of) the artist's sort name
tag(part of) a tag attached to the artist
typethe artist's type (“person”, “group”, etc.)

If you don't specify a field, the terms will be searched for in the alias, artist and sortname fields.

Event

Search Fields

The Event index contains the following fields you can search

FieldDescription
alias(part of) any alias attached to the artist (diacritics are ignored)
aidthe MBID of an area related to the event
area(part of) the name of an area related to the event
aridthe MBID of an artist related to the event
artist(part of) the name of an artist related to the event
beginthe event's begin date (e.g. "1980-01-22")
comment(part of) the artist's disambiguation comment
endthe event's end date (e.g. "1980-01-22")
endeda boolean flag (true/false) indicating whether or not the event has an end date set
eidthe MBID of the event
event(part of) the event's name (diacritics are ignored)
eventaccent(part of) the event's name (with the specified diacritics)
pidthe MBID of a place related to the event
place(part of) the name of a place related to the event
tag(part of) a tag attached to the event
typethe event's type

If you don't specify a field, the terms will be searched for in the alias, artist and event fields.

Instrument

Search Fields

The instrument index contains these fields you can search:

FieldDescription
alias(part of) any alias attached to the instrument (diacritics are ignored)
comment(part of) the instrument's disambiguation comment
description(part of) the description of the instrument (in English)
iidthe MBID of the instrument
instrument(part of) the instrument's name (diacritics are ignored)
instrumentaccent(part of) the instrument's name (with the specified diacritics)
tag(part of) a tag attached to the instrument
typethe instrument's type

If you don't specify a field, the terms will be searched for in the alias, description and instrument fields.

Label

Search Fields

The Label index contains the following fields you can search

FieldDescription
alias(part of) any alias attached to the label (diacritics are ignored)
area(part of) the name of the label's main associated area
beginthe label's begin date (e.g. "1980-01-22")
codethe label code for the label (only the numbers, without "LC")
comment(part of) the label's disambiguation comment
countrythe 2-letter code (ISO 3166-1 alpha-2) for the label's associated country
endthe label's end date (e.g. "1980-01-22")
endeda boolean flag (true/false) indicating whether or not the label has ended (is dissolved)
ipian IPI code associated with the label
isnian ISNI code associated with the label
label(part of) the label's name (diacritics are ignored)
labelaccent(part of) the label's name (with the specified diacritics)
laidthe label's MBID
release_countthe amount of releases related to the label
sortnameequivalent to name (labels no longer have separate sort names)
tag(part of) a tag attached to the label
typethe label's type

If you don't specify a field, the terms will be searched for in the alias and label fields.

Place

Search Fields

The Place index contains the following fields you can search

FieldDescription
address(part of) the physical address for this place
alias(part of) any alias attached to the place (diacritics are ignored)
area(part of) the name of the place's main associated area
beginthe place's begin date (e.g. "1980-01-22")
comment(part of) the place's disambiguation comment
endthe place's end date (e.g. "1980-01-22")
endeda boolean flag (true/false) indicating whether or not the place has ended (is closed)
latthe (WGS 84) latitude of the place's coordinates (e.g. "58.388226")
longthe (WGS 84) longitude of the place's coordinates (e.g. "26.702817")
place(part of) the place's name (diacritics are ignored)
placeaccent(part of) the place's name (with the specified diacritics)
pidthe place's MBID
typethe place's type


If you don't specify a field, the terms will be searched for in the address, alias, area and place fields.

Recording

Search Fields

The Recording index contains the following fields you can search

FieldDescription
alias(part of) any alias attached to the recording (diacritics are ignored)
aridthe MBID of any of the recording artists
artist(part of) the combined credited artist name for the recording, including join phrases (e.g. "Artist X feat.")
artistname(part of) the name of any of the recording artists
comment(part of) the recording's disambiguation comment
countrythe 2-letter code (ISO 3166-1 alpha-2) for the country any release of this recording was released in
creditname(part of) the credited name of any of the recording artists on this particular recording
datethe release date of any release including this recording (e.g. "1980-01-22")
durthe recording duration in milliseconds
firstreleasedatethe release date of the earliest release including this recording (e.g. "1980-01-22")
formatthe format of any medium including this recording (insensitive to case, spaces, and separators)
isrcany ISRC associated to the recording
numberthe free-text number of the track on any medium including this recording (e.g. "A4")
positionthe position inside its release of any medium including this recording (starts at 1)
primarytypethe primary type of any release group including this recording
qdurthe recording duration, quantized (duration in milliseconds / 2000)
recording(part of) the recording's name, or the name of a track connected to this recording (diacritics are ignored)
recordingaccent(part of) the recordings's name, or the name of a track connected to this recording (with the specified diacritics)
reidthe MBID of any release including this recording
release(part of) the name of any release including this recording
rgidthe MBID of any release group including this recording
ridthe recording's MBID
secondarytypeany of the secondary types of any release group including this recording
statusthe status of any release including this recording
tag(part of) a tag attached to the recording
tidthe MBID of a track connected to this recording
tnumthe position of the track on any medium including this recording (starts at 1, pre-gaps at 0)
tracksthe number of tracks on any medium including this recording
tracksreleasethe number of tracks on any release (as a whole) including this recording
typelegacy release group type field that predates the ability to set multiple types (see calculation code)
videoa boolean flag (true/false) indicating whether or not the recording is a video recording

If you don't specify a field, the terms will be searched for in the recording field.

Release

Search Fields

The Release index contains the following fields you can search

FieldDescription
alias(part of) any alias attached to the release (diacritics are ignored)
aridthe MBID of any of the release artists
artist(part of) the combined credited artist name for the release, including join phrases (e.g. "Artist X feat.")
artistname(part of) the name of any of the release artists
asinan Amazon ASIN for the release
barcodethe barcode for the release
catnoany catalog number for this release (insensitive to case, spaces, and separators)
comment(part of) the release's disambiguation comment
countrythe 2-letter code (ISO 3166-1 alpha-2) for any country the release was released in
creditname(part of) the credited name of any of the release artists on this particular release
datea release date for the release (e.g. "1980-01-22")
discidsthe total number of disc IDs attached to all mediums on the release
discidsmediumthe number of disc IDs attached to any one medium on the release
formatthe format of any medium in the release (insensitive to case, spaces, and separators)
laidthe MBID of any of the release labels
label(part of) the name of any of the release labels
langthe ISO 639-3 code for the release language
mediumsthe number of mediums on the release
packagingthe format of the release (insensitive to case, spaces, and separators)
primarytypethe primary type of the release group for this release
qualitythe listed quality of the data for the release (2 for “high”, 1 for “normal”; cannot search for “low” at the moment; see the related bug report)
reidthe release's MBID
release(part of) the release's title (diacritics are ignored)
releaseaccent(part of) the release's title (with the specified diacritics)
rgidthe MBID of the release group for this release
scriptthe ISO 15924 code for the release script
secondarytypeany of the secondary types of the release group for this release
statusthe status of the release
tag(part of) a tag attached to the release
tracksthe total number of tracks on the release
tracksmediumthe number of tracks on any one medium on the release
typelegacy release group type field that predates the ability to set multiple types (see calculation code)

If you don't specify a field, the terms will be searched for in the release field.

Release Group

Search Fields

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

FieldDescription
alias(part of) any alias attached to the release group (diacritics are ignored)
aridthe MBID of any of the release group artists
artist(part of) the combined credited artist name for the release group, including join phrases (e.g. "Artist X feat.")
artistname(part of) the name of any of the release group artists
comment(part of) the release group's disambiguation comment
creditname(part of) the credited name of any of the release group artists on this particular release group
firstreleasedatethe release date of the earliest release in this release group (e.g. "1980-01-22")
primarytypethe primary type of the release group
reidthe MBID of any of the releases in the release group
release(part of) the title of any of the releases in the release group
releasegroup(part of) the release group's title (diacritics are ignored)
releasegroupaccent(part of) the release group's title (with the specified diacritics)
releasesthe number of releases in the release group
rgidthe release group's MBID
secondarytypeany of the secondary types of the release group
statusthe status of any of the releases in the release group
tag(part of) a tag attached to the release group
typelegacy release group type field that predates the ability to set multiple types (see calculation code)

If you don't specify a field, the terms will be searched for in the releasegroup field.

Series

Search Fields

The Series index contains the following fields you can search

FieldDescription
alias(part of) any alias attached to the series (diacritics are ignored)
comment(part of) the series' disambiguation comment
series(part of) the series' name (diacritics are ignored)
seriesaccent(part of) the series' name (with the specified diacritics)
sidthe series' MBID
tag(part of) a tag attached to the series
typethe series' type

If you don't specify a field, the terms will be searched for in the alias and series fields.

Work

Search Fields

The Work index contains the following fields you can search

FieldDescription
alias(part of) any alias attached to the work (diacritics are ignored)
aridthe MBID of an artist related to the event (e.g. a composer or lyricist)
artist(part of) the name of an artist related to the work (e.g. a composer or lyricist)
comment(part of) the work's disambiguation comment
iswcany ISWC associated to the work
langthe ISO 639-3 code for any of the languages of the work's lyrics
recording(part of) the title of a recording related to the work
recording_countthe number of recordings related to the work
ridthe MBID of a recording related to the work
tag(part of) a tag attached to the work
typethe work's type (e.g. "opera", "song", "symphony")
widthe work's MBID
work(part of) the work's title (diacritics are ignored)
workaccent(part of) the work's title (with the specified diacritics)

If you don't specify a field, the terms will be searched for in the alias and work fields.

Annotation

Search Fields

The Annotation index contains the following fields you can search

FieldDescription
entitythe annotated entity's MBID
idthe numeric ID of the annotation (e.g. 703027)
namethe annotated entity's name or title (diacritics are ignored)
textthe annotation's content (includes wiki formatting)
typethe annotated entity's entity type

If you don't specify a field, the terms will be searched for in the name, text and type fields.

Tag

Search Fields

The tag index contains these fields you can search:

FieldDescription
tag(part of) the tag's name

CD Stub

Search Fields

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

FieldDescription
addedthe date the CD stub was added (e.g. "2020-01-22")
artist(part of) the artist name set on the CD stub
barcodethe barcode set on the CD stub
comment(part of) the comment set on the CD stub
discidthe CD stub's Disc ID
title(part of) the release title set on the CD stub
tracksthe number of tracks on the CD stub

If you don't specify a field, the terms will be searched for in the artist and title fields.

Editor

Search Fields

The Editor index contains the following fields you can search

FieldDescription
editor(part of) the editor's name
bio(part of) the editor's bio

If you don't specify a field, the terms will be searched for in the editor and bio fields.