diff options
author | Avital Fine <98389525+Avital-Fine@users.noreply.github.com> | 2022-05-17 16:44:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 16:44:12 +0300 |
commit | 428510b5786c70a26a8797b8eb33b89777132884 (patch) | |
tree | d0aa536065f3752df1200adbcc582c69c595ec38 | |
parent | a53bc0ca01211e5e14a468077a9d1974dbba6054 (diff) | |
download | redis-py-428510b5786c70a26a8797b8eb33b89777132884.tar.gz |
Fix modules links to https://redis.io/commands/ (#2185)
-rw-r--r-- | redis/commands/bf/commands.py | 66 | ||||
-rw-r--r-- | redis/commands/graph/commands.py | 15 | ||||
-rw-r--r-- | redis/commands/json/commands.py | 47 | ||||
-rw-r--r-- | redis/commands/redismodules.py | 2 | ||||
-rw-r--r-- | redis/commands/search/commands.py | 70 |
5 files changed, 96 insertions, 104 deletions
diff --git a/redis/commands/bf/commands.py b/redis/commands/bf/commands.py index e911efc..21c7857 100644 --- a/redis/commands/bf/commands.py +++ b/redis/commands/bf/commands.py @@ -174,7 +174,7 @@ class CFCommands: ): """ Create a new Cuckoo Filter `key` an initial `capacity` items. - For more information see `CF.RESERVE <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfreserve>`_. + For more information see `CF.RESERVE <https://redis.io/commands/cf.reserve>`_. """ # noqa params = [key, capacity] self.append_expansion(params, expansion) @@ -185,7 +185,7 @@ class CFCommands: def add(self, key, item): """ Add an `item` to a Cuckoo Filter `key`. - For more information see `CF.ADD <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfadd>`_. + For more information see `CF.ADD <https://redis.io/commands/cf.add>`_. """ # noqa params = [key, item] return self.execute_command(CF_ADD, *params) @@ -194,7 +194,7 @@ class CFCommands: """ Add an `item` to a Cuckoo Filter `key` only if item does not yet exist. Command might be slower that `add`. - For more information see `CF.ADDNX <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfaddnx>`_. + For more information see `CF.ADDNX <https://redis.io/commands/cf.addnx>`_. """ # noqa params = [key, item] return self.execute_command(CF_ADDNX, *params) @@ -204,7 +204,7 @@ class CFCommands: Add multiple `items` to a Cuckoo Filter `key`, allowing the filter to be created with a custom `capacity` if it does not yet exist. `items` must be provided as a list. - For more information see `CF.INSERT <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfinsert>`_. + For more information see `CF.INSERT <https://redis.io/commands/cf.insert>`_. """ # noqa params = [key] self.append_capacity(params, capacity) @@ -217,7 +217,7 @@ class CFCommands: Add multiple `items` to a Cuckoo Filter `key` only if they do not exist yet, allowing the filter to be created with a custom `capacity` if it does not yet exist. `items` must be provided as a list. - For more information see `CF.INSERTNX <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfinsertnx>`_. + For more information see `CF.INSERTNX <https://redis.io/commands/cf.insertnx>`_. """ # noqa params = [key] self.append_capacity(params, capacity) @@ -228,7 +228,7 @@ class CFCommands: def exists(self, key, item): """ Check whether an `item` exists in Cuckoo Filter `key`. - For more information see `CF.EXISTS <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfexists>`_. + For more information see `CF.EXISTS <https://redis.io/commands/cf.exists>`_. """ # noqa params = [key, item] return self.execute_command(CF_EXISTS, *params) @@ -236,7 +236,7 @@ class CFCommands: def delete(self, key, item): """ Delete `item` from `key`. - For more information see `CF.DEL <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfdel>`_. + For more information see `CF.DEL <https://redis.io/commands/cf.del>`_. """ # noqa params = [key, item] return self.execute_command(CF_DEL, *params) @@ -244,7 +244,7 @@ class CFCommands: def count(self, key, item): """ Return the number of times an `item` may be in the `key`. - For more information see `CF.COUNT <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfcount>`_. + For more information see `CF.COUNT <https://redis.io/commands/cf.count>`_. """ # noqa params = [key, item] return self.execute_command(CF_COUNT, *params) @@ -258,7 +258,7 @@ class CFCommands: The first time this command is called, the value of `iter` should be 0. This command will return successive (iter, data) pairs until (0, NULL) to indicate completion. - For more information see `CF.SCANDUMP <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfscandump>`_. + For more information see `CF.SCANDUMP <https://redis.io/commands/cf.scandump>`_. """ # noqa params = [key, iter] return self.execute_command(CF_SCANDUMP, *params) @@ -269,7 +269,7 @@ class CFCommands: This command will overwrite any Cuckoo filter stored under key. Ensure that the Cuckoo filter will not be modified between invocations. - For more information see `CF.LOADCHUNK <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfloadchunk>`_. + For more information see `CF.LOADCHUNK <https://redis.io/commands/cf.loadchunk>`_. """ # noqa params = [key, iter, data] return self.execute_command(CF_LOADCHUNK, *params) @@ -278,7 +278,7 @@ class CFCommands: """ Return size, number of buckets, number of filter, number of items inserted, number of items deleted, bucket size, expansion rate, and max iteration. - For more information see `CF.INFO <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfinfo>`_. + For more information see `CF.INFO <https://redis.io/commands/cf.info>`_. """ # noqa return self.execute_command(CF_INFO, key) @@ -290,7 +290,7 @@ class TOPKCommands: """ Create a new Top-K Filter `key` with desired probability of false positives `errorRate` expected entries to be inserted as `size`. - For more information see `TOPK.RESERVE <https://oss.redis.com/redisbloom/master/TopK_Commands/#topkreserve>`_. + For more information see `TOPK.RESERVE <https://redis.io/commands/topk.reserve>`_. """ # noqa params = [key, k, width, depth, decay] return self.execute_command(TOPK_RESERVE, *params) @@ -298,7 +298,7 @@ class TOPKCommands: def add(self, key, *items): """ Add one `item` or more to a Top-K Filter `key`. - For more information see `TOPK.ADD <https://oss.redis.com/redisbloom/master/TopK_Commands/#topkadd>`_. + For more information see `TOPK.ADD <https://redis.io/commands/topk.add>`_. """ # noqa params = [key] params += items @@ -308,7 +308,7 @@ class TOPKCommands: """ Add/increase `items` to a Top-K Sketch `key` by ''increments''. Both `items` and `increments` are lists. - For more information see `TOPK.INCRBY <https://oss.redis.com/redisbloom/master/TopK_Commands/#topkincrby>`_. + For more information see `TOPK.INCRBY <https://redis.io/commands/topk.incrby>`_. Example: @@ -321,7 +321,7 @@ class TOPKCommands: def query(self, key, *items): """ Check whether one `item` or more is a Top-K item at `key`. - For more information see `TOPK.QUERY <https://oss.redis.com/redisbloom/master/TopK_Commands/#topkquery>`_. + For more information see `TOPK.QUERY <https://redis.io/commands/topk.query>`_. """ # noqa params = [key] params += items @@ -330,7 +330,7 @@ class TOPKCommands: def count(self, key, *items): """ Return count for one `item` or more from `key`. - For more information see `TOPK.COUNT <https://oss.redis.com/redisbloom/master/TopK_Commands/#topkcount>`_. + For more information see `TOPK.COUNT <https://redis.io/commands/topk.count>`_. """ # noqa params = [key] params += items @@ -341,7 +341,7 @@ class TOPKCommands: Return full list of items in Top-K list of `key`. If `withcount` set to True, return full list of items with probabilistic count in Top-K list of `key`. - For more information see `TOPK.LIST <https://oss.redis.com/redisbloom/master/TopK_Commands/#topklist>`_. + For more information see `TOPK.LIST <https://redis.io/commands/topk.list>`_. """ # noqa params = [key] if withcount: @@ -351,7 +351,7 @@ class TOPKCommands: def info(self, key): """ Return k, width, depth and decay values of `key`. - For more information see `TOPK.INFO <https://oss.redis.com/redisbloom/master/TopK_Commands/#topkinfo>`_. + For more information see `TOPK.INFO <https://redis.io/commands/topk.info>`_. """ # noqa return self.execute_command(TOPK_INFO, key) @@ -360,7 +360,7 @@ class TDigestCommands: def create(self, key, compression): """ Allocate the memory and initialize the t-digest. - For more information see `TDIGEST.CREATE <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestcreate>`_. + For more information see `TDIGEST.CREATE <https://redis.io/commands/tdigest.create>`_. """ # noqa params = [key, compression] return self.execute_command(TDIGEST_CREATE, *params) @@ -368,7 +368,7 @@ class TDigestCommands: def reset(self, key): """ Reset the sketch `key` to zero - empty out the sketch and re-initialize it. - For more information see `TDIGEST.RESET <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestreset>`_. + For more information see `TDIGEST.RESET <https://redis.io/commands/tdigest.reset>`_. """ # noqa return self.execute_command(TDIGEST_RESET, key) @@ -376,7 +376,7 @@ class TDigestCommands: """ Add one or more samples (value with weight) to a sketch `key`. Both `values` and `weights` are lists. - For more information see `TDIGEST.ADD <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestadd>`_. + For more information see `TDIGEST.ADD <https://redis.io/commands/tdigest.add>`_. Example: @@ -389,7 +389,7 @@ class TDigestCommands: def merge(self, toKey, fromKey): """ Merge all of the values from 'fromKey' to 'toKey' sketch. - For more information see `TDIGEST.MERGE <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestmerge>`_. + For more information see `TDIGEST.MERGE <https://redis.io/commands/tdigest.merge>`_. """ # noqa params = [toKey, fromKey] return self.execute_command(TDIGEST_MERGE, *params) @@ -397,14 +397,14 @@ class TDigestCommands: def min(self, key): """ Return minimum value from the sketch `key`. Will return DBL_MAX if the sketch is empty. - For more information see `TDIGEST.MIN <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestmin>`_. + For more information see `TDIGEST.MIN <https://redis.io/commands/tdigest.min>`_. """ # noqa return self.execute_command(TDIGEST_MIN, key) def max(self, key): """ Return maximum value from the sketch `key`. Will return DBL_MIN if the sketch is empty. - For more information see `TDIGEST.MAX <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestmax>`_. + For more information see `TDIGEST.MAX <https://redis.io/commands/tdigest.max>`_. """ # noqa return self.execute_command(TDIGEST_MAX, key) @@ -412,7 +412,7 @@ class TDigestCommands: """ Return double value estimate of the cutoff such that a specified fraction of the data added to this TDigest would be less than or equal to the cutoff. - For more information see `TDIGEST.QUANTILE <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestquantile>`_. + For more information see `TDIGEST.QUANTILE <https://redis.io/commands/tdigest.quantile>`_. """ # noqa params = [key, quantile] return self.execute_command(TDIGEST_QUANTILE, *params) @@ -420,7 +420,7 @@ class TDigestCommands: def cdf(self, key, value): """ Return double fraction of all points added which are <= value. - For more information see `TDIGEST.CDF <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestcdf>`_. + For more information see `TDIGEST.CDF <https://redis.io/commands/tdigest.cdf>`_. """ # noqa params = [key, value] return self.execute_command(TDIGEST_CDF, *params) @@ -429,7 +429,7 @@ class TDigestCommands: """ Return Compression, Capacity, Merged Nodes, Unmerged Nodes, Merged Weight, Unmerged Weight and Total Compressions. - For more information see `TDIGEST.INFO <https://oss.redis.com/redisbloom/master/TDigest_Commands/#tdigestinfo>`_. + For more information see `TDIGEST.INFO <https://redis.io/commands/tdigest.info>`_. """ # noqa return self.execute_command(TDIGEST_INFO, key) @@ -441,7 +441,7 @@ class CMSCommands: def initbydim(self, key, width, depth): """ Initialize a Count-Min Sketch `key` to dimensions (`width`, `depth`) specified by user. - For more information see `CMS.INITBYDIM <https://oss.redis.com/redisbloom/master/CountMinSketch_Commands/#cmsinitbydim>`_. + For more information see `CMS.INITBYDIM <https://redis.io/commands/cms.initbydim>`_. """ # noqa params = [key, width, depth] return self.execute_command(CMS_INITBYDIM, *params) @@ -449,7 +449,7 @@ class CMSCommands: def initbyprob(self, key, error, probability): """ Initialize a Count-Min Sketch `key` to characteristics (`error`, `probability`) specified by user. - For more information see `CMS.INITBYPROB <https://oss.redis.com/redisbloom/master/CountMinSketch_Commands/#cmsinitbyprob>`_. + For more information see `CMS.INITBYPROB <https://redis.io/commands/cms.initbyprob>`_. """ # noqa params = [key, error, probability] return self.execute_command(CMS_INITBYPROB, *params) @@ -458,7 +458,7 @@ class CMSCommands: """ Add/increase `items` to a Count-Min Sketch `key` by ''increments''. Both `items` and `increments` are lists. - For more information see `CMS.INCRBY <https://oss.redis.com/redisbloom/master/CountMinSketch_Commands/#cmsincrby>`_. + For more information see `CMS.INCRBY <https://redis.io/commands/cms.incrby>`_. Example: @@ -471,7 +471,7 @@ class CMSCommands: def query(self, key, *items): """ Return count for an `item` from `key`. Multiple items can be queried with one call. - For more information see `CMS.QUERY <https://oss.redis.com/redisbloom/master/CountMinSketch_Commands/#cmsquery>`_. + For more information see `CMS.QUERY <https://redis.io/commands/cms.query>`_. """ # noqa params = [key] params += items @@ -483,7 +483,7 @@ class CMSCommands: All sketches must have identical width and depth. `Weights` can be used to multiply certain sketches. Default weight is 1. Both `srcKeys` and `weights` are lists. - For more information see `CMS.MERGE <https://oss.redis.com/redisbloom/master/CountMinSketch_Commands/#cmsmerge>`_. + For more information see `CMS.MERGE <https://redis.io/commands/cms.merge>`_. """ # noqa params = [destKey, numKeys] params += srcKeys @@ -493,6 +493,6 @@ class CMSCommands: def info(self, key): """ Return width, depth and total count of the sketch. - For more information see `CMS.INFO <https://oss.redis.com/redisbloom/master/CountMinSketch_Commands/#cmsinfo>`_. + For more information see `CMS.INFO <https://redis.io/commands/cms.info>`_. """ # noqa return self.execute_command(CMS_INFO, key) diff --git a/redis/commands/graph/commands.py b/redis/commands/graph/commands.py index 2be46cd..fe4224b 100644 --- a/redis/commands/graph/commands.py +++ b/redis/commands/graph/commands.py @@ -12,7 +12,6 @@ class GraphCommands: def commit(self): """ Create entire graph. - For more information see `CREATE <https://oss.redis.com/redisgraph/master/commands/#create>`_. # noqa """ if len(self.nodes) == 0 and len(self.edges) == 0: return None @@ -32,7 +31,7 @@ class GraphCommands: def query(self, q, params=None, timeout=None, read_only=False, profile=False): """ Executes a query against the graph. - For more information see `GRAPH.QUERY <https://oss.redis.com/redisgraph/master/commands/#graphquery>`_. # noqa + For more information see `GRAPH.QUERY <https://redis.io/commands/graph.query>`_. # noqa Args: @@ -95,7 +94,6 @@ class GraphCommands: def merge(self, pattern): """ Merge pattern. - For more information see `MERGE <https://oss.redis.com/redisgraph/master/commands/#merge>`_. # noqa """ query = "MERGE " query += str(pattern) @@ -105,7 +103,7 @@ class GraphCommands: def delete(self): """ Deletes graph. - For more information see `DELETE <https://oss.redis.com/redisgraph/master/commands/#delete>`_. # noqa + For more information see `DELETE <https://redis.io/commands/graph.delete>`_. # noqa """ self._clear_schema() return self.execute_command("GRAPH.DELETE", self.name) @@ -132,7 +130,7 @@ class GraphCommands: for each operation's execution. Return a string representation of a query execution plan, with details on results produced by and time spent in each operation. - For more information see `GRAPH.PROFILE <https://oss.redis.com/redisgraph/master/commands/#graphprofile>`_. # noqa + For more information see `GRAPH.PROFILE <https://redis.io/commands/graph.profile>`_. # noqa """ return self.query(query, profile=True) @@ -140,7 +138,7 @@ class GraphCommands: """ Get a list containing up to 10 of the slowest queries issued against the given graph ID. - For more information see `GRAPH.SLOWLOG <https://oss.redis.com/redisgraph/master/commands/#graphslowlog>`_. # noqa + For more information see `GRAPH.SLOWLOG <https://redis.io/commands/graph.slowlog>`_. # noqa Each item in the list has the following structure: 1. A unix timestamp at which the log entry was processed. @@ -153,7 +151,7 @@ class GraphCommands: def config(self, name, value=None, set=False): """ Retrieve or update a RedisGraph configuration. - For more information see `GRAPH.CONFIG <https://oss.redis.com/redisgraph/master/commands/#graphconfig>`_. # noqa + For more information see `https://redis.io/commands/graph.config-get/>`_. # noqa Args: @@ -177,7 +175,7 @@ class GraphCommands: def list_keys(self): """ Lists all graph keys in the keyspace. - For more information see `GRAPH.LIST <https://oss.redis.com/redisgraph/master/commands/#graphlist>`_. # noqa + For more information see `GRAPH.LIST <https://redis.io/commands/graph.list>`_. # noqa """ return self.execute_command("GRAPH.LIST") @@ -202,6 +200,7 @@ class GraphCommands: """ Get the execution plan for given query, GRAPH.EXPLAIN returns ExecutionPlan object. + For more information see `GRAPH.EXPLAIN <https://redis.io/commands/graph.explain>`_. # noqa Args: query: the query that will be executed diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py index 6588aca..9391c2a 100644 --- a/redis/commands/json/commands.py +++ b/redis/commands/json/commands.py @@ -20,7 +20,7 @@ class JSONCommands: """Append the objects ``args`` to the array under the ``path` in key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonarrappend + For more information see `JSON.ARRAPPEND <https://redis.io/commands/json.arrappend>`_.. """ # noqa pieces = [name, str(path)] for o in args: @@ -42,7 +42,7 @@ class JSONCommands: The search can be limited using the optional inclusive ``start`` and exclusive ``stop`` indices. - For more information: https://oss.redis.com/redisjson/commands/#jsonarrindex + For more information see `JSON.ARRINDEX <https://redis.io/commands/json.arrindex>`_. """ # noqa return self.execute_command( "JSON.ARRINDEX", name, str(path), self._encode(scalar), start, stop @@ -54,7 +54,7 @@ class JSONCommands: """Insert the objects ``args`` to the array at index ``index`` under the ``path` in key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonarrinsert + For more information see `JSON.ARRINSERT <https://redis.io/commands/json.arrinsert>`_. """ # noqa pieces = [name, str(path), index] for o in args: @@ -67,7 +67,7 @@ class JSONCommands: """Return the length of the array JSON value under ``path`` at key``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonarrlen + For more information see `JSON.ARRLEN <https://redis.io/commands/json.arrlen>`_. """ # noqa return self.execute_command("JSON.ARRLEN", name, str(path)) @@ -81,7 +81,7 @@ class JSONCommands: """Pop the element at ``index`` in the array JSON value under ``path`` at key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonarrpop + For more information see `JSON.ARRPOP <https://redis.io/commands/json.arrpop>`_. """ # noqa return self.execute_command("JSON.ARRPOP", name, str(path), index) @@ -91,21 +91,21 @@ class JSONCommands: """Trim the array JSON value under ``path`` at key ``name`` to the inclusive range given by ``start`` and ``stop``. - For more information: https://oss.redis.com/redisjson/commands/#jsonarrtrim + For more information see `JSON.ARRTRIM <https://redis.io/commands/json.arrtrim>`_. """ # noqa return self.execute_command("JSON.ARRTRIM", name, str(path), start, stop) def type(self, name: str, path: Optional[str] = Path.root_path()) -> List[str]: """Get the type of the JSON value under ``path`` from key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsontype + For more information see `JSON.TYPE <https://redis.io/commands/json.type>`_. """ # noqa return self.execute_command("JSON.TYPE", name, str(path)) def resp(self, name: str, path: Optional[str] = Path.root_path()) -> List: """Return the JSON value under ``path`` at key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonresp + For more information see `JSON.RESP <https://redis.io/commands/json.resp>`_. """ # noqa return self.execute_command("JSON.RESP", name, str(path)) @@ -115,7 +115,7 @@ class JSONCommands: """Return the key names in the dictionary JSON value under ``path`` at key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonobjkeys + For more information see `JSON.OBJKEYS <https://redis.io/commands/json.objkeys>`_. """ # noqa return self.execute_command("JSON.OBJKEYS", name, str(path)) @@ -123,7 +123,7 @@ class JSONCommands: """Return the length of the dictionary JSON value under ``path`` at key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonobjlen + For more information see `JSON.OBJLEN <https://redis.io/commands/json.objlen>`_. """ # noqa return self.execute_command("JSON.OBJLEN", name, str(path)) @@ -131,7 +131,7 @@ class JSONCommands: """Increment the numeric (integer or floating point) JSON value under ``path`` at key ``name`` by the provided ``number``. - For more information: https://oss.redis.com/redisjson/commands/#jsonnumincrby + For more information see `JSON.NUMINCRBY <https://redis.io/commands/json.numincrby>`_. """ # noqa return self.execute_command( "JSON.NUMINCRBY", name, str(path), self._encode(number) @@ -142,28 +142,27 @@ class JSONCommands: """Multiply the numeric (integer or floating point) JSON value under ``path`` at key ``name`` with the provided ``number``. - For more information: https://oss.redis.com/redisjson/commands/#jsonnummultby + For more information see `JSON.NUMMULTBY <https://redis.io/commands/json.nummultby>`_. """ # noqa return self.execute_command( "JSON.NUMMULTBY", name, str(path), self._encode(number) ) def clear(self, name: str, path: Optional[str] = Path.root_path()) -> int: - """ - Empty arrays and objects (to have zero slots/keys without deleting the + """Empty arrays and objects (to have zero slots/keys without deleting the array/object). Return the count of cleared paths (ignoring non-array and non-objects paths). - For more information: https://oss.redis.com/redisjson/commands/#jsonclear + For more information see `JSON.CLEAR <https://redis.io/commands/json.clear>`_. """ # noqa return self.execute_command("JSON.CLEAR", name, str(path)) def delete(self, key: str, path: Optional[str] = Path.root_path()) -> int: """Delete the JSON value stored at key ``key`` under ``path``. - For more information: https://oss.redis.com/redisjson/commands/#jsondel + For more information see `JSON.DEL <https://redis.io/commands/json.del>`_. """ return self.execute_command("JSON.DEL", key, str(path)) @@ -180,7 +179,7 @@ class JSONCommands: ```no_escape`` is a boolean flag to add no_escape option to get non-ascii characters - For more information: https://oss.redis.com/redisjson/commands/#jsonget + For more information see `JSON.GET <https://redis.io/commands/json.get>`_. """ # noqa pieces = [name] if no_escape: @@ -205,7 +204,7 @@ class JSONCommands: Get the objects stored as a JSON values under ``path``. ``keys`` is a list of one or more keys. - For more information: https://oss.redis.com/redisjson/commands/#jsonmget + For more information see `JSON.MGET <https://redis.io/commands/json.mget>`_. """ # noqa pieces = [] pieces += keys @@ -230,9 +229,9 @@ class JSONCommands: with utf-8. For the purpose of using this within a pipeline, this command is also - aliased to jsonset. + aliased to JSON.SET. - For more information: https://oss.redis.com/redisjson/commands/#jsonset + For more information see `JSON.SET <https://redis.io/commands/json.set>`_. """ if decode_keys: obj = decode_dict_keys(obj) @@ -318,7 +317,7 @@ class JSONCommands: """Return the length of the string JSON value under ``path`` at key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsonstrlen + For more information see `JSON.STRLEN <https://redis.io/commands/json.strlen>`_. """ # noqa pieces = [name] if path is not None: @@ -331,7 +330,7 @@ class JSONCommands: """Toggle boolean value under ``path`` at key ``name``. returning the new value. - For more information: https://oss.redis.com/redisjson/commands/#jsontoggle + For more information see `JSON.TOGGLE <https://redis.io/commands/json.toggle>`_. """ # noqa return self.execute_command("JSON.TOGGLE", name, str(path)) @@ -342,7 +341,7 @@ class JSONCommands: the key name, the path is determined to be the first. If a single option is passed, then the root_path (i.e Path.root_path()) is used. - For more information: https://oss.redis.com/redisjson/commands/#jsonstrappend + For more information see `JSON.STRAPPEND <https://redis.io/commands/json.strappend>`_. """ # noqa pieces = [name, str(path), self._encode(value)] return self.execute_command("JSON.STRAPPEND", *pieces) @@ -356,7 +355,7 @@ class JSONCommands: """Return the memory usage in bytes of a value under ``path`` from key ``name``. - For more information: https://oss.redis.com/redisjson/commands/#jsondebug + For more information see `JSON.DEBUG <https://redis.io/commands/json.debug>`_. """ # noqa valid_subcommands = ["MEMORY", "HELP"] if subcommand not in valid_subcommands: diff --git a/redis/commands/redismodules.py b/redis/commands/redismodules.py index c0238d3..875f3fc 100644 --- a/redis/commands/redismodules.py +++ b/redis/commands/redismodules.py @@ -3,7 +3,7 @@ from json import JSONDecoder, JSONEncoder class RedisModuleCommands: """This class contains the wrapper functions to bring supported redis - modules into the command namepsace. + modules into the command namespace. """ def json(self, encoder=JSONEncoder(), decoder=JSONDecoder()): diff --git a/redis/commands/search/commands.py b/redis/commands/search/commands.py index 3413fc1..5a9f6fe 100644 --- a/redis/commands/search/commands.py +++ b/redis/commands/search/commands.py @@ -104,7 +104,7 @@ class SearchCommands: in the index. - **skip_initial_scan**: If true, we do not scan and index. - For more information: https://oss.redis.com/redisearch/Commands/#ftcreate + For more information see `FT.CREATE <https://redis.io/commands/ft.create>`_. """ # noqa args = [CREATE_CMD, self.index_name] @@ -147,7 +147,7 @@ class SearchCommands: - **fields**: a list of Field objects to add for the index - For more information: https://oss.redis.com/redisearch/Commands/#ftalter_schema_add + For more information see `FT.ALTER <https://redis.io/commands/ft.alter>`_. """ # noqa args = [ALTER_CMD, self.index_name, "SCHEMA", "ADD"] @@ -167,7 +167,8 @@ class SearchCommands: ### Parameters: - **delete_documents**: If `True`, all documents will be deleted. - For more information: https://oss.redis.com/redisearch/Commands/#ftdropindex + + For more information see `FT.DROPINDEX <https://redis.io/commands/ft.dropindex>`_. """ # noqa keep_str = "" if delete_documents else "KEEPDOCS" return self.execute_command(DROP_CMD, self.index_name, keep_str) @@ -278,8 +279,6 @@ class SearchCommands: - **fields** kwargs dictionary of the document fields to be saved and/or indexed. NOTE: Geo points shoule be encoded as strings of "lon,lat" - - For more information: https://oss.redis.com/redisearch/Commands/#ftadd """ # noqa return self._add_document( doc_id, @@ -312,8 +311,6 @@ class SearchCommands: - **replace**: if True, and the document already is in the index, we perform an update and reindex the document - **language**: Specify the language used for document tokenization. - - For more information: https://oss.redis.com/redisearch/Commands/#ftaddhash """ # noqa return self._add_document_hash( doc_id, @@ -332,8 +329,6 @@ class SearchCommands: - **delete_actual_document**: if set to True, RediSearch also delete the actual document if it is in the index - - For more information: https://oss.redis.com/redisearch/Commands/#ftdel """ # noqa args = [DEL_CMD, self.index_name, doc_id] if delete_actual_document: @@ -367,7 +362,6 @@ class SearchCommands: - **ids**: the ids of the saved documents. - For more information https://oss.redis.com/redisearch/Commands/#ftget """ return self.execute_command(MGET_CMD, self.index_name, *ids) @@ -377,7 +371,7 @@ class SearchCommands: Get info an stats about the the current index, including the number of documents, memory consumption, etc - For more information https://oss.redis.com/redisearch/Commands/#ftinfo + For more information see `FT.INFO <https://redis.io/commands/ft.info>`_. """ res = self.execute_command(INFO_CMD, self.index_name) @@ -423,7 +417,7 @@ class SearchCommands: default parameters, or a Query object for complex queries. See RediSearch's documentation on query format - For more information: https://oss.redis.com/redisearch/Commands/#ftsearch + For more information see `FT.SEARCH <https://redis.io/commands/ft.search>`_. """ # noqa args, query = self._mk_query_args(query, query_params=query_params) st = time.time() @@ -447,7 +441,7 @@ class SearchCommands: ): """Returns the execution plan for a complex query. - For more information: https://oss.redis.com/redisearch/Commands/#ftexplain + For more information see `FT.EXPLAIN <https://redis.io/commands/ft.explain>`_. """ # noqa args, query_text = self._mk_query_args(query, query_params=query_params) return self.execute_command(EXPLAIN_CMD, *args) @@ -470,7 +464,7 @@ class SearchCommands: An `AggregateResult` object is returned. You can access the rows from its `rows` property, which will always yield the rows of the result. - For more information: https://oss.redis.com/redisearch/Commands/#ftaggregate + For more information see `FT.AGGREGATE <https://redis.io/commands/ft.aggregate>`_. """ # noqa if isinstance(query, AggregateRequest): has_cursor = bool(query._cursor) @@ -560,7 +554,7 @@ class SearchCommands: **include**: specifies an inclusion custom dictionary. **exclude**: specifies an exclusion custom dictionary. - For more information: https://oss.redis.com/redisearch/Commands/#ftspellcheck + For more information see `FT.SPELLCHECK <https://redis.io/commands/ft.spellcheck>`_. """ # noqa cmd = [SPELLCHECK_CMD, self.index_name, query] if distance: @@ -618,7 +612,7 @@ class SearchCommands: - **name**: Dictionary name. - **terms**: List of items for adding to the dictionary. - For more information: https://oss.redis.com/redisearch/Commands/#ftdictadd + For more information see `FT.DICTADD <https://redis.io/commands/ft.dictadd>`_. """ # noqa cmd = [DICT_ADD_CMD, name] cmd.extend(terms) @@ -632,7 +626,7 @@ class SearchCommands: - **name**: Dictionary name. - **terms**: List of items for removing from the dictionary. - For more information: https://oss.redis.com/redisearch/Commands/#ftdictdel + For more information see `FT.DICTDEL <https://redis.io/commands/ft.dictdel>`_. """ # noqa cmd = [DICT_DEL_CMD, name] cmd.extend(terms) @@ -645,7 +639,7 @@ class SearchCommands: - **name**: Dictionary name. - For more information: https://oss.redis.com/redisearch/Commands/#ftdictdump + For more information see `FT.DICTDUMP <https://redis.io/commands/ft.dictdump>`_. """ # noqa cmd = [DICT_DUMP_CMD, name] return self.execute_command(*cmd) @@ -658,7 +652,7 @@ class SearchCommands: - **option**: the name of the configuration option. - **value**: a value for the configuration option. - For more information: https://oss.redis.com/redisearch/Commands/#ftconfig + For more information see `FT.CONFIG SET <https://redis.io/commands/ft.config-set>`_. """ # noqa cmd = [CONFIG_CMD, "SET", option, value] raw = self.execute_command(*cmd) @@ -671,7 +665,7 @@ class SearchCommands: - **option**: the name of the configuration option. - For more information: https://oss.redis.com/redisearch/Commands/#ftconfig + For more information see `FT.CONFIG GET <https://redis.io/commands/ft.config-get>`_. """ # noqa cmd = [CONFIG_CMD, "GET", option] res = {} @@ -689,7 +683,7 @@ class SearchCommands: - **tagfield**: Tag field name - For more information: https://oss.redis.com/redisearch/Commands/#fttagvals + For more information see `FT.TAGVALS <https://redis.io/commands/ft.tagvals>`_. """ # noqa return self.execute_command(TAGVALS_CMD, self.index_name, tagfield) @@ -702,7 +696,7 @@ class SearchCommands: - **alias**: Name of the alias to create - For more information: https://oss.redis.com/redisearch/Commands/#ftaliasadd + For more information see `FT.ALIASADD <https://redis.io/commands/ft.aliasadd>`_. """ # noqa return self.execute_command(ALIAS_ADD_CMD, alias, self.index_name) @@ -715,7 +709,7 @@ class SearchCommands: - **alias**: Name of the alias to create - For more information: https://oss.redis.com/redisearch/Commands/#ftaliasupdate + For more information see `FT.ALIASUPDATE <https://redis.io/commands/ft.aliasupdate>`_. """ # noqa return self.execute_command(ALIAS_UPDATE_CMD, alias, self.index_name) @@ -728,7 +722,7 @@ class SearchCommands: - **alias**: Name of the alias to delete - For more information: https://oss.redis.com/redisearch/Commands/#ftaliasdel + For more information see `FT.ALIASDEL <https://redis.io/commands/ft.aliasdel>`_. """ # noqa return self.execute_command(ALIAS_DEL_CMD, alias) @@ -739,7 +733,7 @@ class SearchCommands: If kwargs["increment"] is true and the terms are already in the server's dictionary, we increment their scores. - For more information: https://oss.redis.com/redisearch/master/Commands/#ftsugadd + For more information see `FT.SUGADD <https://redis.io/commands/ft.sugadd/>`_. """ # noqa # If Transaction is not False it will MULTI/EXEC which will error pipe = self.pipeline(transaction=False) @@ -759,7 +753,7 @@ class SearchCommands: """ Return the number of entries in the AutoCompleter index. - For more information https://oss.redis.com/redisearch/master/Commands/#ftsuglen + For more information see `FT.SUGLEN <https://redis.io/commands/ft.suglen>`_. """ # noqa return self.execute_command(SUGLEN_COMMAND, key) @@ -768,7 +762,7 @@ class SearchCommands: Delete a string from the AutoCompleter index. Returns 1 if the string was found and deleted, 0 otherwise. - For more information: https://oss.redis.com/redisearch/master/Commands/#ftsugdel + For more information see `FT.SUGDEL <https://redis.io/commands/ft.sugdel>`_. """ # noqa return self.execute_command(SUGDEL_COMMAND, key, string) @@ -804,7 +798,7 @@ class SearchCommands: A list of Suggestion objects. If with_scores was False, the score of all suggestions is 1. - For more information: https://oss.redis.com/redisearch/master/Commands/#ftsugget + For more information see `FT.SUGGET <https://redis.io/commands/ft.sugget>`_. """ # noqa args = [SUGGET_COMMAND, key, prefix, "MAX", num] if fuzzy: @@ -838,7 +832,7 @@ class SearchCommands: terms : The terms. - For more information: https://oss.redis.com/redisearch/Commands/#ftsynupdate + For more information see `FT.SYNUPDATE <https://redis.io/commands/ft.synupdate>`_. """ # noqa cmd = [SYNUPDATE_CMD, self.index_name, groupid] if skipinitial: @@ -853,7 +847,7 @@ class SearchCommands: The command is used to dump the synonyms data structure. Returns a list of synonym terms and their synonym group ids. - For more information: https://oss.redis.com/redisearch/Commands/#ftsyndump + For more information see `FT.SYNDUMP <https://redis.io/commands/ft.syndump>`_. """ # noqa raw = self.execute_command(SYNDUMP_CMD, self.index_name) return {raw[i]: raw[i + 1] for i in range(0, len(raw), 2)} @@ -865,7 +859,7 @@ class AsyncSearchCommands(SearchCommands): Get info an stats about the the current index, including the number of documents, memory consumption, etc - For more information https://oss.redis.com/redisearch/Commands/#ftinfo + For more information see `FT.INFO <https://redis.io/commands/ft.info>`_. """ res = await self.execute_command(INFO_CMD, self.index_name) @@ -886,7 +880,7 @@ class AsyncSearchCommands(SearchCommands): default parameters, or a Query object for complex queries. See RediSearch's documentation on query format - For more information: https://oss.redis.com/redisearch/Commands/#ftsearch + For more information see `FT.SEARCH <https://redis.io/commands/ft.search>`_. """ # noqa args, query = self._mk_query_args(query, query_params=query_params) st = time.time() @@ -918,7 +912,7 @@ class AsyncSearchCommands(SearchCommands): An `AggregateResult` object is returned. You can access the rows from its `rows` property, which will always yield the rows of the result. - For more information: https://oss.redis.com/redisearch/Commands/#ftaggregate + For more information see `FT.AGGREGATE <https://redis.io/commands/ft.aggregate>`_. """ # noqa if isinstance(query, AggregateRequest): has_cursor = bool(query._cursor) @@ -946,7 +940,7 @@ class AsyncSearchCommands(SearchCommands): **include**: specifies an inclusion custom dictionary. **exclude**: specifies an exclusion custom dictionary. - For more information: https://oss.redis.com/redisearch/Commands/#ftspellcheck + For more information see `FT.SPELLCHECK <https://redis.io/commands/ft.spellcheck>`_. """ # noqa cmd = [SPELLCHECK_CMD, self.index_name, query] if distance: @@ -989,7 +983,7 @@ class AsyncSearchCommands(SearchCommands): - **option**: the name of the configuration option. - **value**: a value for the configuration option. - For more information: https://oss.redis.com/redisearch/Commands/#ftconfig + For more information see `FT.CONFIG SET <https://redis.io/commands/ft.config-set>`_. """ # noqa cmd = [CONFIG_CMD, "SET", option, value] raw = await self.execute_command(*cmd) @@ -1002,7 +996,7 @@ class AsyncSearchCommands(SearchCommands): - **option**: the name of the configuration option. - For more information: https://oss.redis.com/redisearch/Commands/#ftconfig + For more information see `FT.CONFIG GET <https://redis.io/commands/ft.config-get>`_. """ # noqa cmd = [CONFIG_CMD, "GET", option] res = {} @@ -1034,7 +1028,7 @@ class AsyncSearchCommands(SearchCommands): If kwargs["increment"] is true and the terms are already in the server's dictionary, we increment their scores. - For more information: https://oss.redis.com/redisearch/master/Commands/#ftsugadd + For more information see `FT.SUGADD <https://redis.io/commands/ft.sugadd>`_. """ # noqa # If Transaction is not False it will MULTI/EXEC which will error pipe = self.pipeline(transaction=False) @@ -1082,7 +1076,7 @@ class AsyncSearchCommands(SearchCommands): A list of Suggestion objects. If with_scores was False, the score of all suggestions is 1. - For more information: https://oss.redis.com/redisearch/master/Commands/#ftsugget + For more information see `FT.SUGGET <https://redis.io/commands/ft.sugget>`_. """ # noqa args = [SUGGET_COMMAND, key, prefix, "MAX", num] if fuzzy: |