Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search full shorturl #1037

Merged
merged 11 commits into from
Dec 16, 2020
Merged

Search full shorturl #1037

merged 11 commits into from
Dec 16, 2020

Conversation

Oxiang
Copy link
Contributor

@Oxiang Oxiang commented Dec 10, 2020

Problem

Users are unable to search for shortUrl when they enter the entire url in the search box e.g. https://go.gov.sg/search-this.

Closes #977

Solution

Add another layer for keyword search to extract the shortUrl if the search query matches the regex pattern.
e.g. https://go.gov.sg/search-this will extract search-this
If it does not match the regex, the original query will be used

Exclude query without https header
e.g. go.gov.sg/search-this as users only search (guessing it is a copy and paste action) the full url link (as found in GA)

  • add unit test for parse.ts

- remove rawdirectory search from urlrepository
- shift preprocess task to directorysearchservice
- rename sanitse file to parse file
- extract shorturl that contains the full url link from query
- add new tests for extractshorturl
- update directory related tests from refactor
- move preprocess back to urlrepository
- add back rawdirectorysearch
- revert back tests
src/server/util/__test__/parse.test.ts Outdated Show resolved Hide resolved
src/server/repositories/UrlRepository.ts Outdated Show resolved Hide resolved
src/server/util/parse.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yong-jie yong-jie merged commit 19d1223 into develop Dec 16, 2020
@yong-jie yong-jie deleted the search-shorturl branch December 16, 2020 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow searching of longUrl on GoDirectory
3 participants