You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find a way how to properly stack up the count of union matches to the calculation.
This is what I theoretically need:
// a set of keyskeys=[ ....];// initial weights to 1weights=[1,1,1, ....];// store union with COUNT as the new scoreredis.zUnionStore(dest,keys,{AGGREGATE: "COUNT"});// push the destination to the keyskeys.push(dest);// add some high value to the weights to prefer the// ordering based on count over the sum of scoreweights.push(999);// calculate final results with the right orderingredis.zUnionStore(dest,keys,{WEIGHTS: weights,AGGREGATE: "SUM"});
In SQL something simliar is ORDER BY count DESC, score DESC
Is there a chance to add such functionality to the library? Thanks in advance
The text was updated successfully, but these errors were encountered:
Hi @ts-thomas. I suggest you ask your question on the Redis Discord channel. You might get some creative ideas of how to accomplish this in the absence of this feature. Alternatively, you can raise an issue on the Redis repo itself.
I couldn't find a way how to properly stack up the count of union matches to the calculation.
This is what I theoretically need:
In SQL something simliar is
ORDER BY count DESC, score DESC
Is there a chance to add such functionality to the library? Thanks in advance
The text was updated successfully, but these errors were encountered: