This pull request introduces the new search functionality to the website, allowing users to search for businesses and receive personalized results based on their interactions.
Changes Made:
Search Bar Component:
Added a SearchBar component to the MainHeader.
Implemented a debounced input to handle user typing and reduce the number of API calls.
Included clear (X) and search (magnifying glass) icons for better user experience.
Displayed search suggestions/results in a dropdown menu below the input field.
Main Header Component:
Refactored the layout of the header to ensure the search bar is centered, with the logo on the left and user icon on the right.
Backend Search Endpoint:
Created a new API endpoint /api/search to handle search queries.
Tokenized and normalized search queries for more accurate matching.
Queried the database for businesses matching the search query across multiple fields (name, category, business type, overview).
Fetched user interactions (likes, saves, views, ratings) for each business.
Implemented a personalization algorithm to rank search results based on user interactions.
Future Enhancements:
Plan to implement caching using Redis to further improve the performance of the search functionality by storing and retrieving frequently accessed search results.
This pull request introduces the new search functionality to the website, allowing users to search for businesses and receive personalized results based on their interactions.
Changes Made:
Search Bar Component:
Main Header Component:
Refactored the layout of the header to ensure the search bar is centered, with the logo on the left and user icon on the right.
Backend Search Endpoint:
Future Enhancements:
Plan to implement caching using Redis to further improve the performance of the search functionality by storing and retrieving frequently accessed search results.
Project Demo:
Loom Message - 18 July 2024 - Watch Video