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.
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):
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
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):
Types of changes
Checklist: