Would it be possible to rank Sections based on filter matches in autocompletion ?
With fixed ranking of Sections, completions with fuzzy matches may be displayed before exact matches if their Section has a lower rank. This has a very negative impact on the relevance of completions.
To address this issue, I would like to sort Sections by relevance based on the filter results:
Sections with exact matches, sorted by :
number of exact matches
number of fuzzy matches
rank
Sections with fuzzy matches, sorted by
number of fuzzy matches
rank
We could compute sections ranks generating completions, but this would require access to CodeMirror fuzzy match.
What would be the best approach to achieve this result?
I won’t change the default behavior here, since that will impact people’s existing use. Does attached patch, which requires you to explicitly opt in to this behavior, work for you?
After fixing the build of the module, the dynamic ranking of Sections work well.
I had a few errors if the dynamic option is not disabled when filtering is disabled. (I disable filtering when there is only 1 character of input)
But this was quickly fixed by disabling this option with filtering.
From my testing it works well and could be released this way.
But I’ll need to confirm when I have received end users feedback in 1 or 2 weeks. If they do ask for more specific ranking of sections, having seen how you implemented the dynamic ranking, I think that I can adjust it to meet their requests. In any case I’ll let you know.