Indexed Search Syntax

From MusicBrainz Wiki
Revision as of 18:42, 27 February 2006 by DonRedman (talk | contribs) (question (Imported from MoinMoin))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Attention.png Status: Currently under development. Please help copy and adapt the lucene query syntax docs to our needs!

While we contruct this help page, please see the lucene query syntax page for details on how to construct MusicBrainz text search queries.

Example searches

Artists

  • tori amos - search artist, sortname and alias fields
  • comment:electronic - search for the word electronic in artist comment fields

Albums

  • café del mar - search for all Café del Mar albums
  • "the understanding" AND artist:royksopp - search for the album The Understanding by Röyksopp

Tracks

  • "voodoo people" AND artist:"the prodigy" - search for all tracks Voodoo People by The Prodigy

TODO: add more here!

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

Boolean operators

Boosting a term

Grouping

MusicBrainz specific search fields

The artist index contains the following fields you can search:

field Description
arid artist id
artist artist name
sortname artist sortname
artype artist type (0 - unknown, 1 - person, 2 - band)
begin artist birth date/band founding date
end artist death date/band dissoluion date
comment artist comment to differentiate similar artists
alias the aliases/misspellings for this artist

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

The release/album index contains theses fields:

field Description
reid release id
release release name
arid artist id
artist artist name
type release type (1 - album, 2 - single, etc.[1])
status release status (1 - official, 2 - promo, 3 - bootleg)
tracks number of tracks in the release
discids number of cd ids for the release
date earliest release date for the release
asin the Amazon ASIN for
lang The language for this release (TODO: add lang #s)
script The script used this release

Album search tears with no fields search the release field only.

And track searches can contain:

field Description
trid track id
track track name
arid artist id
artist artist name
reid release id
release release name
type release type (1 - album, 2 - single, etc.)
tracks number of tracks in the release
dur duration of track in milliseconds
qdur quantized duration (duration / 2000)
tnum track number

Track search terms with no fields search the track field only.

  1. 1 - Album, 2 - Single, 3 - EP, 4 - Compilation, 5 - Soundtrack, 6 - Spokenword, 7 - Interview, 8 - Audiobook, 9 - Live, 10 - Remix, 11 - Other