Document expected score ranges for ranking results
Is your feature request related to a problem? Please describe.
I am writing a JSON-RPC plugin. I cannot call Flow's API from an RPC plugin, so I cannot use Flow's fuzzy matching implementation IPublicAPI.FuzzySearch(…) I am using Fuse.js, which ranks as a float from 1 to 0, and I'm converting to an int from 0 to 1000.
My plugin's results are way above all other plugins, so clearly I am ranking them much too high.
What is the correct range of int values I should use? 0 to 10? 0 to 500?
Describe the solution you'd like
Ideally, RPC plugins gain access to IPublicAPI so I can use Flow's own fuzzy matcher scoring. Barring that, it would be nice if the plugin documentation described the ideal range of scores.
Describe alternatives you've considered
Additional context
This page suggests numbers 0 to 100: https://www.flowlauncher.com/docs/#/nodejs-write-code?id=_6-result-score
However, this ticket suggested higher values: 50, 100, 150: https://github.com/Flow-Launcher/Flow.Launcher/issues/2904#issuecomment-2295155883
Flow's Fuzzy search has a score range between 0-100, so if you want it to be used along with other plugin and not messing us the ordering, that maybe a good choice. If it is most likely be used with an action keyword, then any score range is fine.
The ticket is saying that we re-order results based on user selection. If no ordering is what you want then higher score may be prefered.
Thank you, this is helpful.
we re-order results based on user selection.
Does this mean that Flow tracks commonly-selected options and gives them a higher score? Is this implemented by IPublicAPI.FuzzySearch(…) or is it a modification made after FuzzySearch has generated a score?
In other words, what is the correct way for an RPC plugin -- Executable, in my case -- to support re-ordering based on user selection?
It is implemented when user execute the results. You don't have to do much, except keeping the Title and Subtitle consistent.
This is still unclear to me. My RPC plugin cannot call FuzzySearch. So how does re-ordering work, if I am unable to use Flow's ranking API? My plugin will always generate an identical score for each item, because I'm using my own ranking library -- fuze.js -- which does not know about the user's past selections.
We cache the result that user click using the result title and subtitle. Next time the same title and subtitle results appear, we will increase the score.
I see. My plugin should always return the same title, subtitle, and score. Then Flow Launcher will boost the scores from my plugin for commonly-selected items.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 60 days.\n\nAlternatively this issue can be kept open by adding one of the following labels:\nkeep-fresh
There is an option in the API of upcoming v1.20.0 release to keep result order. Closing this.