Support search operators

Bug #661454 reported by RJ Skerry-Ryan
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Wishlist
RJ Skerry-Ryan

Bug Description

The library search feature could include some nicer search features such as :

title: FOO artist: BAR genre: BAZ

We could even support some operators within the sections like:

year: >=2005
year: =2005

Since this would be an "advanced" feature, the mini-language could have some degree of complexity, though the basic Google-like ones above should be easy for anyone to get.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Wishlist
jus (jus)
Changed in mixxx:
assignee: nobody → Bart Verstrynge (bloodybeet)
status: Confirmed → In Progress
Revision history for this message
Owen Williams (ywwg) wrote :

It would be nice if we could also search ratings. Maybe interpret "***" as "three stars"? Or "rating: 5" to be consistent with the description above.

Furthermore, since typing while DJing isn't pretty, I'd like short versions of the terms also. "g:" could also be interpreted as "genre:" as a shortcut. Oh and BPM ranges too: "b:120-125".

Revision history for this message
Bart Verstrynge (bloodybeet-deactivatedaccount) wrote :

All said functionality has been implemented in my branch. If you check out my branch, check out the user manual under "temporary fts doc" for the FTS to see the resulting functionality.
Adding shorter aliases for fields is also something that passed my mind. It's absolutely no biggy to get them implemented - it would simply require a small addition in the tokenizer.lex file.

I think it would be good to include the FTS functionality as "experimental" to some public release, so users can check it out and test in the long term. I'm expecting a lot of comments on how the syntax can be refined etc.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: none → 1.11.0
RJ Skerry-Ryan (rryan)
Changed in mixxx:
assignee: Bart Verstrynge (bloodybeet) → RJ Ryan (rryan)
status: In Progress → Fix Committed
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

As a stopgap before Bart's Full-Text-Search branch is finished I hacked up a dead-simple query parser tonight. It's currently in trunk.

* Text filtering (artist, album, genre, title, composer, comment)
* Numeric filtering (year, track, bpm, duration, played, rating)

For text filtering, you can do queries like:
- artist: "com truise"
- artist:Danger
- genre: Trance

Note it doesn't matter if you have a space between the colon and the argument or not.

For numeric filtering you can do either either exact number or range filtering:

- bpm:140
- bpm: >140
- year: <2010
- bpm: >=140
- rating: <=4
- bpm: 140-150
- played: >10

Note that you can put a space between the colon but currently there must be no space between the operator and the number.

I left fuzzy-matching (e.g. "~bpm" to specify tracks with similar BPMs to currently playing tracks and "~key" to specify harmonically compatible tracks) as stub methods in the SearchQueryParser class. If anybody wants to tackle those it should be pretty easy to get started.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I forgot to mention, of course you can combine these operators.

List all Danger tracks that are rated 4 or 5.
- artist:Danger rating:>=4

There's no way to do an OR right now. That's another thing that isn't too hard but I don't have time to tackle right now.

Revision history for this message
jus (jus) wrote :

Thanks for implementing this RJ - a great addition to all users. We should emphasize that in the 1.11 release changelog .

Can you briefly outline what Bart's Full-Text-Search branch is missing in order to qualify it for inclusion in the trunk?

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Won't Fix
status: Won't Fix → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5572

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.