Search / Filter syntax - Exclude / NOT option?
-
Is there a search option for excluding results from the search - a "NOT" option? e.g. "NOT artist:U2 I've experimented with different syntaxes and haven't found anything that works...
In general:
I'd like to better understand what options are available for searching a collection. The tooltip displayed for the search field (screenshot below) shows some of the possibilities, but not all.I've discovered a few other bits of syntax in forums and by experimenting. Here's what I've found (shown with examples):
- artist: u$ (find all artists starting with the letter "u")
- title: walk$ (similar but searches the title field)
- artist: uddy (will NOT find artists with "Muddy" or "Buddy") - search term must match the start of a word...but not the whole word. Searching for "artist:guy" will find Buddy Guy.
- albumartist: cro - searches album artist field.
- rating:2 - matches songs with that # of stars. can use half values (e.g. 2.5). Searching for "rating:0" and "rating:null" seem to return the same results.
- bitrate:<=200 - bitrate search
- genre:folk$ - would find genres "Folk', "Pop Folk", "Folk Rock", etc.
- grouping:vocal$ - searches the Grouping field. This would find "Vocal" and "VocalJazz", but not "HasVocal". (I use groupings a lot...)
- comment:"#1 single" - searches comment field
- length:>5:00 - searches by time length of track
- playcount:>5 - # of times played field
- year:>2011
There are other fields called out in the tooltip, but I find examples a good way to learn.
What other types of searches are there? Thought we'd get a topic going here as documentation is minimal and the forums are often the best way to learn...
Is there a search option for excluding results from the search - a "NOT" option? e.g. "NOT artist:U2
Thanks in advance!
albumartist: cro
-
@mncroc It's a minus sign. For example,
the beatles album:-"abbey road"
returns all songs by The Beatles (or that mention the Beatles in the tags) except the ones on Abbey Road.
The quotes are important if there's a space; otherwise, you'll get all songs that contain "the," "beatles," and "road" somewhere in the tags but don't have "abbey" in the album. -
@econnolly Have you tested and gotten this to work?
I'm running SMP 1.0.23 on Windows 11 and it doesn't work for me. Searching with or without the minus sign make no difference.
e.g. searching for these all give the same results that include all tracks off Greta Van Fleet's Anthem of the Peaceful Army album:
greta anthem
greta album:anthem
greta album:"anthem"
greta album:-"anthem"
greta album: -"anthem"
greta album: -anthem
greta album: !"anthem"
greta album: !anthem
greta -anthem
greta !anthem
greta NOT (anthem)
greta NOT "anthem"Playing around a bit more it looks like all special characters are ignored. e.g. Searching for "anthem^%$----#" gives the same results as searching for "anthem".*
Screenshot:
@jonas anything you can add or confirm on this topic? Thanks in advance!
-
@mncroc I think I see the issue--there are two different search boxes, and the minus sign works in one of them but not the other.
-
@econnolly That helped. I was fighting with all the "!=" and the suggestions in the pop-up tip, but actually they don't always work. e.g. "year:!=2" didnt work to filter out year 2xxx where "year:-2" does. I hadn't even thought to use the "-" minus sign, but it turns out to be far superior. Also the $ does nothing as far as I can tell there are no wild cards.
"genre:rock -hard -indie -pop -art comment:-amazon year:-20"
basically gives me all the "rock" genre with any "hard rock", "indie rock", "pop rock", and "art rock" filtered out, while also filtering out anything with "amazon" in the comment and sticking to 19xx for the year.