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: Added search queries functionality to fags #961

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

theijhay
Copy link
Contributor

@theijhay theijhay commented Aug 24, 2024

Description

Added search functionality to the FAQ endpoint. The updated /faqs GET endpoint now allows filtering of FAQs based on a keyword provided by the user. The search checks both the question and answer fields for matches. If a keyword is provided, it returns the relevant FAQs; otherwise, it returns all FAQs.

Related Issue (Link to issue ticket)

Related Issue

Motivation and Context

This change was required to enhance the user experience by enabling more effective and accurate search functionality on the FAQ page. It allows users to quickly find relevant information by searching through both the questions and answers, ensuring that all relevant FAQs are returned based on the user’s query.

How Has This Been Tested?

The changes were tested using Postman by running the FastAPI application locally. The testing involved sending various GET requests to the /faqs endpoint with and without the keyword query parameter to ensure that the search functionality correctly filters FAQs based on the provided keyword. The tests confirmed that the search operates on both the question and answer fields, returns accurate results, and handles cases where no FAQs match the search criteria.

Screenshots (if appropriate - Postman, etc):

Screenshot from 2024-08-24 09-22-47

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@johnson-oragui johnson-oragui merged commit 7cdaa4d into hngprojects:dev Aug 24, 2024
1 check passed
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