Search Language
This section describes the various rules and modifiers available in the Search bar, in the Build New Smartlist dialog box, and in View Scheme creation.
The Keywords and Modifiers are listed in alphabetical order. Not included are any custom fields you may have created, nor any expressions. For functions and expressions, see Media Center expression language.
Search terms or abbreviations (listed below), can be typed directly as text in the Search bar, bypassing the Search Wizard.
Keywords
Keywords create selections.
Keywords also have abbreviations, which are customizable. Go to Tools > Options > Library, select the field and press Edit. Type the abbreviation you would like to use in the Keywords box. Multiple keywords may be used, each separated by a semi-colon (no spaces).
Name | Keywords/Abbrev | Example |
---|---|---|
Access Rating | accessrating | [Access Rating]=PG-13
|
Album | al= album= |
al=[Highway 61"
|
Album Artist | albumartist= | albumartist=Various
|
Album Artist (auto) | autoalbumartist= | autoalbumartist=Various
|
Album Gain | ag=
albumgain= |
ag=<2
|
Album Type | albumtype= | [Album Type]=[Single artist (complete)]
|
Artist | ar=
artist= |
ar="Bob Dylan"
|
Artist - Album (Year) | n/a | [Artist - Album (year)]=[Lilac Time - And Love for All (1990)]
|
Band | bd=
band= |
bd=Lilac Time
|
Bit Depth | n/a | [Bit Depth]=<16
|
Bitrate | bitrate= | bitrate=198
|
Bookmark | n/a | |
Beats per Minute | bpm= | bpm=130
|
Channels | n/a | |
Comment | c=
comment= |
comment="Live at the Horseshoe"
|
Complete Album | completealbum= | completealbum==0
Note: A complete album has sequentially numbered tracks, from 1 to N. |
Composer | composer= | composer=mozart
|
Compression | n/a | |
Content Distributor | cdistrib= | |
Content ID | cid= | |
Content Type | ctype= | |
Date | d=
date= |
date=<1y
Use y (year), d (days) h (hours) m (minute) or s (seconds). |
Date (day) | n/a | [Date (day)]=31
|
Date (filename friendly) | n/a | [Date (filename friendly)]=[20040521-174844]
|
Date (month) | n/a | [Date (month)]=May
|
Date (year) | year= | year=1973
|
Date Created | n/a | [Date created]=<1d
Use y (year), d (days) h (hours) m (minute) or s (seconds). |
Date Imported | dateimported= | dateimported=<=6d
Use y (year), d (days) h (hours) m (minute) or s (seconds). |
Date Modified | n/a | [Date Modified]=<30m
Use y (year), d (days) h (hours) m (minute) or s (seconds). |
Dimensions | n/a | |
Disc # | n/a | |
Duration | length=
duration= |
duration=300
|
Events | events= | |
File Size | size= | size=>7000
|
File Type | Filetype= | Filetype=mp3
|
Filename | filename=
location= |
location=D:\Music\Various\
|
Filename (name) | [Filename (name)]="Train to Prague"
Use quotes to protect spaces or special characters in the file name. | |
Filename (path) | [Filename (path)]=photo
Use quotes to protect spaces or special characters in the file name. | |
Genre | g=
genre= |
g=rock
|
Height | height= | height=>100
|
Image File | imagefile= | imagefile=adams
|
Insensity | intensity= | intensity=3 or intensity=>2 (values from 1 to 5) |
Keywords | keyword= or keywords= or kw= | kw =poprock;1979;hits (values: semicolon delimited list) |
Last Played | lastplayed= | lastplayed=<24h (less than 24 hours) lastplayed=<30m (less than 30 minutes) |
Lyrics | lyrics= | lyrics="you know your problem" |
Media Type | mediatype= | mediatype=image |
Mix Album | mixalbum= | |
Name (Title) | name= or title= or n= | name="Tangled up in blue" |
Notes | notes= | notes=”conducted by Jeremy” |
Number of Plays | numberplays= | numberplays=>10 returns all files played more than 10 times |
or | or | Extends the search: "Bob Dylan" or "Judy Collins" |
Peak Level | peaklevel= | peaklevel=.77 |
People | people= | people=mom,dad,Mike displays all photos that are of one of these people |
Places | places= | places=Amsterdam,London,cottage |
Playback Range | playbackrange= | |
Playlist | playlist= or p= | p="top 40 1996" |
Rating | rating= or r= | rating=3, or rating=5,4 |
Removable | removable= | Returns info on files that are on removable media, like a CD or DVD. This new command replaces [Filename}=[Ox” from Media Jukebox. |
Replay Gain | replaygain= or rg= | rg= -16 |
Sample Rate | n/a | |
Service: Album Price | n/a | |
Service: Track Price | n/a | |
Text | n/a |
[Text]=”lemongrass chicken” |
Track # | tracknumber= or t= | t=4 returns all track numbers with 4 (4, 14, 24) t==4 returns only tracks which equal 4. |
Volume Name | volume= | volume="Music 29" (insert name of your CD) (see Note 1) |
Width | width= | width=>80 |
Year – Album |
Note 1: This field is best used in conjunction with the ~d parameter, which specifies the database in which to search. Normally, the volume parameter will be relevant in the CD database. See ~d in the Modifiers below.
Modifiers
Modifiers alter the current selection of items.
Name | Modifier | Description / Examples |
---|---|---|
Limit database to | ~d | Selects which MC database(s) will be used for queries (eg. main, cd, temporary, etc.)
Examples: |
Only duplicates of Remove duplicates of |
~dup= ~nodup= |
Includes or excludes duplicates from the current selection.
Examples: |
Limit of device | ~fill | Selects and limits the number of items to fill the specific media type to maximum capacity. This modifier limits the number of files returned based on the amount of empty space left on the default or specified device. Examples: |
Expand to full albums | ~a | Expands the track selection to include all tracks from the selected albums. Examples: |
Limit number to | ~limit | Limits the current selection set to a maximum number of matched keys, and maximum tracks (Q: ?tracks only?) per key. Usage: ~limit=<total key limit>,<per key limit>,<key fields> Use -1 to indicate all. Examples: |
Limit to n tracks | ~n | ~n=10 returns 10 random tracks. ~n=10 Bob Dylan returns 10 tracks containing the words Bob and Dylan. |
Mix | ~mix | Creates mixes from the current selection of a specified size (either a number or percentage). Examples: |
Limit size to | ~s | Limit the total track size to the specified number of megabytes.
Examples: |
Sort by | ~sort | Sorts the selection by the specified key(s).
Examples: |
Limit time to | ~t | Limit the amount of track time to the specified total number of minutes.
Examples: |
Limit percentage to | ~% | Limits by percentage of selection.
Examples: |
Sequence | ~seq | Assigns a monotonically increasing sequence number to the selected items. Examples: |
Note: The equal sign ("=") between the ~n, ~d or ~t and the value is optional (e.g., ~n30 and ~n=30 are equivalent).
(Q: when are random items returned?)
Quoting, Grouping, Delimiters and Operators
( TBD: clarify this section; perhaps more should be merged with Modifiers above? )
Explanation | Example | |
---|---|---|
" " | exact match & multi-word search | "Bob Dylan" "Desolation Row" |
( ) | exact match & multi-word search | "Bob Dylan" (1966 or 2001)
returns an exact match on Bob Dylan, AND an exact match on 1966 and another on 2001. ( ) are used as in a math equation. Example: r=4,5 (genre=rock or year=1970-1980) is much different from r=4,5 genre=rock or year=1970-1980. |
[ " | exact beginning
(don't forget the " at the end of entry) |
[Stan"
returns everything beginning with "Stan". Stan Getz, Stand by Me, Standing in the Doorway |
" ] | exact ending
(don't forget the " at beginning of entry) |
"stand]
returns everything that ends with "stand". Stand, I Will Stand, I Didn't Understand. |
[ ] | begins & ends exactly as indicated | [Bob Dylan], [Desolation Row]
The results will exclude Bob Dylan & the Band because this entry does not end with Dylan. |
^ | Restrict to full word | ^car
The results will include A Car for All, but neither The Red Carpet nor Nascar. |
, | comma, delimits lists | artist="Bob Dylan",[Sting],Merlin
This returns all tracks from these three artists. Do not insert spaces. |
- | exclude search term | "Bob Dylan" -album=([time",[blood","mercy]) –year=1993
returns an exact match on Bob Dylan, except for albums beginning with "Time" and "Blood", ending with mercy, and excluding tracks from 1993. |
and | narrow the search | "Bob Dylan" and "the Band"
Note: the "and" is assumed whenever you type in many words, so it is not necessary to include it. |
or | extend the search | "Bob Dylan" or "Judy Collins" |
< | smaller than | lastplayed=<60 returns tracks played in less than the past 60 minutes. |
> | greater than | bitrate=>128 returns tracks with more than 128 bitrate, or
rating=>3 returns all tracks rated with 4 or 5. |
Note: Quotation marks and brackets must go in pairs. For example, Metallica] is invalid; it must be either [Metallica] or "Metallica] ).
Note: When you have an = followed by a numeric value, the search looks for a substring, and so will return all items containing that number. Eg year=0 will return 0, 2000, 2001, 1990. If you want to search for an exact number, use two equal signs: year==0 which will return only those tracks with a year of 0.
Examples
Here are few examples of the kinds of rules you can create. Note: these examples are for typing the rules directly; you can use the Wizard for much simpler access to rules.
genre, bitrate, comment
- [genre]=[opera] [bitrate]=[320] [comment]="Italian"
- Result: Finds all opera files with a bitrate of 320 that include "Italian" in the comment field
duration, last played
- [lastplayed]=<60m [duration]==>300
- Result: Finds all tracks that are 5 minutes long or more (300 seconds), and that have played in the last hour (60 minutes)
playlist, last played, limit tracks
- [playlist]="top 40 1983" [lastplayed]=10-30 ~n=10
- Result: Finds 10 tracks tracks that are in the "Top 40 1983" playlist that were last played 10-30 minutes ago.
file size, artist
- [size]=>7000 [artist]=[Bet*
- Result: Find all files larger than 7000kbs (or 7MB) whose artist field begins with "Bet"
exclude, number of plays
- [genre]=[alt* numberplays=>10 -[artist]=Sting,Beatles
- Result: Find all genres that begin with "alt", and play all the tracks that have been played more than 10 times, but exclude tracks from Sting and from the Beatles. (Note: To manually type in an exclusion, as in this example, simply put a "-" before the rule.)
sort, rating, limit time
- ~sort=[Random] [Rating]=>=3 ~t=60
- Result: Find 60 minutes worth of files rated 3 or higher and sort them randomly.
date imported
- [dateimported]=<=7d
- Result: Show all files imported in the past 7 days. Note: You can use y (year), d (days) h (hours) m (minute) or s (seconds).
mix
- g=rock ~mix=100,50%,{[Rating]=>3},25%,{[Rating]=1,2},25%,{[Rating]=[]}
- Result: play 100 rock tracks, 50% of which are rated 4 and 5, 25% of which are rated 1 and 2 and 25% unrated.
- ~mix=50,50%,{[Genre]=[Country Rock]},50%,{[Genre]=[Alternative Rock]}
- Result: play 50 tracks, ½ of which are Country Rock, and ½ of which are Alternative Rock.
limit
- [genre]=[rock] ~limit=7,-1,[album]
- Result: play only 7 rock albums.
- Explanation: for all rock, find only 7 albums, and play all (-1) tracks from that album.
- The syntax for use with ~limit is:
- ~limit=LIMIT_TOTAL_KEYS,LIMIT_PER_KEY,KEY_FIELDS
- This means: take a key field (e.g., album), limit the total of that field (7 albums, or –1 for unlimited), and of that total, limit again per field (2 tracks per album, or –1 for unlimited).
- ~limit=-1,1,[Artist] ~limit=-1,2,[Decade]
- Result: plays 10 tracks, 2 from each of the decades (a custom field) and the same artist appears only once.
- Explanation: The first limit: find unlimited artists (-1), and play only one track per artist (1). The second part means: find all decades (-1) and limit to 2 tracks per decade (2).
- [genre]=[rock] ~limit=7,2,[album]
- Result: From the rock genre, find 7 albums, and play only 2 tracks per album.
- Explanation: for all rock, limit the total albums to 7, and limit those 7 albums to 2 tracks each.
Note: The length field is calculated in seconds. The lastplayed field is calculated in minutes: <20 means smaller than, or within the last 20 minutes, whereas >20 means greater than, thus before the last 20 minutes. Using 10-30 means between 10 and 30 minutes.