Indexed Search Syntax
| Home |
| Help? |
| Discuss |
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.
Contents |
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:
| Field | Description |
|---|---|
| arid | MBID of the artist |
| artist | name of the artist |
| artistaccent | name of the artist with any accent characters retained |
| alias | the aliases/misspellings for the artist |
| begin | artist birth date/band founding date |
| comment | artist comment to differentiate similar artists |
| country | the two letter country code for the artist country or 'unknown' |
| end | artist death date/band dissolution date |
| ended | true if know ended even if do not know end date |
| gender | gender of the artist (“male”, “female”, “other”) |
| ipi | IPI code for the artist |
| sortname | artist sortname |
| tag | a tag applied to the artist |
| type | artist type (“person”, “group”, "other" or “unknown”) |
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:
| Field | Description |
|---|---|
| arid | MBID of the release group’s artist |
| artist | release 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 |
| comment | release group comment to differentiate similar release groups |
| creditname | name of any artist in multi-artist credits, as it appears on the cover. |
| primarytype | primary type of the release group (album, single, ep, other) |
| rgid | MBID of the release group |
| releasegroup | name of the release group |
| releasegroupaccent | name of the releasegroup with any accent characters retained |
| releases | number of releases in this release group |
| release | name of a release that appears in the release group |
| reid | MBID of a release that appears in the release group |
| secondarytype | secondary type of the release group (audiobook, compilation, interview, live, remix soundtrack, spokenword) |
| status | status of a release that appears within the release group |
| tag | a tag that appears on the release group |
| type | type 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:
| field | Description |
| arid | artist id |
| artist | complete artist name(s) as it appears on the release |
| artistname | an artist on the release, each artist added as a seperate field |
| asin | the Amazon ASIN for this release |
| barcode | The barcode of this release |
| catno | The catalog number for this release, can have multiples when major using an imprint |
| comment | Disambiguation comment |
| country | The two letter country code for the release country |
| creditname | name credit on the release, each artist added as a seperate field |
| date | The release date (format: YYYY-MM-DD) |
| discids | total number of cd ids over all mediums for the release |
| discidsmedium | number of cd ids for the release on a medium in the release |
| format | release format |
| label | The name of the label for this release, can have multiples when major using an imprint |
| lang | The language for this release. Use the three character ISO 639 codes to search for a specific language. (e.g. lang:eng) |
| mediums | number of mediums in the release |
| primarytype | primary type of the release group (album, single, ep, other) |
| puid | The release contains recordings with these puids |
| reid | release id |
| release | release name |
| releaseaccent | name of the release with any accent characters retained |
| rgid | release group id |
| script | The 4 character script code (e.g. latn) used for this release |
| secondarytype | secondary type of the release group (audiobook, compilation, interview, live, remix soundtrack, spokenword) |
| status | release status (e.g official) |
| tracks | total number of tracks over all mediums on the release |
| tracksmedium | number of tracks on a medium in the release |
| type | type 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
Recording searches can contain you can search:
| field | Description |
| arid | artist id |
| artist | artist name is name(s) as it appears on the recording |
| artistname | an artist on the recording, each artist added as a seperate field |
| creditname | name credit on the recording, each artist added as a seperate field |
| comment | recording disambuguation comment |
| country | recording release country |
| date | recording release date |
| dur | duration of track in milliseconds |
| format | recording release format |
| isrc | ISRC of recording |
| number | free text track number |
| position | the medium that the recording should be found on, first medium is position 1 |
| primarytype | primary type of the release group (album, single, ep, other) |
| puid | PUID of recording |
| qdur | quantized duration (duration / 2000) |
| recording | name of recording or a track associated with the recording |
| recordingaccent | name of the recording with any accent characters retained |
| reid | release id |
| release | release name |
| rgid | release group id |
| rid | recording id |
| secondarytype | secondary type of the release group (audiobook, compilation, interview, live, remix soundtrack, spokenword) |
| status | Release status (official, promotion, Bootleg, Pseudo-Release) |
| tnum | track number on medium |
| tracks | number of tracks in the medium on release |
| tracksrelease | number of tracks on release as a whole |
| tag | folksonomy tag |
| type | type of the release group, old type mapping for when we did not have separate primary and secondary types |
Recording search terms with no fields search the recording field only
Label
Search Fields
The label index contains the following fields you can search:
| field | Description |
| alias | the aliases/misspellings for this label |
| begin | label founding date |
| code | label code (only the figures part, i.e. without "LC") |
| comment | label comment to differentiate similar labels |
| country | The two letter country code of the label country |
| end | label dissolution date |
| ended | true if know ended even if do not know end date |
| ipi | ipi |
| label | label name |
| labelaccent | name of the label with any accent characters retained |
| sortname | label sortname |
| type | label type |
| tag | folksonomy 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:
| field | Description |
| alias | the aliases/misspellings for this work |
| arid | artist id |
| artist | artist name, an atist in the context of a work is an artist-work relation such as composer or performer |
| comment | disambuguation comment |
| iswc | ISWC of work |
| lang | Lyrics language of work |
| tag | folksonomy tag |
| type | work type |
| wid | work id |
| work | name of work |
| workaccent | name 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:
| Field | Description |
|---|---|
| text | The content of the annotation |
| type | The entity type (artist, releasegroup, release, recording, work, label) |
| name | The name of the entity |
| entity | The entity's MBID |
FreeDB Releases
Search Fields
The FreeDB index contains the following fields you can search:
| Field | Description |
|---|---|
| artist | artist name |
| title | release name |
| discid | FreeDB disc id |
| cat | FreeDB category |
| year | year |
| tracks | number of tracks in the release |
CD Stubs
Search Fields
The CD Stub index contains the following fields you can search:
| Field | Description |
|---|---|
| artist | artist name |
| title | release name |
| barcode | release barcode |
| comment | general comments about the release |
| tracks | number of tracks on the CD stub |
| discid | disc ID of the CD |