Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support search operators #5572

Closed
mixxxbot opened this issue Aug 22, 2022 · 6 comments
Closed

Support search operators #5572

mixxxbot opened this issue Aug 22, 2022 · 6 comments
Labels
Milestone

Comments

@mixxxbot
Copy link
Collaborator

Reported by: rryan
Date: 2010-10-15T20:39:41Z
Status: Fix Released
Importance: Wishlist
Launchpad Issue: lp661454


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2011-10-02T16:34:11Z


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".

@mixxxbot
Copy link
Collaborator Author

Commented by: bloodybeet-deactivatedaccount
Date: 2011-10-02T16:55:50Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2012-03-28T04:34:19Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2012-03-28T04:36:24Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: esbrandt
Date: 2012-04-06T09:52:36Z


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?

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 1.11.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant