feat: Added search queries functionality to fags #961
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: