Skip to content

R64.JACCARD

CategoryDescription
SyntaxR64.JACCARD key1 key2
Time complexityO(M)
Supports structuresBitmap64
Command descriptionRetrieves the Jaccard similarity coefficient of two Roaring keys. The higher the coefficient, the higher the similarity..

Parameter

  • key1: The name of the Roaring bitmap key.
  • key2: The name of the Roaring bitmap key.

Output

  • If the operation is successful, a double-typed Jaccard similarity coefficient is returned.
  • If both keys are empty -1 is returned.
  • Otherwise, an error message is returned.

Examples

Basic Usage

bash
$ redis-cli
127.0.0.1:6379> R64.SETINTARRAY foo1 1 2 3
OK

127.0.0.1:6379> R64.SETINTARRAY foo2 1 2 4
OK

R64.JACCARD foo1 foo2
"0.5"