Random SortScript with Session ID

Hi,

i am trying to get a random sorting by using this CustomSortScript

'source' => '(doc[\'isPremium\'].value == false ? 0 : 1 ) * (doc[\'uid\'].value * ' . substr($sessionCrc, 0, 5 ) . ')'

It works and it is getting a random ID, but there is a logik problem. An upper incrementalID is getting an another ID like with different sessions, but the sorting of the uid * Session ID is always the same

I thinks, that if I will truncate the incrementel IDs to 1 or 2 digits, i am getting more fuzziy numbers -> result: random sorting

How can I solve it?
Is there maybe an another way to solve it?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.