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

implement real time suggestion #292

Merged
merged 30 commits into from
Jan 8, 2025
Merged

Conversation

Rajgupta36
Copy link
Collaborator

@Rajgupta36 Rajgupta36 commented Dec 28, 2024

Resolves #148

Implemented real-time suggestions using the autocomplete.js library provided by Algolia.

  • Created a SearchBar component
  • Added search logic
  • Set up a query suggestion index
  • Implemented custom loading for the search bar
  • Enhanced query handling for better suggestions
  • Fixes test cases
  • added test case
  • added suggestion index

Preview

Screen.Recording.2024-12-29.165757.mp4

@Rajgupta36 Rajgupta36 marked this pull request as ready for review December 30, 2024 16:54
@kasya
Copy link
Collaborator

kasya commented Dec 30, 2024

@Rajgupta36 Thank you for working on this! Could you please resolve existing conflicts before we review this one? Thanks!

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

It seems we can create suggestions index programmatically.

frontend/package.json Outdated Show resolved Hide resolved
frontend/src/components/Search.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

I also noticed multiple loading indicators upon data loading 🤷‍♂️

@Rajgupta36
Copy link
Collaborator Author

Rajgupta36 commented Dec 31, 2024

I also noticed multiple loading indicators upon data loading 🤷‍♂️

yeah it's only when our component load first time . i have fixed it

@Rajgupta36 Rajgupta36 requested a review from arkid15r December 31, 2024 10:19
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

It seems we can create suggestions index programmatically.

So what about the index settings, do we need to update them manually?

frontend/jest.setup.ts Outdated Show resolved Hide resolved
@Rajgupta36
Copy link
Collaborator Author

Rajgupta36 commented Dec 31, 2024

We need new indexes for query suggestions. we can add facet values programmatically. I think we can create query suggestion indexes for a single user and then update it, just like we used to update the local_issues and other indexes via make load-data or make index-data command.

backend/Makefile Outdated Show resolved Hide resolved
@github-actions github-actions bot added documentation Improvements or additions to documentation ci labels Jan 8, 2025
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

Please address these and let's merge it:

frontend/__tests__/src/pages/Chapters.test.tsx Outdated Show resolved Hide resolved
frontend/src/components/Search.tsx Outdated Show resolved Hide resolved
@Rajgupta36 Rajgupta36 requested a review from arkid15r January 8, 2025 21:37
arkid15r
arkid15r previously approved these changes Jan 8, 2025
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM

frontend/__tests__/src/pages/Chapters.test.tsx Outdated Show resolved Hide resolved
@arkid15r arkid15r added this pull request to the merge queue Jan 8, 2025
Merged via the queue into OWASP:main with commit 5a4596a Jan 8, 2025
12 checks passed
@Rajgupta36 Rajgupta36 deleted the AutocompleteSearchBar branch January 11, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Real-time Search Suggestion Feature for Project Search Engine
3 participants