Sorting not working for search API
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 303
- Forks
- 211
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 5
Description
The "sort" parameter in the search API is not working. Also reported in CHEF-2121.
This is causing Chef Manage(opscode/chef#2279) and 'knife search' commands to display unsorted lists. Here are some "knife search" results to show the issue:
[apop@mymac chef-repo]$ knife search role "*:*" --id-only --sort asc -VV
...
DEBUG: Initiating GET to https://api.opscode.com/organizations/ap-org1/search/role?q=*%253A*&sort=asc&start=0&rows=1000
...
3 items found
windows_web
linux_base
windows_base
Same unsorted list returned with these commands:
knife search role "*:*" --id-only --sort name
knife search role "*:*" --id-only --sort name+desc
knife search role "*:*" --id-only --sort "name desc"
knife search role "*:*" --id-only --sort ascending
knife search role "*:*" --id-only --sort asc
knife search role "*:*" --sort asc
knife search role "*:*" --sort description
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the unsorted results with the documented search API and the listed knife search commands, then trace how the sort parameter is handled between the API and search backend. Compare the behavior with CHEF-2121 and confirm the expected ordering; done means supported sort forms return consistently ordered results with regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- api, backend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100