question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NOT sort by score option

See original GitHub issue

The find method always sorts by .score. What I need is that it doesn’t sort at all but leaves the order of the original list.

So, looking at the Basic usage that example returns:

Output: lisp, kotlin, elixir

but what I need it to be is:

Output: kotlin, elixir, lisp

because that’s the order they appear in the list option:

const list = ['go', 'javascript', 'python', 'rust', 
              'swift', 'kotlin', 'elixir', 'java', 
              'lisp', 'v', 'zig', 'nim', 'rescript', 
              'd', 'haskell']

The reason for needing this is that my list that I search on are sorted by “popularity”. If the user only type something really short like f I really want to favor the popular items first because the assumed likelihood that it’s what the user expects to find.

So ideal would be something like:

const entries = fzf.find('li', {sort: (item) => item})

or

const entries = fzf.find('li', {sortByScore: false})

so that it only “filters” the list.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ajitidcommented, Aug 2, 2021

Okay, I’ll close it for now then.

1reaction
ajitidcommented, Jul 28, 2021

I’m already working on a branch https://github.com/ajitid/fzf-for-js/tree/feat/skip-score-sorting that will add a boolean sort.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How is Elastic Search sorting when no sort option specified ...
It looks like sorting is than random ... Default sort order is _score, but score is always 1 when you do not specify...
Read more >
Sort search results | Elasticsearch Guide [8.5] | Elastic
Track Scoresedit. When sorting on a field, scores are not computed. By setting track_scores to true, scores will still be computed and tracked....
Read more >
Sort data in a range or table - Microsoft Support
In the Custom Sort dialog box, click Options. Under Row, in the 'Sort by' drop down, select the row that you want to...
Read more >
Quick start: Sort data in an Excel worksheet - Microsoft Support
In the Order list, choose the order that you want to apply to the sort operation—alphabetically or numerically, ascending or descending (that is,...
Read more >
Video: Sort data in a range or table - Microsoft Support
Training: Sort data in Excel quickly, in just a few clicks. To change the order of your data, sort it. To focus on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found