1 Redis

Class Ax.redis.Redis


Holds an instance to Redis client

Constructor Summary

MethodDescription
JSRedis(String code)Allow getting a Redis client for the provided code.
JSRedis(String host, int port)Allow getting a Redis client for the specified hostname/port.
JSRedis(String master, String[] sentinels, int timeout, String password)Allow getting a Redis client for the specified Redis Sentinel service list.

Method Summary

Modifier and TypeMethodDescription
boolean addAlias(String index, String name)
long addSynonym(String index, String[] terms)
long del(String[] keys)
long delete(String pattern)
boolean deleteAlias(String index, String name)
String escape(String query)
boolean exists(String code)Allow knowing if a particular the Redis code exists.
int getNumActive()
int getNumIdle()
int getNumWaiters()
RediSearchClient getRediSearch(String indexName)
String hget(String key, String field)
Map hgetAll(String key)WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! perque no es un map ?? Nashorn ha de funcionar amb un map.
long hset(String key, String field, String value)
boolean isReady()
String ping()
String ping(String msg)
long pipeline(Consumer<redis.clients.jedis.Pipeline> consumer)
long sadd(String key, String[] members)
io.redisearch.SearchResult search(String index, String query, Consumer<io.redisearch.Query> options)Ax.
boolean sismember(String key, String member)
String[] smembers(String key)
List sugget(String index, String prefix)Ax.
List sugget(String index, String prefix, int max)
List sugget(String index, String prefix, boolean fuzzy)
List sugget(String index, String prefix, boolean fuzzy, int max)
List sugget(String index, String prefix, boolean fuzzy, boolean scores, boolean payload, int max)
Long suglen(String index)
long sunionstore(String dstkey, String[] keys)
String toString()Return JedisClient toString()
boolean updateAlias(String index, String name)
boolean updateSynonym(String index, long synonymGroupId, String[] terms)
boolean updateSynonym(String index, String synonymGroupId, String[] terms)
long zadd(String key, String subkey, String member)
long zadd(String key, double score, String member)
double zincrby(String key, double increment, String member)
String[] zrange(String key, long start, long stop)
long zrem(String key, String member)
String[] zrevrangeByScore(String key, double max, double min)
String[] zrevrangeByScore(String key, double max, double min, int offset, int count)
long zrevrank(String key, String member)
long zunionstore(String key, String[] sets)

Method Detail

JSRedis

 JSRedis(String code)
Info:
Allow getting a Redis client for the provided code.
Parameters:
code - 

Example
Copy
var client = new Ax.redis.Redis("REDIS1");
   console.log(client.isReady());

JSRedis

 JSRedis(String host, int port)
Info:
Allow getting a Redis client for the specified hostname/port.
Parameters:
host - 
port - 

Example
Copy
var client = new Ax.redis.Redis("192.168.105.173", 6379);
   console.log(client.isReady());

JSRedis

 JSRedis(String master, String[] sentinels, int timeout, String password)
Info:
Allow getting a Redis client for the specified Redis Sentinel service list. Will be used when an AX JavaScript program wants to use a specific sentinel services list (not the ones configured in Studio, for example).
Parameters:
master - 
sentinels - 
timeout - 
password - 

Example
Copy
var client = new Ax.redis.Redis("master1", ["192.168.105.174:8001", "192.168.105.174:8002", "192.168.105.174:8003"], 60, null);
 	 console.log('client is ready? ' + client.isReady())
 	 client.ping();
 	 client.sadd("key_4", ["val_44"]);

addAlias

boolean addAlias(String index, String name)
Parameters:
index - 
name - 
Returns:

addSynonym

long addSynonym(String index, String[] terms)
Parameters:
index - 
terms - 
Returns:

del

long del(String[] keys)
Parameters:
keys - 
Returns:

delete

long delete(String pattern)
Parameters:
pattern - 
Returns:

deleteAlias

boolean deleteAlias(String index, String name)
Parameters:
index - 
name - 
Returns:

escape

                        String escape(String query)
Parameters:
query - 
Returns:

exists

boolean exists(String code)
Info:
Allow knowing if a particular the Redis code exists.
Parameters:
code - 
Returns:
allows javascript to determine if a Redis instance may be created before trying to create an instance of Ax.redis.Redis(). <pre> let code = 'myRedis1'; if (Ax.redis.Redis.exists(code)) { console.log('exists Redis with code ' + code); } </pre>

Example
Copy
let code = 'myRedis1';
   if (Ax.redis.Redis.exists(code)) {
      console.log('exists Redis with code ' + code);
   }

