feat: Add usage statistics for applications to improve search results
I added a small module, which allows anyrun to keep track of how often an entry has been launched. Anyrun can then use these statistics to improve the search ranking of these applications.
There the applications plugin has gained the following configuration options:
use_usage_statistics: bool
/// Whether to put more often used applications higher in the search rankings (default: true)
usage_score_multiplier: i64
/// How much score to add for every usage of an application (default: 50)
/// As a reference: Each matching letter is 25 points
max_counted_usages: i64
/// Maximum amount of usages to count (default: 10)
/// This is to limit the added score, so often used apps don't get too big of a boost
An amended configurations file has been provided that mirrors the default config, just like the config.ron does for the main application.
Since I see no downside to this, I have chosen to enable this feature by default.
Please let me know, if you'd like me to make any changes.
This PR should also close #14 .
I also want to say that we already have a PR #116 that adresses the same issue.
Originally, I hadn't intended to publish this code, as I only spent an evening on this, including finding good config defaults and testing. That's why I hadn't looked at the issues or other PRs of anyrun, before making this.
However, having read #14 and found #116 there seems to be demand for this feature, but also a hesitancy to implement in the main applications-plugin.
Reading further through #87 #158 makes it look like the maintainer has plenty of work ahead of them, so I don't think putting any more work in their lap is a good idea.
That said, I'm still open to improving this, but not expecting this to be merged anytime soon.