on 01-23-2015 7:46 PM
Hey everyone,
I was traying to override the solr behavior to return each time a random ordering list of products, but I have a big trouble on that and I didn't find an idea to do it.
I found here a documentation, but I don't know how to do it in hybris.
Could someone tell me how could I manage that?
Thanks Haythem,
I'm curious what use case this would fulfill, other than for testing purposes. The out of the box config/solr/embedded/conf/schema.xml has the random fieldType defined. You just need to define a dynamicField to use that type (i.e. random_*)
Then all you need to do when you query is call query.addOrderField("random_1234") on your SearchQuery. Repeated queries with order random_1234 will provide the products in the same random order. A query with order random_5678 will give a different random ordering. That's per the documentation you referenced ;).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks it works for me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Arthur for your replay I'll implement this and get back to if I found a problem. One of our clients, need to get a random list of product for each call that's why we need to do that.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.