carloscuesta / carloscuesta/gitmoji-cli

Fuzzy search does not respect exact search terms

Open
#1,358 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

When doing a fuzzy search, I often type exact terms because I find that results are strangely sorted. I know that this has already been addressed (see https://github.com/carloscuesta/gitmoji-cli/issues/302) but I don't think it is good enough at the time of writing.

When I search "types", I expect that "Add or update types" be the first result.

image

It might be just an opinion so feel free to discuss it of course :)

### Reproduction

- Run `gitmoji -c`
- Type `types`

### System Info

```Shell
System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M1
Memory: 105.66 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.15.1 - ~/.nvm/versions/node/v20.15.1/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v20.15.1/bin/yarn
npm: 10.8.3 - ~/.nvm/versions/node/v20.15.1/bin/npm
Browsers:
Chrome: 129.0.6668.101
Safari: 17.6
```

### Validations

- [X] Follow our [Code of Conduct](https://github.com/carloscuesta/gitmoji-cli/blob/master/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guide](https://github.com/carloscuesta/gitmoji-cli/blob/master/.github/CONTRIBUTING.md).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating duplicates.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Research direction

Run `gitmoji -c` and enter `types` to reproduce the ordering described in the issue. Trace the fuzzy-search entry point and compare the results against the expected first result, “Add or update types”; done means exact terms are ranked appropriately and the behavior is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.