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.
Fixes #113
What was changed?
The application components that handle search functionality were updated to support multiple search terms. Specifically, the OrcadashboardComponent.js file was modified to correctly send an array of search terms from the frontend. On the backend, changes were made in usecases/search_orca_data.py to handle the array of search terms and in the extract_sections(file_search_operations.py) function to process and extract data for each search term.
Why was it changed?
The application previously supported only a single search term, which limited its flexibility and efficiency for users working with files containing multiple relevant sections. These changes allow users to input multiple search terms, making the search process more comprehensive and reducing the need for repetitive operations. This improves both usability and functionality.
How was it changed?
Frontend (OrcadashboardComponent.js):
The searchTermsArray variable is now passed as part of the request payload, ensuring multiple search terms can be sent to the backend.
Additional data cleanup ensures that sections and other inputs are formatted correctly before sending.
Backend (usecases/search_orca_data.py):
The search_terms parameter is now retrieved as a list from the input data (data.get('search_terms', [])), preparing the backend to handle multiple terms.
The function iterates through all provided search terms, processing each one independently and combining the results into a single output. Adjustments to section logic ensure compatibility with multiple terms while maintaining the functionality for WHOLE, FIRST, LAST, and SPECIFIC sections.
Screenshots that show the changes (if applicable):