code: private void addIndex(final Object connection, final AttributeWrapper wrapper, final String rowKey,
              final EntityMetadata metadata)
      {
  
          Indexer indexer = indexManager.getIndexer();
  
          if (indexer != null && indexer.getClass().getSimpleName().equals("RedisIndexer"))
          {
              // Add row key to list(Required for wild search over table).
              wrapper.addIndex(
                      getHashKey(metadata.getTableName(),
                              ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName()), getDouble(rowKey));
  
              // Add row-key as inverted index as well needed for multiple clause
              // search with key and non row key.
              wrapper.addIndex(
                      getHashKey(metadata.getTableName(),
                              getHashKey(((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName(), rowKey)),
                      getDouble(rowKey));
  
              indexer.index(metadata.getEntityClazz(), metadata, wrapper.getIndexes(), rowKey, null);
          }
      }
docs: Add inverted index in sorted set.
  
  @param connection
  redis connection instance
  @param wrapper
  attribute wrapper.
  @param rowKey
  row key to be stor
  @param metadata
  the metadata