Flow-Launcher / Flow.Launcher

:mag: Quick file search & app launcher for Windows with community-made plugins
https://flowlauncher.com
MIT License
7.97k stars 310 forks source link

Document expected score ranges for ranking results #3022

Open cspotcode opened 1 week ago

cspotcode commented 1 week ago

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

cspotcode commented 1 week ago

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