How to rank higher records with a lower number of words?

Hi,

I am looking to sort results, so an exact match on the attribute “name” with less words would have a higher priority. Any ideas ?

Exemple

Query:

“arrow right”

What I have:

1 - arrow right thick
2 - arrow right circle outline

10 - arrow right

What I want:

1 - arrow right
2 - arrow right circle outline
3 -arrow right thick

Data set

{
  "id": "9F7385FB-733C-4C1F-AC88-684BE98F381B",
  "name": "arrow-right-thick",
  "codepoint": "F055",
  "aliases": [],
  "tags": [
    "Arrow"
  ],
  "author": "Austin Andrews",
  "version": "1.5.54",
  "objectID": "25877752"
},
{...},
{
  "id": "05F25B05-A6D6-4863-8B21-6969E10329CF",
  "name": "arrow-right",
  "codepoint": "F054",
  "aliases": [
    "arrow-forward"
  ],
  "tags": [
    "Arrow"
  ],
  "author": "Google",
  "version": "1.5.54",
  "objectID": "25877622"
}

Configuration


Hello,

One workaround to get this working is to add a custom ranking on “name” with ascending order. That will make your exact match appear at the top if all other ranking criteria are equal.