feat: add enhanced search result sorting options (#139)#1
Open
NTLx wants to merge 1 commit into
Open
Conversation
- Add sort_by parameter to search() method in Memory class - Support multiple sorting criteria: relevance, date_asc/date_desc, importance_asc/importance_desc, access_count_desc, retention_desc - Support multi-criteria sorting with list of sort keys - Add _sort_search_results() method for flexible sorting - Update AsyncMemory class with same sorting functionality - Update SearchRequest model with sort_by field - Update SearchService to pass sort_by to memory.search() - Update API endpoints (POST/GET) to support sort_by parameter - Add unit tests for sorting functionality Closes oceanbase#139
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR implements enhanced search result sorting options for PowerMem as requested in issue oceanbase#139.
Changes
Core Features
sort_byparameter toMemory.search()andAsyncMemory.search()methodsrelevance(default),date_asc,date_desc,importance_asc,importance_desc,access_count_desc,retention_desc["relevance", "date_desc"])_sort_search_results()method for flexible sorting logicAPI Updates
SearchRequestmodel withsort_byfieldSearchService.search_memories()to passsort_byparametersort_byparameterUsage Examples
Backward Compatibility
sort_byparameter is optionalCloses oceanbase#139