Add support for random ordering with seeds
Description of the Change
This PR adds support for using RAND function in the orderby field for search queries.
Checklist:
- [x] I have read the CONTRIBUTING document.
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my change.
- [ ] All new and existing tests passed.
Applicable Issues
#1490
Changelog Entry
- Add support for
RANDfunction fororderbyfield in search queries.
Looks like this is already supported. What does this PR do?
Looks like this is already supported. What does this PR do?
@tlovett1 Right now, only 'orderby' => 'rand' is supported. This PR adds the support for the RAND function which lets a user pass seed value to the function.
You can read more about it over here: https://github.com/10up/ElasticPress/issues/1490#issuecomment-576351214
@brandwaffle I have added the test in f70ee87db9ac22d0d4c11ef7c67a527318153aa4 Can we do cherry-pick after the merge this PR?