getNumActive

int getNumActive()
Returns:

getNumIdle

int getNumIdle()
Returns:

getNumWaiters

int getNumWaiters()
Returns:

getRediSearch

                        RediSearchClient getRediSearch(String indexName)
Parameters:
indexName - 
Returns:

hget

                        String hget(String key, String field)
Parameters:
key - 
field - 
Returns:

hgetAll

                        Map hgetAll(String key)
Info:
WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! perque no es un map ?? Nashorn ha de funcionar amb un map...
Parameters:
key - 
Returns:
a json object with all the key & values

hset

long hset(String key, String field, String value)
Parameters:
key - 
field - 
value - 
Returns:

isReady

boolean isReady()
Returns:
if Redis server is ready (checked with ping command)

ping

                        String ping()
Returns:

ping

                        String ping(String msg)
Parameters:
msg - 
Returns:

pipeline

long pipeline(Consumer<redis.clients.jedis.Pipeline> consumer)
Parameters:
consumer - 
Returns:

sadd

long sadd(String key, String[] members)
Parameters:
key - 
members - 
Returns:

search

io.redisearch.SearchResult search(String index, String query, Consumer<io.redisearch.Query> options)
Info:
Ax.redis.get().search("indxname", "q..", options =
Parameters:
index - 
query - 
options - 
Returns:

sismember

boolean sismember(String key, String member)
Parameters:
key - 
member - 
Returns:

smembers

                        String[] smembers(String key)
Parameters:
key - 
Returns:

sugget

                        List sugget(String index, String prefix)
Info:
Ax.ext.db.getRedisClient().sugget("sug_test", "pilota"); Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", 10); Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", true); Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", true, 10); //fuzzy //scores //payload //max Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", true, false, true, 10);
Parameters:
index - 
prefix - 
Returns:

sugget

                        List sugget(String index, String prefix, int max)
Parameters:
index - 
prefix - 
max - 
Returns:

sugget

                        List sugget(String index, String prefix, boolean fuzzy)
Parameters:
index - 
prefix - 
fuzzy - 
Returns:

sugget

                        List sugget(String index, String prefix, boolean fuzzy, int max)
Parameters:
index - 
prefix - 
fuzzy - 
max - 
Returns:

sugget

                        List sugget(String index, String prefix, boolean fuzzy, boolean scores, boolean payload, int max)
Parameters:
index - 
prefix - 
fuzzy - 
scores - 
payload - 
max - 
Returns:

suglen

                        Long suglen(String index)
Parameters:
index - 
Returns:

sunionstore

long sunionstore(String dstkey, String[] keys)
Parameters:
dstkey - 
keys - 
Returns:

toString

                        String toString()
Info:
Return JedisClient toString()
Returns:

updateAlias

boolean updateAlias(String index, String name)
Parameters:
index - 
name - 
Returns:

updateSynonym

boolean updateSynonym(String index, long synonymGroupId, String[] terms)
Parameters:
index - 
synonymGroupId - 
terms - 
Returns:

updateSynonym

boolean updateSynonym(String index, String synonymGroupId, String[] terms)
Parameters:
index - 
synonymGroupId - 
terms - 
Returns:

zadd

long zadd(String key, String subkey, String member)
Parameters:
key - 
subkey - 
member - 
Returns:

zadd

long zadd(String key, double score, String member)
Parameters:
key - 
score - 
member - 
Returns:

zincrby

double zincrby(String key, double increment, String member)
Parameters:
key - 
increment - 
member - 
Returns:

zrange

                        String[] zrange(String key, long start, long stop)
Parameters:
key - 
start - 
stop - 
Returns:

zrem

long zrem(String key, String member)
Parameters:
key - 
member - 
Returns:

zrevrangeByScore

                        String[] zrevrangeByScore(String key, double max, double min)
Parameters:
key - 
max - 
min - 
Returns:
a String[] suitable to be processed by Nashorn better than a Set <String>

zrevrangeByScore

                        String[] zrevrangeByScore(String key, double max, double min, int offset, int count)
Parameters:
key - 
max - 
min - 
offset - 
count - 
Returns:
a String[] suitable to be processed by Nashorn better than a Set <String>

zrevrank

long zrevrank(String key, String member)
Parameters:
key - 
member - 
Returns:

zunionstore

long zunionstore(String key, String[] sets)
Parameters:
key - 
sets - 
Returns:

2 Redisearch

2.1 AggregationBuilder

AggregationBuilder documentation page.

2.2 SortedField

SortedField documentation page.

2.3 Reducers

Reducers documentation page.