fynnfluegge / fynnfluegge/rocketnotes

bug(document-search): results not showing correctly after space in search string

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
bug effort low good first issue
Dominant language
TypeScript
Stars
1.5k
Forks
79
PR merge metrics
No merged PRs in 30d

Description

When entering three characters in the search bar and hitting space afterwards, then the autocompleted result list is not displayed correctly. It seems that the [search function](https://github.com/fynnfluegge/rocketnotes/blob/main/lambda-handler/search-document-handler/main.go) returns wrong results (ignoring space) and as a result the highlighted search string in the autocomplete panel is displayed wrong. The not correct displayed search results should not be contained in the result set anyways, hence fixing the bug in the `search-document-handler` is sufficient.

**Current behaviour**
When hitting space in search bar some documents that shouldn't be found at all are displayed in the suggtestion list.

**Expected behaviour**
When hitting space in search bar the suggestion item list should be correct and item content should match search pattern.

Contributor guide

Open the contributing guide

Research direction

Start by reading lambda-handler/search-document-handler/main.go and trace how a search string containing a trailing space is handled. Reproduce the autocomplete case with three characters followed by a space, then verify that the returned suggestion set excludes documents that do not match the complete search pattern and that displayed item content matches it.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.