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

feat: add (simple) search functionality to app #49

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

karrui
Copy link
Collaborator

@karrui karrui commented Apr 18, 2023

Using simple substring search, since CRDB does not have full text search functionality yet.
Only minimal frontend work since still waiting on design.

TODO: Still need to search in comments, but waiting for redoing of the schema to something Tw*tter-like

@vercel
Copy link

vercel bot commented Apr 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
starter-kit-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2023 7:23am

deletedAt: null,
OR: [
{ title: { contains: query } },
{ content: { contains: query } },
Copy link
Contributor

Choose a reason for hiding this comment

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

is this case sensitive?

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if there's a need to concat the two columns before searching so that the search terms can span both title and body

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, will make case insensitive.
Not sure what you mean by concat columns. now just querying both columns

Copy link
Contributor

Choose a reason for hiding this comment

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

@karrui example:
title: hello world
content: dog mouse cat

searching "hello world dog" will fail since neither the title nor content contains these 3 words

so something like CONCAT(title, ' ', content) ~ "%dog%mouse%cat%" OR CONCAT(content,' ', title) ~ "%dog%mouse%cat%"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i see. seems like edge case with no real need to support (since we don't even have good full text search 😢) will ignore for now

@karrui
Copy link
Collaborator Author

karrui commented Apr 19, 2023

Will keep this branch hanging for now to serve as example for a new feature

@karrui karrui marked this pull request as draft April 19, 2023 03:01
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.

2 participants