FCBHDBP-616 improving response for search languages endpoint #3
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
When retrieving information from endpoint GET /languages/search/{search_text} not always returns the best results in the top.
The solution presented is to try to maintain the current order according to the MATCH function but move the row that matches the search text to the top using a score system using LIKE to move the results that start with the search text to the top, ensuring that the most relevant results appear first.
Issue Link
FCBHDBP-616
How Do I QA This
Search for English and notice that the results are starting with English
https://digitalbibleplatform.postman.co/workspace/DBP4-workspace~0a283f7f-06d9-467d-97f0-fef92d18bd3d/request/12519377-3d1641d8-f3ff-44c4-9077-d56350f31c68?action=share&source=copy-link&creator=18435954&active-environment=810fd94b-9392-43e2-9f13-943e8d323135