Return random result into product list APIs
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Return random result into product list APIs
Hello,
We are using the APIs in mobile application. Now, we want to show random result on every request on product end point. Either by catalog or by searching . How can we do that part?
Regards
We are using the APIs in mobile application. Now, we want to show random result on every request on product end point. Either by catalog or by searching . How can we do that part?
Regards
Re: Return random result into product list APIs
It's difficult to get real random results fast from a database. This articles describes how it can be achieved:
http://jan.kneschke.de/projects/mysql/order-by-rand/
To implement that in Aimeos, you can add a searchRandom() method to your own product manager and use that in your own product endpoint in the JSON REST API.
http://jan.kneschke.de/projects/mysql/order-by-rand/
To implement that in Aimeos, you can add a searchRandom() method to your own product manager and use that in your own product endpoint in the JSON REST API.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star