Indexed Search Syntax: Difference between revisions
No edit summary |
No edit summary |
||
Line 98: | Line 98: | ||
===Work=== |
===Work=== |
||
{{:XML_Web_Service/Version_2/Search/WorkSearch}} |
{{:XML_Web_Service/Version_2/Search/WorkSearch}} |
||
===Artist=== |
|||
{{:XML_Web_Service/Version_2/Search/ArtistSearch}} |
|||
===Release Groups=== |
|||
The release group index contains the following fields you can search: |
|||
{| border="1" class="wikitable sortable" |
|||
|- |
|||
!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 |
|||
|- |
|||
| creditname || name of any artist in multi-artist credits, as it appears on the cover. |
|||
|- |
|||
| rgid || MBID of the release group |
|||
|- |
|||
| releasegroup || name of the release group |
|||
|- |
|||
| releases || number of releases in this release group |
|||
|- |
|||
| type || type of the release group (album, single, ep, compilation, soundtrack, spokenword, interview, audiobook, live, remix, other) |
|||
|- |
|||
| release || name of a release that appears in the release group |
|||
|- |
|||
| reid || MBID of a release that appears in the release group |
|||
|- |
|||
| tag || a tag that appears on the release group |
|||
|- |
|||
| comment || release group comment to differentiate similar release groups |
|||
|} |
|||
===Releases=== |
|||
The release index contains these fields: |
|||
{| border="1" class="wikitable sortable" |
|||
|- |
|||
| '''field''' || '''Description''' |
|||
|- |
|||
| reid || MBID of the release |
|||
|- |
|||
| release || name of the release |
|||
|- |
|||
| arid || MBID of an artist appearing on this release |
|||
|- |
|||
| artist || name of the artist as it appears on the cover |
|||
|- |
|||
| artistname || MusicBrainz name of any artist which appears in the artist credits |
|||
|- |
|||
| creditname || name of any artist in the artist credit as it appears on the cover |
|||
|- |
|||
| type || type of the release group in which the release appears (album, single, ep, compilation, soundtrack, spokenword, interview, audiobook, live, remix, other) |
|||
|- |
|||
| status || release status (official, promotion, bootleg, pseudo-release) |
|||
|- |
|||
| format || the format of the medium (CD, DVD, Vinyl, digital media, etc.) |
|||
|- |
|||
| tracks || number of tracks in the release |
|||
|- |
|||
| tracksmedium || number of tracks on any medium of the release |
|||
|- |
|||
| mediums || number of mediums on the release |
|||
|- |
|||
| discids || number of [[Disc ID|disc IDs]] for the release |
|||
|- |
|||
| discidsmedium || number of [[Disc ID|disc IDs]] for any medium of the release |
|||
|- |
|||
| date || date for the release |
|||
|- |
|||
| asin || the Amazon ASIN for the release |
|||
|- |
|||
| lang || the language for this release. Use the [http://www.loc.gov/standards/iso639-2/php/code_list.php three character ISO 639 codes] to search for a specific language. (e.g. lang:eng) |
|||
|- |
|||
| script || the [http://unicode.org/iso15924/iso15924-codes.html 4 character script code] (e.g. latn) used for this release |
|||
|- |
|||
| country || the [http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm two letter country code] for the release country or 'unknown' |
|||
|- |
|||
| label || the name of a label for this release |
|||
|- |
|||
| laid || the MBID of a label for this release |
|||
|- |
|||
| catno || the catalog number for this release |
|||
|- |
|||
| barcode || the barcode for this release |
|||
|- |
|||
| puid || PUID of a track on the release |
|||
|- |
|||
| comment || release comment to differentiate similar release |
|||
|} |
|||
Release search terms with no fields search the ''release'' field only. |
|||
===Recordings=== |
|||
Recording searches can contain: |
|||
{| border="1" class="wikitable sortable" |
|||
|- |
|||
! Field !! Description |
|||
|- |
|||
| rid || MBID of the recording |
|||
|- |
|||
| recording || name of the recording |
|||
|- |
|||
| arid || MBID of any artist credited on the recording |
|||
|- |
|||
| artist || name of the artist as it appears on the track list |
|||
|- |
|||
| artistname || MusicBrainz name of any artist included in the Artist Credit |
|||
|- |
|||
| creditname || name of any artist as credited |
|||
|- |
|||
| reid || MBID of any release on which this recording appears |
|||
|- |
|||
| release || name of any release on which this recording appears |
|||
|- |
|||
| type || release type (album, single, ep, compilation, soundtrack, spokenword, interview, audiobook, live, remix, other, standalone) |
|||
|- |
|||
| status || release status (official, bootleg, promo, pseudo-release) |
|||
|- |
|||
| tracks || number of tracks on the medium where this recording appears |
|||
|- |
|||
| position || disc number in a multi-disc release where this recording appears |
|||
|- |
|||
| tracksrelease || total number of tracks on all mediums of the release where this track appears |
|||
|- |
|||
| dur || duration of recording in milliseconds |
|||
|- |
|||
| qdur || quantized duration (duration / 2000) |
|||
|- |
|||
| tnum || track number on any release where the recording appears |
|||
|- |
|||
| isrc || [[ISRC]] of the recording |
|||
|- |
|||
| tag || a tag which has been applied to this recording |
|||
|- |
|||
| date || date of any release where this recording appears (note: ''NOT'' the date of performance of the recording) |
|||
|- |
|||
| comment || recording comment to differentiate similar recordings |
|||
|- |
|||
| country || the [http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm two letter country code] for the release country or 'unknown' |
|||
|- |
|||
| format || the format of the medium (CD, DVD, Vinyl, digital media, etc.) |
|||
|} |
|||
Recording search terms with no fields search the ''recording'' field only. |
|||
===Works=== |
|||
Works searches can contain: |
|||
{| border="1" class="wikitable sortable" |
|||
|- |
|||
! Field !! Description |
|||
|- |
|||
| arid || MBID of any artist related to the work |
|||
|- |
|||
| artist || name of any artist related to the work |
|||
|- |
|||
| artistrelation || relationship of an artist to the work (FIXME: needs some more description) |
|||
|- |
|||
| wid || MBID of the work |
|||
|- |
|||
| work || name of the work |
|||
|- |
|||
| iswc || any ISWC of the work |
|||
|- |
|||
| type || [[Work#Types_of_works|type]] of the work |
|||
|- |
|||
| alias || the aliases/misspellings for the work |
|||
|- |
|||
| tag || any tag applied to the work |
|||
|- |
|||
| comment || work comment to differentiate similar works |
|||
|} |
|||
===Labels=== |
|||
The label index contains the following fields you can search: |
|||
{| border="1" class="wikitable sortable" |
|||
|- |
|||
! Field !! Description |
|||
|- |
|||
| laid || MBID of the label |
|||
|- |
|||
| label || name of the label |
|||
|- |
|||
| sortname || sortname of the label |
|||
|- |
|||
| ipi || IPI code for the label |
|||
|- |
|||
| type || label type |
|||
|- |
|||
| code || label code (only the figures part, i.e. without "LC") |
|||
|- |
|||
| country || The [http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm two letter country code] of the label country or 'unknown' |
|||
|- |
|||
| begin || label founding date |
|||
|- |
|||
| end || label dissolution date |
|||
|- |
|||
| comment || label comment to differentiate similar labels |
|||
|- |
|||
| alias || the aliases/misspellings for the label |
|||
|- |
|||
| tag || any tag applied to the label |
|||
|} |
|||
===Annotations=== |
===Annotations=== |
Revision as of 22:20, 1 March 2012
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
Field | Description |
---|---|
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 |
arid | the artist's MBID |
artist | (part of) the artist's name (diacritics are ignored) |
artistaccent | (part of) the artist's name (with the specified diacritics) |
begin | the 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 |
country | the 2-letter code (ISO 3166-1 alpha-2) for the artist's main associated country |
end | the artist's end date (e.g. "1980-01-22") |
endarea | (part of) the name of the artist's end area |
ended | a boolean flag (true/false) indicating whether or not the artist has ended (is dissolved/deceased) |
gender | the artist's gender (“male”, “female”, “other” or “not applicable”) |
ipi | an IPI code associated with the artist |
isni | an ISNI code associated with the artist |
sortname | (part of) the artist's sort name |
tag | (part of) a tag attached to the artist |
type | the 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.
Release Group
Search Fields
The release group index contains the following fields you can search:
Field | Description |
---|---|
alias | (part of) any alias attached to the release group (diacritics are ignored) |
arid | the 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 |
firstreleasedate | the release date of the earliest release in this release group (e.g. "1980-01-22") |
primarytype | the primary type of the release group |
reid | the 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) |
releases | the number of releases in the release group |
rgid | the release group's MBID |
secondarytype | any of the secondary types of the release group |
status | the status of any of the releases in the release group |
tag | (part of) a tag attached to the release group |
type | legacy 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.
Release
Search Fields
The Release index contains the following fields you can search
Field | Description |
---|---|
alias | (part of) any alias attached to the release (diacritics are ignored) |
arid | the 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 |
asin | an Amazon ASIN for the release |
barcode | the barcode for the release |
catno | any catalog number for this release (insensitive to case, spaces, and separators) |
comment | (part of) the release's disambiguation comment |
country | the 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 |
date | a release date for the release (e.g. "1980-01-22") |
discids | the total number of disc IDs attached to all mediums on the release |
discidsmedium | the number of disc IDs attached to any one medium on the release |
format | the format of any medium in the release (insensitive to case, spaces, and separators) |
laid | the MBID of any of the release labels |
label | (part of) the name of any of the release labels |
lang | the ISO 639-3 code for the release language |
mediums | the number of mediums on the release |
packaging | the format of the release (insensitive to case, spaces, and separators) |
primarytype | the primary type of the release group for this release |
quality | the 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) |
reid | the release's MBID |
release | (part of) the release's title (diacritics are ignored) |
releaseaccent | (part of) the release's title (with the specified diacritics) |
rgid | the MBID of the release group for this release |
script | the ISO 15924 code for the release script |
secondarytype | any of the secondary types of the release group for this release |
status | the status of the release |
tag | (part of) a tag attached to the release |
tracks | the total number of tracks on the release |
tracksmedium | the number of tracks on any one medium on the release |
type | legacy 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.
Recording
Search Fields
The Recording index contains the following fields you can search
Field | Description |
---|---|
alias | (part of) any alias attached to the recording (diacritics are ignored) |
arid | the 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 |
country | the 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 |
date | the release date of any release including this recording (e.g. "1980-01-22") |
dur | the recording duration in milliseconds |
firstreleasedate | the release date of the earliest release including this recording (e.g. "1980-01-22") |
format | the format of any medium including this recording (insensitive to case, spaces, and separators) |
isrc | any ISRC associated to the recording |
number | the free-text number of the track on any medium including this recording (e.g. "A4") |
position | the position inside its release of any medium including this recording (starts at 1) |
primarytype | the primary type of any release group including this recording |
qdur | the 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) |
reid | the MBID of any release including this recording |
release | (part of) the name of any release including this recording |
rgid | the MBID of any release group including this recording |
rid | the recording's MBID |
secondarytype | any of the secondary types of any release group including this recording |
status | the status of any release including this recording |
tag | (part of) a tag attached to the recording |
tid | the MBID of a track connected to this recording |
tnum | the position of the track on any medium including this recording (starts at 1, pre-gaps at 0) |
tracks | the number of tracks on any medium including this recording |
tracksrelease | the number of tracks on any release (as a whole) including this recording |
type | legacy release group type field that predates the ability to set multiple types (see calculation code) |
video | a 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.
Label
Search Fields
The Label index contains the following fields you can search
Field | Description |
---|---|
alias | (part of) any alias attached to the label (diacritics are ignored) |
area | (part of) the name of the label's main associated area |
begin | the label's begin date (e.g. "1980-01-22") |
code | the label code for the label (only the numbers, without "LC") |
comment | (part of) the label's disambiguation comment |
country | the 2-letter code (ISO 3166-1 alpha-2) for the label's associated country |
end | the label's end date (e.g. "1980-01-22") |
ended | a boolean flag (true/false) indicating whether or not the label has ended (is dissolved) |
ipi | an IPI code associated with the label |
isni | an 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) |
laid | the label's MBID |
release_count | the amount of releases related to the label |
sortname | equivalent to name (labels no longer have separate sort names) |
tag | (part of) a tag attached to the label |
type | the label's type |
If you don't specify a field, the terms will be searched for in the alias and label fields.
Work
Search Fields
The Work index contains the following fields you can search
Field | Description |
---|---|
alias | (part of) any alias attached to the work (diacritics are ignored) |
arid | the 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 |
iswc | any ISWC associated to the work |
lang | the 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_count | the number of recordings related to the work |
rid | the MBID of a recording related to the work |
tag | (part of) a tag attached to the work |
type | the work's type (e.g. "opera", "song", "symphony") |
wid | the 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.
Annotations
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
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
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 |