url
stringlengths
38
157
content
stringlengths
72
15.1M
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-database/.html
<section class="prose w-full py-12 max-w-none"> <h1> Enable a module for a database </h1> <p> Modules add additional functionality to Redis databases for specific use cases. You can enable modules when you create a database. </p> <h2 id="prerequisites"> Prerequisites </h2> <ul> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster/"> Installed the module on the cluster </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/"> Upgraded the module </a> to the latest version </li> </ul> <h2 id="create-a-database-with-a-module"> Create a database with a module </h2> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> You can only add modules to a database when you first create it. You cannot add modules to an existing database. </div> </div> <p> In the Redis Enterprise Cluster Manager UI, follow these steps to add modules to a database: </p> <ol> <li> <p> From the <strong> Databases </strong> screen, select <strong> Quick database </strong> or <strong> Create database </strong> . </p> </li> <li> <p> In the <strong> Capabilities </strong> section, select one or more capabilities: </p> <a href="/docs/latest/images/rs/screenshots/databases/quick-db-capabilities-7-8-2.png" sdata-lightbox="/images/rs/screenshots/databases/quick-db-capabilities-7-8-2.png"> <img alt="Select which capabilities to add to your database." src="/docs/latest/images/rs/screenshots/databases/quick-db-capabilities-7-8-2.png"/> </a> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> You cannot use RediSearch 1.x and RediSearch 2.x in the same database. </div> </div> </li> <li> <p> To use custom configuration for capabilities: </p> <ol> <li> <p> Select <strong> Parameters </strong> . </p> </li> <li> <p> Enter the <a href="#module-configuration-options"> configuration options </a> . </p> </li> <li> <p> Select <strong> Done </strong> . </p> </li> </ol> </li> <li> <p> Configure additional database settings. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Depending on the <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/enterprise-capabilities/#module-feature-support"> features supported by an enabled module </a> , certain database configuration fields may not be available. </div> </div> </li> <li> <p> Select <strong> Create </strong> . </p> </li> </ol> <h2 id="module-configuration-options"> Module configuration options </h2> <ul> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/config/"> RediSearch configuration options </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/timeseries/config/"> RedisTimeSeries configuration options </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/config/"> RedisBloom configuration options </a> </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-database/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin status </h1> <p class="text-lg -mt-5 mb-10"> Displays the current cluster status and topology information. </p> <p> Displays the current cluster status and topology information. </p> <h2 id="status"> <code> status </code> </h2> <p> Displays the current status of all nodes, databases, database endpoints, and shards on the cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin status </span></span><span class="line"><span class="cl"> <span class="o">[</span> extra &lt;parameter&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> issues_only<span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra &lt;parameter&gt; </td> <td> Extra options that show more information </td> </tr> <tr> <td> issues_only </td> <td> Filters out all items that have an <code> OK </code> status </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Extra parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra all </td> <td> Shows all <code> extra </code> information </td> </tr> <tr> <td> extra backups </td> <td> Shows periodic backup status </td> </tr> <tr> <td> extra frag </td> <td> Shows fragmented memory available after the restart </td> </tr> <tr> <td> extra nodestats </td> <td> Shows shards per node </td> </tr> <tr> <td> extra rack_id </td> <td> Shows <code> rack_id </code> if customer is not <code> rack_aware </code> </td> </tr> <tr> <td> extra redis_version </td> <td> Shows Redis version of all databases in the cluster </td> </tr> <tr> <td> extra state_machine </td> <td> Shows execution of state machine information </td> </tr> <tr> <td> extra watchdog </td> <td> Shows watchdog status </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns tables of the status of all nodes, databases, and database endpoints on the cluster. </p> <p> If <code> issues_only </code> is specified, it only shows instances that do not have an <code> OK </code> status. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status extra all </span></span><span class="line"><span class="cl">CLUSTER: </span></span><span class="line"><span class="cl">OK. Cluster master: <span class="m">1</span> <span class="o">(</span>198.51.100.2<span class="o">)</span> </span></span><span class="line"><span class="cl">Cluster health: OK, <span class="o">[</span>1, 0.13333333333333333, 0.03333333333333333<span class="o">]</span> </span></span><span class="line"><span class="cl">failures/minute - avg1 1.00, avg15 0.13, avg60 0.03. </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">CLUSTER NODES: </span></span><span class="line"><span class="cl">NODE:ID ROLE ADDRESS EXTERNAL_ADDRESS HOSTNAME MASTERS SLAVES OVERBOOKING_DEPTH SHARDS CORES FREE_RAM PROVISIONAL_RAM VERSION SHA RACK-ID STATUS </span></span><span class="line"><span class="cl">node:1 master 198.51.100.2 3d99db1fdf4b <span class="m">4</span> <span class="m">0</span> 10.91GB 4/100 <span class="m">6</span> 14.91GB/19.54GB 10.91GB/16.02GB 6.2.12-37 5c2106 - OK </span></span><span class="line"><span class="cl">node:2 slave 198.51.100.3 fc7a3d332458 <span class="m">0</span> <span class="m">0</span> 11.4GB 0/100 <span class="m">6</span> 14.91GB/19.54GB 11.4GB/16.02GB 6.2.12-37 5c2106 - OK </span></span><span class="line"><span class="cl">*node:3 slave 198.51.100.4 b87cc06c830f <span class="m">0</span> <span class="m">0</span> 11.4GB 0/100 <span class="m">6</span> 14.91GB/19.54GB 11.4GB/16.02GB 6.2.12-37 5c2106 - OK </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">DATABASES: </span></span><span class="line"><span class="cl">DB:ID NAME TYPE STATUS SHARDS PLACEMENT REPLICATION PERSISTENCE ENDPOINT EXEC_STATE EXEC_STATE_MACHINE BACKUP_PROGRESS MISSING_BACKUP_TIME REDIS_VERSION </span></span><span class="line"><span class="cl">db:3 database3 redis active <span class="m">4</span> dense disabled disabled redis-11103.cluster.local:11103 N/A N/A N/A N/A 6.0.16 </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">ENDPOINTS: </span></span><span class="line"><span class="cl">DB:ID NAME ID NODE ROLE SSL WATCHDOG_STATUS </span></span><span class="line"><span class="cl">db:3 database3 endpoint:3:1 node:1 single No OK </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">SHARDS: </span></span><span class="line"><span class="cl">DB:ID NAME ID NODE ROLE SLOTS USED_MEMORY BACKUP_PROGRESS RAM_FRAG WATCHDOG_STATUS STATUS </span></span><span class="line"><span class="cl">db:3 database3 redis:4 node:1 master 0-4095 2.08MB N/A 4.73MB OK OK </span></span><span class="line"><span class="cl">db:3 database3 redis:5 node:1 master 4096-8191 2.08MB N/A 4.62MB OK OK </span></span><span class="line"><span class="cl">db:3 database3 redis:6 node:1 master 8192-12287 2.08MB N/A 4.59MB OK OK </span></span><span class="line"><span class="cl">db:3 database3 redis:7 node:1 master 12288-16383 2.08MB N/A 4.66MB OK OK </span></span></code></pre> </div> <h2 id="status-databases"> <code> status databases </code> </h2> <p> Displays the current status of all databases on the cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin status databases </span></span><span class="line"><span class="cl"> <span class="o">[</span> extra &lt;parameters&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> sort &lt;column_titles&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> issues_only <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-1"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra &lt;parameter&gt; </td> <td> Extra options that show more information </td> </tr> <tr> <td> sort &lt;column_titles&gt; </td> <td> Sort results by specified column titles </td> </tr> <tr> <td> issues_only </td> <td> Filters out all items that have an <code> OK </code> status </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Extra parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra all </td> <td> Shows all <code> extra </code> information </td> </tr> <tr> <td> extra backups </td> <td> Shows periodic backup status </td> </tr> <tr> <td> extra frag </td> <td> Shows fragmented memory available after the restart </td> </tr> <tr> <td> extra nodestats </td> <td> Shows shards per node </td> </tr> <tr> <td> extra rack_id </td> <td> Shows <code> rack_id </code> if customer is not <code> rack_aware </code> </td> </tr> <tr> <td> extra redis_version </td> <td> Shows Redis version of all databases in the cluster </td> </tr> <tr> <td> extra state_machine </td> <td> Shows execution of state machine information </td> </tr> <tr> <td> extra watchdog </td> <td> Shows watchdog status </td> </tr> </tbody> </table> <h3 id="returns-1"> Returns </h3> <p> Returns a table of the status of all databases on the cluster. </p> <p> If <code> sort &lt;column_titles&gt; </code> is specified, the result is sorted by the specified table columns. </p> <p> If <code> issues_only </code> is specified, it only shows databases that do not have an <code> OK </code> status. </p> <h3 id="example-1"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status databases sort REPLICATION PERSISTENCE </span></span><span class="line"><span class="cl">DB:ID NAME TYPE STATUS SHARDS PLACEMENT REPLICATION PERSISTENCE ENDPOINT </span></span><span class="line"><span class="cl">db:1 database1 redis active <span class="m">1</span> dense disabled disabled redis-10269.testdbd11169.localhost:10269 </span></span><span class="line"><span class="cl">db:2 database2 redis active <span class="m">1</span> dense disabled snapshot redis-13897.testdbd11169.localhost:13897 </span></span><span class="line"><span class="cl">db:3 database3 redis active <span class="m">1</span> dense enabled snapshot redis-19416.testdbd13186.localhost:19416 </span></span></code></pre> </div> <h2 id="status-endpoints"> <code> status endpoints </code> </h2> <p> Displays the current status of all endpoints on the cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin status endpoints </span></span><span class="line"><span class="cl"> <span class="o">[</span> node &lt;id&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> db <span class="o">{</span> db:&lt;id&gt; <span class="p">|</span> &lt;name&gt; <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> extra &lt;parameters&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> sort &lt;column_titles&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> issues_only <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-2"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> node &lt;id&gt; </td> <td> Only show endpoints for the specified node ID </td> </tr> <tr> <td> db db:&lt;id&gt; </td> <td> Only show endpoints for the specified database ID </td> </tr> <tr> <td> db &lt;name&gt; </td> <td> Only show endpoints for the specified database name </td> </tr> <tr> <td> extra &lt;parameter&gt; </td> <td> Extra options that show more information </td> </tr> <tr> <td> sort &lt;column_titles&gt; </td> <td> Sort results by specified column titles </td> </tr> <tr> <td> issues_only </td> <td> Filters out all items that have an <code> OK </code> status </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Extra parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra all </td> <td> Shows all <code> extra </code> information </td> </tr> <tr> <td> extra backups </td> <td> Shows periodic backup status </td> </tr> <tr> <td> extra frag </td> <td> Shows fragmented memory available after the restart </td> </tr> <tr> <td> extra nodestats </td> <td> Shows shards per node </td> </tr> <tr> <td> extra rack_id </td> <td> Shows <code> rack_id </code> if customer is not <code> rack_aware </code> </td> </tr> <tr> <td> extra redis_version </td> <td> Shows Redis version of all endpoints in the cluster </td> </tr> <tr> <td> extra state_machine </td> <td> Shows execution of state machine information </td> </tr> <tr> <td> extra watchdog </td> <td> Shows watchdog status </td> </tr> </tbody> </table> <h3 id="returns-2"> Returns </h3> <p> Returns a table of the status of all endpoints on the cluster. </p> <p> If <code> sort &lt;column_titles&gt; </code> is specified, the result is sorted by the specified table columns. </p> <p> If <code> issues_only </code> is specified, it only shows endpoints that do not have an <code> OK </code> status. </p> <h3 id="example-2"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status endpoints </span></span><span class="line"><span class="cl">DB:ID NAME ID NODE ROLE SSL </span></span><span class="line"><span class="cl">db:1 database1 endpoint:1:1 node:1 single No </span></span><span class="line"><span class="cl">db:2 database2 endpoint:2:1 node:2 single No </span></span><span class="line"><span class="cl">db:3 database3 endpoint:3:1 node:3 single No </span></span></code></pre> </div> <h2 id="status-modules"> <code> status modules </code> </h2> <p> Displays the current status of modules installed on the cluster and modules used by databases. This information is not included in the combined status report returned by <a href="#status"> <code> rladmin status </code> </a> . </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin status modules </span></span><span class="line"><span class="cl"> <span class="o">[</span> db <span class="o">{</span> db:&lt;id1&gt; <span class="p">|</span> &lt;name1&gt; <span class="o">}</span> ... <span class="o">{</span> db:&lt;idN&gt; <span class="p">|</span> &lt;nameN&gt; <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> extra <span class="o">{</span> all <span class="p">|</span> min_redis_version <span class="p">|</span> module_id <span class="o">}</span> <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-3"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> db db:&lt;id&gt; </td> <td> Provide a list of database IDs to show only modules used by the specified databases <br/> (for example: <code> rladmin status modules db db:1 db:2 </code> ) </td> </tr> <tr> <td> db &lt;name&gt; </td> <td> Provide a list of database names to show only modules used by the specified databases <br/> (for example: <code> rladmin status modules db name1 name2 </code> ) </td> </tr> <tr> <td> extra all </td> <td> Shows all extra information </td> </tr> <tr> <td> extra module_id </td> <td> Shows module IDs </td> </tr> <tr> <td> extra min_redis_version </td> <td> Shows the minimum compatible Redis database version for each module </td> </tr> </tbody> </table> <h3 id="returns-3"> Returns </h3> <p> Returns the status of modules installed on the cluster and modules used by databases. </p> <h3 id="example-3"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status modules extra all </span></span><span class="line"><span class="cl">CLUSTER MODULES: </span></span><span class="line"><span class="cl">MODULE VERSION MIN_REDIS_VERSION ID </span></span><span class="line"><span class="cl">RedisBloom 2.4.5 6.0 1b895a180592cbcae5bd3bff6af24be2 </span></span><span class="line"><span class="cl">RedisBloom 2.6.8 7.1 95264e7c9ac9540268c115c86a94659b </span></span><span class="line"><span class="cl">RediSearch <span class="m">2</span> 2.6.12 6.0 2c000539f65272f7a2712ed3662c2b6b </span></span><span class="line"><span class="cl">RediSearch <span class="m">2</span> 2.8.9 7.1 dd9a75710db528afa691767e9310ac6f </span></span><span class="line"><span class="cl">RedisGears 2.0.15 7.1 18c83d024b8ee22e7caf030862026ca6 </span></span><span class="line"><span class="cl">RedisGraph 2.10.12 6.0 5a1f2fdedb8f6ca18f81371ea8d28f68 </span></span><span class="line"><span class="cl">RedisJSON 2.4.7 6.0 28308b101a0203c21fa460e7eeb9344a </span></span><span class="line"><span class="cl">RedisJSON 2.6.8 7.1 b631b6a863edde1b53b2f7a27a49c004 </span></span><span class="line"><span class="cl">RedisTimeSeries 1.8.11 6.0 8fe09b00f56afe5dba160d234a6606af </span></span><span class="line"><span class="cl">RedisTimeSeries 1.10.9 7.1 98a492a017ea6669a162fd3503bf31f3 </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">DATABASE MODULES: </span></span><span class="line"><span class="cl">DB:ID NAME MODULE VERSION ARGS STATUS </span></span><span class="line"><span class="cl">db:1 search-json-db RediSearch <span class="m">2</span> 2.8.9 PARTITIONS AUTO OK </span></span><span class="line"><span class="cl">db:1 search-json-db RedisJSON 2.6.8 OK </span></span><span class="line"><span class="cl">db:2 timeseries-db RedisTimeSeries 1.10.9 OK </span></span></code></pre> </div> <h2 id="status-nodes"> <code> status nodes </code> </h2> <p> Displays the current status of all nodes on the cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin status nodes </span></span><span class="line"><span class="cl"> <span class="o">[</span> extra &lt;parameters&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> sort &lt;column_titles&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> issues_only <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-4"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra &lt;parameter&gt; </td> <td> Extra options that show more information </td> </tr> <tr> <td> sort &lt;column_titles&gt; </td> <td> Sort results by specified column titles </td> </tr> <tr> <td> issues_only </td> <td> Filters out all items that have an <code> OK </code> status </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Extra parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra all </td> <td> Shows all <code> extra </code> information </td> </tr> <tr> <td> extra backups </td> <td> Shows periodic backup status </td> </tr> <tr> <td> extra frag </td> <td> Shows fragmented memory available after the restart </td> </tr> <tr> <td> extra nodestats </td> <td> Shows shards per node </td> </tr> <tr> <td> extra rack_id </td> <td> Shows <code> rack_id </code> if customer is not <code> rack_aware </code> </td> </tr> <tr> <td> extra redis_version </td> <td> Shows Redis version of all nodes in the cluster </td> </tr> <tr> <td> extra state_machine </td> <td> Shows execution of state machine information </td> </tr> <tr> <td> extra watchdog </td> <td> Shows watchdog status </td> </tr> </tbody> </table> <h3 id="returns-4"> Returns </h3> <p> Returns a table of the status of all nodes on the cluster. </p> <p> If <code> sort &lt;column_titles&gt; </code> is specified, the result is sorted by the specified table columns. </p> <p> If <code> issues_only </code> is specified, it only shows nodes that do not have an <code> OK </code> status. </p> <h3 id="example-4"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status nodes sort PROVISIONAL_RAM HOSTNAME </span></span><span class="line"><span class="cl">CLUSTER NODES: </span></span><span class="line"><span class="cl">NODE:ID ROLE ADDRESS EXTERNAL_ADDRESS HOSTNAME SHARDS CORES FREE_RAM PROVISIONAL_RAM VERSION STATUS </span></span><span class="line"><span class="cl">node:1 master 198.51.100.2 3d99db1fdf4b 4/100 <span class="m">6</span> 14.74GB/19.54GB 10.73GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">*node:3 slave 198.51.100.4 b87cc06c830f 0/100 <span class="m">6</span> 14.74GB/19.54GB 11.22GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:2 slave 198.51.100.3 fc7a3d332458 0/100 <span class="m">6</span> 14.74GB/19.54GB 11.22GB/16.02GB 6.2.12-37 OK </span></span></code></pre> </div> <h2 id="status-shards"> <code> status shards </code> </h2> <p> Displays the current status of all shards on the cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin status shards </span></span><span class="line"><span class="cl"> <span class="o">[</span> node &lt;id&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> db <span class="o">{</span>db:&lt;id&gt; <span class="p">|</span> &lt;name&gt;<span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> extra &lt;parameters&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> sort &lt;column_titles&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> issues_only <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-5"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> node &lt;id&gt; </td> <td> Only show shards for the specified node ID </td> </tr> <tr> <td> db db:&lt;id&gt; </td> <td> Only show shards for the specified database ID </td> </tr> <tr> <td> db &lt;name&gt; </td> <td> Only show shards for the specified database name </td> </tr> <tr> <td> extra &lt;parameter&gt; </td> <td> Extra options that show more information </td> </tr> <tr> <td> sort &lt;column_titles&gt; </td> <td> Sort results by specified column titles </td> </tr> <tr> <td> issues_only </td> <td> Filters out all items that have an <code> OK </code> status </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Extra parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> extra all </td> <td> Shows all <code> extra </code> information </td> </tr> <tr> <td> extra backups </td> <td> Shows periodic backup status </td> </tr> <tr> <td> extra frag </td> <td> Shows fragmented memory available after the restart </td> </tr> <tr> <td> extra shardstats </td> <td> Shows shards per node </td> </tr> <tr> <td> extra rack_id </td> <td> Shows <code> rack_id </code> if customer is not <code> rack_aware </code> </td> </tr> <tr> <td> extra redis_version </td> <td> Shows Redis version of all shards in the cluster </td> </tr> <tr> <td> extra state_machine </td> <td> Shows execution of state machine information </td> </tr> <tr> <td> extra watchdog </td> <td> Shows watchdog status </td> </tr> </tbody> </table> <h3 id="returns-5"> Returns </h3> <p> Returns a table of the status of all shards on the cluster. </p> <p> If <code> sort &lt;column_titles&gt; </code> is specified, the result is sorted by the specified table columns. </p> <p> If <code> issues_only </code> is specified, it only shows shards that do not have an <code> OK </code> status. </p> <h3 id="example-5"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status shards sort USED_MEMORY ID </span></span><span class="line"><span class="cl">SHARDS: </span></span><span class="line"><span class="cl">DB:ID NAME ID NODE ROLE SLOTS USED_MEMORY STATUS </span></span><span class="line"><span class="cl">db:3 database3 redis:6 node:1 master 8192-12287 2.04MB OK </span></span><span class="line"><span class="cl">db:3 database3 redis:4 node:1 master 0-4095 2.08MB OK </span></span><span class="line"><span class="cl">db:3 database3 redis:5 node:1 master 4096-8191 2.08MB OK </span></span><span class="line"><span class="cl">db:3 database3 redis:7 node:1 master 12288-16383 2.08MB OK </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/expiretime/.html
<section class="prose w-full py-12"> <h1 class="command-name"> EXPIRETIME </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">EXPIRETIME key</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 7.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @keyspace </code> <span class="mr-1 last:hidden"> , </span> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire. </p> <p> See also the <a href="/docs/latest/commands/pexpiretime/"> <code> PEXPIRETIME </code> </a> command which returns the same information with milliseconds resolution. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SET mykey "Hello" "OK" redis&gt; EXPIREAT mykey 33177117420 (integer) 1 redis&gt; EXPIRETIME mykey (integer) 33177117420 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the expiration Unix timestamp in seconds. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> -1 </code> if the key exists but has no associated expiration time. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> -2 </code> if the key does not exist. </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/expiretime/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ft.info/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FT.INFO </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FT.INFO index</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/interact/search-and-query"> Search 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> </dl> <p> Returns information and statistics about a given index. </p> <h2 id="required-arguments"> Required arguments </h2> <p> <code> index </code> <br/> is the name of the given index. You must first create the index using <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> . </p> <h2 id="resp-reply"> RESP reply </h2> <p> <code> FT.INFO </code> returns an array reply with pairs of keys and values. </p> <h2 id="returned-values"> Returned values </h2> <h3 id="general"> General </h3> <table> <thead> <tr> <th style="text-align:left"> Return field name </th> <th style="text-align:left"> Definition </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <code> index_name </code> </td> <td style="text-align:left"> The index name that was defined when index was created. </td> </tr> <tr> <td style="text-align:left"> <code> index_options </code> </td> <td style="text-align:left"> The index options selected during <code> FT.CREATE </code> such as <code> FILTER {filter} </code> , <code> LANGUAGE {default_lang} </code> , etc. </td> </tr> <tr> <td style="text-align:left"> <code> index_definition </code> </td> <td style="text-align:left"> Includes <code> key_type </code> , hash or JSON; <code> prefixes </code> , if any; and <code> default_score </code> . </td> </tr> <tr> <td style="text-align:left"> <code> attributes </code> </td> <td style="text-align:left"> The index schema field names, types, and attributes. </td> </tr> <tr> <td style="text-align:left"> <code> num_docs </code> </td> <td style="text-align:left"> The number of documents. </td> </tr> <tr> <td style="text-align:left"> <code> max_doc_id </code> </td> <td style="text-align:left"> The maximum document ID. </td> </tr> <tr> <td style="text-align:left"> <code> num_terms </code> </td> <td style="text-align:left"> The number of distinct terms. </td> </tr> <tr> <td style="text-align:left"> <code> num_records </code> </td> <td style="text-align:left"> The total number of records. </td> </tr> </tbody> </table> <h3 id="various-size-statistics"> Various size statistics </h3> <table> <thead> <tr> <th style="text-align:left"> Statistic </th> <th style="text-align:left"> Definition </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <code> inverted_sz_mb </code> </td> <td style="text-align:left"> The memory used by the inverted index, which is the core data structure used for searching in RediSearch. The size is given in megabytes. </td> </tr> <tr> <td style="text-align:left"> <code> vector_index_sz_mb </code> </td> <td style="text-align:left"> The memory used by the vector index, which stores any vectors associated with each document. </td> </tr> <tr> <td style="text-align:left"> <code> total_inverted_index_blocks </code> </td> <td style="text-align:left"> The total number of blocks in the inverted index. </td> </tr> <tr> <td style="text-align:left"> <code> offset_vectors_sz_mb </code> </td> <td style="text-align:left"> The memory used by the offset vectors, which store positional information for terms in documents. </td> </tr> <tr> <td style="text-align:left"> <code> doc_table_size_mb </code> </td> <td style="text-align:left"> The memory used by the document table, which contains metadata about each document in the index. </td> </tr> <tr> <td style="text-align:left"> <code> sortable_values_size_mb </code> </td> <td style="text-align:left"> The memory used by sortable values, which are values associated with documents and used for sorting purposes. </td> </tr> <tr> <td style="text-align:left"> <code> key_table_size_mb </code> </td> <td style="text-align:left"> The memory used by the key table, which stores the mapping between document IDs and Redis keys. </td> </tr> <tr> <td style="text-align:left"> <code> geoshapes_sz_mb </code> </td> <td style="text-align:left"> The memory used by GEO-related fields. </td> </tr> <tr> <td style="text-align:left"> <code> records_per_doc_avg </code> </td> <td style="text-align:left"> The average number of records (including deletions) per document. </td> </tr> <tr> <td style="text-align:left"> <code> bytes_per_record_avg </code> </td> <td style="text-align:left"> The average size of each record in bytes. </td> </tr> <tr> <td style="text-align:left"> <code> offsets_per_term_avg </code> </td> <td style="text-align:left"> The average number of offsets (position information) per term. </td> </tr> <tr> <td style="text-align:left"> <code> offset_bits_per_record_avg </code> </td> <td style="text-align:left"> The average number of bits used for offsets per record. </td> </tr> </tbody> </table> <h3 id="indexing-related-statistics"> Indexing-related statistics </h3> <table> <thead> <tr> <th style="text-align:left"> Statistic </th> <th style="text-align:left"> Definition </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <code> hash_indexing_failures </code> </td> <td style="text-align:left"> The number of failures encountered during indexing. </td> </tr> <tr> <td style="text-align:left"> <code> total_indexing_time </code> </td> <td style="text-align:left"> The total time taken for indexing in seconds. </td> </tr> <tr> <td style="text-align:left"> <code> indexing </code> </td> <td style="text-align:left"> Indicates whether the index is currently being generated. </td> </tr> <tr> <td style="text-align:left"> <code> percent_indexed </code> </td> <td style="text-align:left"> The percentage of the index that has been successfully generated (1 means 100%). </td> </tr> <tr> <td style="text-align:left"> <code> number_of_uses </code> </td> <td style="text-align:left"> The number of times the index has been used. </td> </tr> <tr> <td style="text-align:left"> <code> cleaning </code> </td> <td style="text-align:left"> The index deletion flag. A value of <code> 1 </code> indicates index deletion is in progress. </td> </tr> </tbody> </table> <h3 id="garbage-collection-statistics"> Garbage collection statistics </h3> <table> <thead> <tr> <th style="text-align:left"> Statistic </th> <th style="text-align:left"> Definition </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <code> bytes_collected </code> </td> <td style="text-align:left"> The number of bytes collected during garbage collection. </td> </tr> <tr> <td style="text-align:left"> <code> total_ms_run </code> </td> <td style="text-align:left"> The total time in milliseconds spent on garbage collection. </td> </tr> <tr> <td style="text-align:left"> <code> total_cycles </code> </td> <td style="text-align:left"> The total number of garbage collection cycles. </td> </tr> <tr> <td style="text-align:left"> <code> average_cycle_time_ms </code> </td> <td style="text-align:left"> The average time in milliseconds for each garbage collection cycle. The value <code> nan </code> indicates that the average cycle time is not available. </td> </tr> <tr> <td style="text-align:left"> <code> last_run_time_ms </code> </td> <td style="text-align:left"> The time in milliseconds taken by the last garbage collection run. </td> </tr> </tbody> </table> <p> The next two GC-related fields are relevant in scenarios where simultaneous changes occurred in the same memory area for both the parent process and the child process, resulting in the parent discarding these changes. </p> <table> <thead> <tr> <th style="text-align:left"> Statistic </th> <th style="text-align:left"> Definition </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <code> gc_numeric_trees_missed </code> </td> <td style="text-align:left"> The number of numeric tree nodes whose changes were discarded due to splitting by the parent process during garbage collection. </td> </tr> <tr> <td style="text-align:left"> <code> gc_blocks_denied </code> </td> <td style="text-align:left"> The number of blocks whose changes were discarded (skipped) because they were modified by the parent process during the garbage collection. Notably, as inverted index blocks are append-only, only the last block of an inverted index can be skipped. </td> </tr> </tbody> </table> <h3 id="cursor-statistics"> Cursor statistics </h3> <table> <thead> <tr> <th style="text-align:left"> Statistic </th> <th style="text-align:left"> Definition </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <code> global_idle </code> </td> <td style="text-align:left"> The number of idle cursors in the system. </td> </tr> <tr> <td style="text-align:left"> <code> global_total </code> </td> <td style="text-align:left"> The total number of cursors in the system. </td> </tr> <tr> <td style="text-align:left"> <code> index_capacity </code> </td> <td style="text-align:left"> The maximum number of cursors allowed per index. </td> </tr> <tr> <td style="text-align:left"> <code> index_total </code> </td> <td style="text-align:left"> The total number of cursors open on the index. </td> </tr> </tbody> </table> <h3 id="other-statistics"> Other statistics </h3> <ul> <li> Dialect statistics: the number of times the index was searched using each DIALECT, 1 - 4. </li> <li> Index error statistics, including <code> indexing failures </code> , <code> last indexing error </code> , and <code> last indexing error key </code> . </li> <li> Field statistics, including <code> indexing failures </code> , <code> last indexing error </code> , and <code> last indexing error key </code> for each schema field. </li> </ul> <h2 id="example"> Example </h2> <details open=""> <summary> <b> Return statistics about an index </b> </summary> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; ft.info idx:bicycle </span></span><span class="line"><span class="cl"> 1<span class="o">)</span> index_name </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> idx:bicycle </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> index_options </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="o">(</span>empty array<span class="o">)</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> index_definition </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> key_type </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> JSON </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> prefixes </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> 1<span class="o">)</span> bicycle: </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> default_score </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> attributes </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.pickup_zone </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> pickup_zone </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="nb">type</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> GEOSHAPE </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> coord_system </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> SPHERICAL </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.store_location </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> store_location </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="nb">type</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> GEO </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.brand </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> brand </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="nb">type</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> TEXT </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> WEIGHT </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.model </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> model </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="nb">type</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> TEXT </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> WEIGHT </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.description </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> description </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="nb">type</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> TEXT </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> WEIGHT </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.price </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> price </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="nb">type</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> NUMERIC </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.condition </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> condition </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="nb">type</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> TAG </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> SEPARATOR </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> , </span></span><span class="line"><span class="cl"> 9<span class="o">)</span> num_docs </span></span><span class="line"><span class="cl">10<span class="o">)</span> <span class="s2">"10"</span> </span></span><span class="line"><span class="cl">11<span class="o">)</span> max_doc_id </span></span><span class="line"><span class="cl">12<span class="o">)</span> <span class="s2">"10"</span> </span></span><span class="line"><span class="cl">13<span class="o">)</span> num_terms </span></span><span class="line"><span class="cl">14<span class="o">)</span> <span class="s2">"546"</span> </span></span><span class="line"><span class="cl">15<span class="o">)</span> num_records </span></span><span class="line"><span class="cl">16<span class="o">)</span> <span class="s2">"692"</span> </span></span><span class="line"><span class="cl">17<span class="o">)</span> inverted_sz_mb </span></span><span class="line"><span class="cl">18<span class="o">)</span> <span class="s2">"0.003993034362792969"</span> </span></span><span class="line"><span class="cl">19<span class="o">)</span> vector_index_sz_mb </span></span><span class="line"><span class="cl">20<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl">21<span class="o">)</span> total_inverted_index_blocks </span></span><span class="line"><span class="cl">22<span class="o">)</span> <span class="s2">"551"</span> </span></span><span class="line"><span class="cl">23<span class="o">)</span> offset_vectors_sz_mb </span></span><span class="line"><span class="cl">24<span class="o">)</span> <span class="s2">"7.047653198242188e-4"</span> </span></span><span class="line"><span class="cl">25<span class="o">)</span> doc_table_size_mb </span></span><span class="line"><span class="cl">26<span class="o">)</span> <span class="s2">"7.152557373046875e-4"</span> </span></span><span class="line"><span class="cl">27<span class="o">)</span> sortable_values_size_mb </span></span><span class="line"><span class="cl">28<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl">29<span class="o">)</span> key_table_size_mb </span></span><span class="line"><span class="cl">30<span class="o">)</span> <span class="s2">"3.0422210693359375e-4"</span> </span></span><span class="line"><span class="cl">31<span class="o">)</span> geoshapes_sz_mb </span></span><span class="line"><span class="cl">32<span class="o">)</span> <span class="s2">"0.00426483154296875"</span> </span></span><span class="line"><span class="cl">33<span class="o">)</span> records_per_doc_avg </span></span><span class="line"><span class="cl">34<span class="o">)</span> <span class="s2">"69.19999694824219"</span> </span></span><span class="line"><span class="cl">35<span class="o">)</span> bytes_per_record_avg </span></span><span class="line"><span class="cl">36<span class="o">)</span> <span class="s2">"6.0505781173706055"</span> </span></span><span class="line"><span class="cl">37<span class="o">)</span> offsets_per_term_avg </span></span><span class="line"><span class="cl">38<span class="o">)</span> <span class="s2">"1.0679190158843994"</span> </span></span><span class="line"><span class="cl">39<span class="o">)</span> offset_bits_per_record_avg </span></span><span class="line"><span class="cl">40<span class="o">)</span> <span class="s2">"8"</span> </span></span><span class="line"><span class="cl">41<span class="o">)</span> hash_indexing_failures </span></span><span class="line"><span class="cl">42<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl">43<span class="o">)</span> total_indexing_time </span></span><span class="line"><span class="cl">44<span class="o">)</span> <span class="s2">"4.539999961853027"</span> </span></span><span class="line"><span class="cl">45<span class="o">)</span> indexing </span></span><span class="line"><span class="cl">46<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl">47<span class="o">)</span> percent_indexed </span></span><span class="line"><span class="cl">48<span class="o">)</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl">49<span class="o">)</span> number_of_uses </span></span><span class="line"><span class="cl">50<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">51<span class="o">)</span> cleaning </span></span><span class="line"><span class="cl">52<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl">53<span class="o">)</span> gc_stats </span></span><span class="line"><span class="cl">54<span class="o">)</span> 1<span class="o">)</span> bytes_collected </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> total_ms_run </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> total_cycles </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> average_cycle_time_ms </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="s2">"nan"</span> </span></span><span class="line"><span class="cl"> 9<span class="o">)</span> last_run_time_ms </span></span><span class="line"><span class="cl"> 10<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl"> 11<span class="o">)</span> gc_numeric_trees_missed </span></span><span class="line"><span class="cl"> 12<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl"> 13<span class="o">)</span> gc_blocks_denied </span></span><span class="line"><span class="cl"> 14<span class="o">)</span> <span class="s2">"0"</span> </span></span><span class="line"><span class="cl">55<span class="o">)</span> cursor_stats </span></span><span class="line"><span class="cl">56<span class="o">)</span> 1<span class="o">)</span> global_idle </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> global_total </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> index_capacity </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">128</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> index_total </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl">57<span class="o">)</span> dialect_stats </span></span><span class="line"><span class="cl">58<span class="o">)</span> 1<span class="o">)</span> dialect_1 </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> dialect_2 </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> dialect_3 </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> dialect_4 </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl">59<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl">60<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span> </span></span><span class="line"><span class="cl">61<span class="o">)</span> field statistics </span></span><span class="line"><span class="cl">62<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.pickup_zone </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> pickup_zone </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.store_location </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> store_location </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.brand </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> brand </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span> </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.model </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> model </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.description </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> description </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.price </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> price </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> 1<span class="o">)</span> identifier </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> $.condition </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> attribute </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> condition </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Index Errors </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> indexing failures </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> last indexing error </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> N/A </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> last indexing error key </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"N/A"</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ft.create/"> <code> FT.CREATE </code> </a> | <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/interact/search-and-query/"> RediSearch </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft.info/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ft.suglen/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FT.SUGLEN </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FT.SUGLEN key </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/interact/search-and-query"> Search 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> </dl> <p> Get the size of an auto-complete suggestion dictionary </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is suggestion dictionary key. </p> </details> <h2 id="return"> Return </h2> <p> FT.SUGLEN returns an integer reply, which is the current size of the suggestion dictionary. </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Get the size of an auto-complete suggestion dictionary </b> </summary> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.SUGLEN sug </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ft.sugadd/"> <code> FT.SUGADD </code> </a> | <a href="/docs/latest/commands/ft.sugdel/"> <code> FT.SUGDEL </code> </a> | <a href="/docs/latest/commands/ft.sugget/"> <code> FT.SUGGET </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/interact/search-and-query/"> RediSearch </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft.suglen/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/data-types/timeseries/quickstart.html
<section class="prose w-full py-12"> <h1> Quickstart </h1> <p class="text-lg -mt-5 mb-10"> Quick Start Guide to Time Series </p> <h2 id="setup"> Setup </h2> <p> You can get RedisTimeSeries setup in the cloud, in a Docker container or on your own machine. </p> <h3 id="redis-cloud"> Redis Cloud </h3> <p> Redis Time Series are available on all Redis Cloud managed services, including a completely free managed database up to 30MB. </p> <p> <a href="https://redislabs.com/try-free/"> Get started here </a> </p> <h3 id="docker"> Docker </h3> <p> To quickly try out Redis Time Series, launch an instance of Redis Stack using docker: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">docker run -p 6379:6379 -it --rm redis/redis-stack-server </span></span></code></pre> </div> <h3 id="download-and-running-binaries"> Download and running binaries </h3> <p> First download the pre-compiled version from the <a href="https://redis.io/downloads"> Redis download center </a> . </p> <p> Next, run Redis with RedisTimeSeries: </p> <pre tabindex="0"><code>$ redis-server --loadmodule /path/to/module/redistimeseries.so </code></pre> <h3 id="build-and-run-it-yourself"> Build and Run it yourself </h3> <p> You can also build and run RedisTimeSeries on your own machine. </p> <p> Major Linux distributions as well as macOS are supported. </p> <h4 id="requirements"> Requirements </h4> <p> First, clone the RedisTimeSeries repository from git: </p> <pre tabindex="0"><code>git clone --recursive https://github.com/RedisTimeSeries/RedisTimeSeries.git </code></pre> <p> Then, to install required build artifacts, invoke the following: </p> <pre tabindex="0"><code>cd RedisTimeSeries make setup </code></pre> <p> Or you can install required dependencies manually listed in <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/blob/master/sbin/system-setup.py"> system-setup.py </a> . </p> <p> If <code> make </code> is not yet available, the following commands are equivalent: </p> <pre tabindex="0"><code>./deps/readies/bin/getpy3 ./system-setup.py </code></pre> <p> Note that <code> system-setup.py </code> <strong> will install various packages on your system </strong> using the native package manager and pip. This requires root permissions (i.e. sudo) on Linux. </p> <p> If you prefer to avoid that, you can: </p> <ul> <li> Review system-setup.py and install packages manually, </li> <li> Utilize a Python virtual environment, </li> <li> Use Docker with the <code> --volume </code> option to create an isolated build environment. </li> </ul> <h4 id="build"> Build </h4> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make build </span></span></code></pre> </div> <p> Binary artifacts are placed under the <code> bin </code> directory. </p> <h4 id="run"> Run </h4> <p> In your redis-server run: <code> loadmodule bin/redistimeseries.so </code> </p> <p> For more information about modules, go to the <a href="/docs/latest/develop/reference/modules/"> redis official documentation </a> . </p> <h2 id="give-it-a-try-with-redis-cli"> Give it a try with <code> redis-cli </code> </h2> <p> After you setup RedisTimeSeries, you can interact with it using redis-cli. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ redis-cli </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE sensor1 </span></span><span class="line"><span class="cl">OK </span></span></code></pre> </div> <h2 id="creating-a-timeseries"> Creating a timeseries </h2> <p> A new timeseries can be created with the <a href="/docs/latest/commands/ts.create/"> <code> TS.CREATE </code> </a> command; for example, to create a timeseries named <code> sensor1 </code> run the following: </p> <pre tabindex="0"><code>TS.CREATE sensor1 </code></pre> <p> You can prevent your timeseries growing indefinitely by setting a maximum age for samples compared to the last event time (in milliseconds) with the <code> RETENTION </code> option. The default value for retention is <code> 0 </code> , which means the series will not be trimmed. </p> <pre tabindex="0"><code>TS.CREATE sensor1 RETENTION 2678400000 </code></pre> <p> This will create a timeseries called <code> sensor1 </code> and trim it to values of up to one month. </p> <h2 id="adding-data-points"> Adding data points </h2> <p> For adding new data points to a timeseries we use the <a href="/docs/latest/commands/ts.add/"> <code> TS.ADD </code> </a> command: </p> <pre tabindex="0"><code>TS.ADD key timestamp value </code></pre> <p> The <code> timestamp </code> argument is the UNIX timestamp of the sample in milliseconds and <code> value </code> is the numeric data value of the sample. </p> <p> Example: </p> <pre tabindex="0"><code>TS.ADD sensor1 1626434637914 26 </code></pre> <p> To <strong> add a datapoint with the current timestamp </strong> you can use a <code> * </code> instead of a specific timestamp: </p> <pre tabindex="0"><code>TS.ADD sensor1 * 26 </code></pre> <p> You can <strong> append data points to multiple timeseries </strong> at the same time with the <a href="/docs/latest/commands/ts.madd/"> <code> TS.MADD </code> </a> command: </p> <pre tabindex="0"><code>TS.MADD key timestamp value [key timestamp value ...] </code></pre> <h2 id="deleting-data-points"> Deleting data points </h2> <p> Data points between two timestamps (inclusive) can be deleted with the <a href="/docs/latest/commands/ts.del/"> <code> TS.DEL </code> </a> command: </p> <pre tabindex="0"><code>TS.DEL key fromTimestamp toTimestamp </code></pre> <p> Example: </p> <pre tabindex="0"><code>TS.DEL sensor1 1000 2000 </code></pre> <p> To delete a single timestamp, use it as both the "from" and "to" timestamp: </p> <pre tabindex="0"><code>TS.DEL sensor1 1000 1000 </code></pre> <p> <strong> Note: </strong> When a sample is deleted, the data in all downsampled timeseries will be recalculated for the specific bucket. If part of the bucket has already been removed though, because it's outside of the retention period, we won't be able to recalculate the full bucket, so in those cases we will refuse the delete operation. </p> <h2 id="labels"> Labels </h2> <p> Labels are key-value metadata we attach to data points, allowing us to group and filter. They can be either string or numeric values and are added to a timeseries on creation: </p> <pre tabindex="0"><code>TS.CREATE sensor1 LABELS region east </code></pre> <h2 id="compaction"> Compaction </h2> <p> Another useful feature of Redis Time Series is compacting data by creating a rule for compaction ( <a href="/docs/latest/commands/ts.createrule/"> <code> TS.CREATERULE </code> </a> ). For example, if you have collected more than one billion data points in a day, you could aggregate the data by every minute in order to downsample it, thereby reducing the dataset size to 24 * 60 = 1,440 data points. You can choose one of the many available aggregation types in order to aggregate multiple data points from a certain minute into a single one. The currently supported aggregation types are: <code> avg, sum, min, max, range, count, first, last, std.p, std.s, var.p, var.s and twa </code> . </p> <p> It's important to point out that there is no data rewriting on the original timeseries; the compaction happens in a new series, while the original one stays the same. In order to prevent the original timeseries from growing indefinitely, you can use the retention option, which will trim it down to a certain period of time. </p> <p> <strong> NOTE: </strong> You need to create the destination (the compacted) timeseries before creating the rule. </p> <pre tabindex="0"><code>TS.CREATERULE sourceKey destKey AGGREGATION aggregationType bucketDuration </code></pre> <p> Example: </p> <pre tabindex="0"><code>TS.CREATE sensor1_compacted # Create the destination timeseries first TS.CREATERULE sensor1 sensor1_compacted AGGREGATION avg 60000 # Create the rule </code></pre> <p> With this creation rule, datapoints added to the <code> sensor1 </code> timeseries will be grouped into buckets of 60 seconds (60000ms), averaged, and saved in the <code> sensor1_compacted </code> timeseries. </p> <h2 id="filtering"> Filtering </h2> <p> You can filter your time series by value, timestamp and labels: </p> <h3 id="filtering-by-label"> Filtering by label </h3> <p> You can retrieve datapoints from multiple timeseries in the same query, and the way to do this is by using label filters. For example: </p> <pre tabindex="0"><code>TS.MRANGE - + FILTER area_id=32 </code></pre> <p> This query will show data from all sensors (timeseries) that have a label of <code> area_id </code> with a value of <code> 32 </code> . The results will be grouped by timeseries. </p> <p> Or we can also use the <a href="/docs/latest/commands/ts.mget/"> <code> TS.MGET </code> </a> command to get the last sample that matches the specific filter: </p> <pre tabindex="0"><code>TS.MGET FILTER area_id=32 </code></pre> <h3 id="filtering-by-value"> Filtering by value </h3> <p> We can filter by value across a single or multiple timeseries: </p> <pre tabindex="0"><code>TS.RANGE sensor1 - + FILTER_BY_VALUE 25 30 </code></pre> <p> This command will return all data points whose value sits between 25 and 30, inclusive. </p> <p> To achieve the same filtering on multiple series we have to combine the filtering by value with filtering by label: </p> <pre tabindex="0"><code>TS.MRANGE - + FILTER_BY_VALUE 20 30 FILTER region=east </code></pre> <h3 id="filtering-by-timestamp"> Filtering by timestamp </h3> <p> To retrieve the datapoints for specific timestamps on one or multiple timeseries we can use the <code> FILTER_BY_TS </code> argument: </p> <p> Filter on one timeseries: </p> <pre tabindex="0"><code>TS.RANGE sensor1 - + FILTER_BY_TS 1626435230501 1626443276598 </code></pre> <p> Filter on multiple timeseries: </p> <pre tabindex="0"><code>TS.MRANGE - + FILTER_BY_TS 1626435230501 1626443276598 FILTER region=east </code></pre> <h2 id="aggregation"> Aggregation </h2> <p> It's possible to combine values of one or more timeseries by leveraging aggregation functions: </p> <pre tabindex="0"><code>TS.RANGE ... AGGREGATION aggType bucketDuration... </code></pre> <p> For example, to find the average temperature per hour in our <code> sensor1 </code> series we could run: </p> <pre tabindex="0"><code>TS.RANGE sensor1 - + + AGGREGATION avg 3600000 </code></pre> <p> To achieve the same across multiple sensors from the area with id of 32 we would run: </p> <pre tabindex="0"><code>TS.MRANGE - + AGGREGATION avg 3600000 FILTER area_id=32 </code></pre> <h3 id="aggregation-bucket-alignment"> Aggregation bucket alignment </h3> <p> When doing aggregations, the aggregation buckets will be aligned to 0 as so: </p> <pre tabindex="0"><code>TS.RANGE sensor3 10 70 + AGGREGATION min 25 </code></pre> <pre tabindex="0"><code>Value: | (1000) (2000) (3000) (4000) (5000) (6000) (7000) Timestamp: |-------|10|-------|20|-------|30|-------|40|-------|50|-------|60|-------|70|---&gt; Bucket(25ms): |_________________________||_________________________||___________________________| V V V min(1000, 2000)=1000 min(3000, 4000)=3000 min(5000, 6000, 7000)=5000 </code></pre> <p> And we will get the following datapoints: 1000, 3000, 5000. </p> <p> You can choose to align the buckets to the start or end of the queried interval as so: </p> <pre tabindex="0"><code>TS.RANGE sensor3 10 70 + AGGREGATION min 25 ALIGN start </code></pre> <pre tabindex="0"><code>Value: | (1000) (2000) (3000) (4000) (5000) (6000) (7000) Timestamp: |-------|10|-------|20|-------|30|-------|40|-------|50|-------|60|-------|70|---&gt; Bucket(25ms): |__________________________||_________________________||___________________________| V V V min(1000, 2000, 3000)=1000 min(4000, 5000)=4000 min(6000, 7000)=6000 </code></pre> <p> The result array will contain the following datapoints: 1000, 4000 and 6000 </p> <h3 id="aggregation-across-timeseries"> Aggregation across timeseries </h3> <p> By default, results of multiple timeseries will be grouped by timeseries, but (since v1.6) you can use the <code> GROUPBY </code> and <code> REDUCE </code> options to group them by label and apply an additional aggregation. </p> <p> To find minimum temperature per region, for example, we can run: </p> <pre tabindex="0"><code>TS.MRANGE - + FILTER region=(east,west) GROUPBY region REDUCE min </code></pre> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/data-types/timeseries/quickstart/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/get-started/vector-database.html
<section class="prose w-full py-12"> <h1> Redis as a vector database quick start guide </h1> <p class="text-lg -mt-5 mb-10"> Understand how to use Redis as a vector database </p> <p> This quick start guide helps you to: </p> <ol> <li> Understand what a vector database is </li> <li> Create a Redis vector database </li> <li> Create vector embeddings and store vectors </li> <li> Query data and perform a vector search </li> </ol> <h2 id="understand-vector-databases"> Understand vector databases </h2> <p> Data is often unstructured, which means that it isn't described by a well-defined schema. Examples of unstructured data include text passages, images, videos, or audio. One approach to storing and searching through unstructured data is to use vector embeddings. </p> <p> <strong> What are vectors? </strong> In machine learning and AI, vectors are sequences of numbers that represent data. They are the inputs and outputs of models, encapsulating underlying information in a numerical form. Vectors transform unstructured data, such as text, images, videos, and audio, into a format that machine learning models can process. </p> <ul> <li> <strong> Why are they important? </strong> Vectors capture complex patterns and semantic meanings inherent in data, making them powerful tools for a variety of applications. They allow machine learning models to understand and manipulate unstructured data more effectively. </li> <li> <strong> Enhancing traditional search. </strong> Traditional keyword or lexical search relies on exact matches of words or phrases, which can be limiting. In contrast, vector search, or semantic search, leverages the rich information captured in vector embeddings. By mapping data into a vector space, similar items are positioned near each other based on their meaning. This approach allows for more accurate and meaningful search results, as it considers the context and semantic content of the query rather than just the exact words used. </li> </ul> <h2 id="create-a-redis-vector-database"> Create a Redis vector database </h2> <p> You can use <a href="/docs/latest/operate/oss_and_stack/"> Redis Stack </a> as a vector database. It allows you to: </p> <ul> <li> Store vectors and the associated metadata within hashes or <a href="/docs/latest/develop/data-types/json/"> JSON </a> documents </li> <li> Create and configure secondary indices for search </li> <li> Perform vector searches </li> <li> Update vectors and metadata </li> <li> Delete and cleanup </li> </ul> <p> The easiest way to get started is to use Redis Cloud: </p> <ol> <li> <p> Create a <a href="https://redis.com/try-free?utm_source=redisio&amp;utm_medium=referral&amp;utm_campaign=2023-09-try_free&amp;utm_content=cu-redis_cloud_users"> free account </a> . </p> <img src="../img/free-cloud-db.png" width="500px"/> </li> <li> <p> Follow the instructions to create a free database. </p> </li> </ol> <p> This free Redis Cloud database comes out of the box with all the Redis Stack features. </p> <p> You can alternatively use the <a href="/docs/latest/operate/oss_and_stack/install/install-stack/"> installation guides </a> to install Redis Stack on your local machine. </p> <p> You need to have the following features configured for your Redis server: JSON and Search and query. </p> <h2 id="install-the-required-python-packages"> Install the required Python packages </h2> <p> Create a Python virtual environment and install the following dependencies using <code> pip </code> : </p> <ul> <li> <code> redis </code> : You can find further details about the <code> redis-py </code> client library in the <a href="/docs/latest/develop/clients/redis-py/"> clients </a> section of this documentation site. </li> <li> <code> pandas </code> : Pandas is a data analysis library. </li> <li> <code> sentence-transformers </code> : You will use the <a href="https://www.sbert.net/"> SentenceTransformers </a> framework to generate embeddings on full text. </li> <li> <code> tabulate </code> : <code> pandas </code> uses <code> tabulate </code> to render Markdown. </li> </ul> <p> You will also need the following imports in your Python code: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepimports"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepimports" name="search_vss-stepimports" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepimports" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepimports" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepimports" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line hl"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line hl"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line hl"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line hl"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line hl"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line hl"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line hl"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepimports')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepimports" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <h2 id="connect"> Connect </h2> <p> Connect to Redis. By default, Redis returns binary responses. To decode them, you pass the <code> decode_responses </code> parameter set to <code> True </code> : </p> <p> </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepconnect"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepconnect" name="search_vss-stepconnect" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepconnect" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepconnect" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepconnect" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepconnect')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepconnect" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <br/> <p> </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Tip: </div> Instead of using a local Redis Stack server, you can copy and paste the connection details from the Redis Cloud database configuration page. Here is an example connection string of a Cloud database that is hosted in the AWS region <code> us-east-1 </code> and listens on port 16379: <code> redis-16379.c283.us-east-1-4.ec2.cloud.redislabs.com:16379 </code> . The connection string has the format <code> host:port </code> . You must also copy and paste the username and password of your Cloud database. The line of code for connecting with the default user changes then to <code> client = redis.Redis(host="redis-16379.c283.us-east-1-4.ec2.cloud.redislabs.com", port=16379, password="your_password_here", decode_responses=True) </code> . </div> </div> <h2 id="prepare-the-demo-dataset"> Prepare the demo dataset </h2> <p> This quick start guide also uses the <strong> bikes </strong> dataset. Here is an example document from it: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"model"</span><span class="p">:</span> <span class="s2">"Jigger"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"brand"</span><span class="p">:</span> <span class="s2">"Velorim"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"price"</span><span class="p">:</span> <span class="mi">270</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"type"</span><span class="p">:</span> <span class="s2">"Kids bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"specs"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"material"</span><span class="p">:</span> <span class="s2">"aluminium"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"weight"</span><span class="p">:</span> <span class="s2">"10"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Small and powerful, the Jigger is the best ride for the smallest of tikes! ..."</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> The <code> description </code> field contains free-form text descriptions of bikes and will be used to create vector embeddings. </p> <h3 id="1-fetch-the-demo-data"> 1. Fetch the demo data </h3> <p> You need to first fetch the demo dataset as a JSON array: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepget_data"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepget_data" name="search_vss-stepget_data" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepget_data" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepget_data" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepget_data" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line hl"><span class="cl"> <span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepget_data')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepget_data" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Inspect the structure of one of the bike JSON documents: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepdump_data"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepdump_data" name="search_vss-stepdump_data" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepdump_data" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepdump_data" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepdump_data" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepdump_data')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepdump_data" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <h3 id="2-store-the-demo-data-in-redis"> 2. Store the demo data in Redis </h3> <p> Now iterate over the <code> bikes </code> array to store the data as <a href="/docs/latest/develop/data-types/json/"> JSON </a> documents in Redis by using the <a href="/docs/latest/commands/json.set//"> JSON.SET </a> command. The below code uses a <a href="/docs/latest/develop/use/pipelining/"> pipeline </a> to minimize the network round-trip times: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepload_data"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepload_data" name="search_vss-stepload_data" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepload_data" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepload_data" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepload_data" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line hl"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line hl"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepload_data')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepload_data" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Once loaded, you can retrieve a specific attribute from one of the JSON documents in Redis using a <a href="https://goessner.net/articles/JsonPath/"> JSONPath </a> expression: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepget"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepget" name="search_vss-stepget" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepget" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepget" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepget" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepget')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepget" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <h3 id="3-select-a-text-embedding-model"> 3. Select a text embedding model </h3> <p> <a href="https://huggingface.co"> HuggingFace </a> has a large catalog of text embedding models that are locally servable through the <code> SentenceTransformers </code> framework. Here we use the <a href="https://microsoft.github.io/msmarco/"> MS MARCO </a> model that is widely used in search engines, chatbots, and other AI applications. </p> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s1">'msmarco-distilbert-base-v4'</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="4-generate-text-embeddings"> 4. Generate text embeddings </h3> <p> Iterate over all the Redis keys with the prefix <code> bikes: </code> : </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepget_keys"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepget_keys" name="search_vss-stepget_keys" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepget_keys" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepget_keys" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepget_keys" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepget_keys')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepget_keys" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Use the keys as input to the <a href="/docs/latest/commands/json.mget/"> JSON.MGET </a> command, along with the <code> $.description </code> field, to collect the descriptions in a list. Then, pass the list of descriptions to the <code> .encode() </code> method: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepgenerate_embeddings"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepgenerate_embeddings" name="search_vss-stepgenerate_embeddings" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepgenerate_embeddings" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepgenerate_embeddings" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepgenerate_embeddings" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line hl"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepgenerate_embeddings')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepgenerate_embeddings" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Insert the vectorized descriptions to the bike documents in Redis using the <a href="/docs/latest/commands/json.set"> JSON.SET </a> command. The following command inserts a new field into each of the documents under the JSONPath <code> $.description_embeddings </code> . Once again, do this using a pipeline to avoid unnecessary network round-trips: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepload_embeddings"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepload_embeddings" name="search_vss-stepload_embeddings" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepload_embeddings" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepload_embeddings" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepload_embeddings" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line hl"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepload_embeddings')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepload_embeddings" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Inspect one of the updated bike documents using the <a href="/docs/latest/commands/json.get"> JSON.GET </a> command: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepdump_example"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepdump_example" name="search_vss-stepdump_example" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepdump_example" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepdump_example" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepdump_example" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># {</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># },</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepdump_example')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepdump_example" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> When storing a vector embedding within a JSON document, the embedding is stored as a JSON array. In the example above, the array was shortened considerably for the sake of readability. </div> </div> <h2 id="create-an-index"> Create an index </h2> <h3 id="1-create-an-index-with-a-vector-field"> 1. Create an index with a vector field </h3> <p> You must create an index to query document metadata or to perform vector searches. Use the <a href="/docs/latest/commands/ft.create"> FT.CREATE </a> command: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepcreate_index"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_search_vss-stepcreate_index" name="search_vss-stepcreate_index" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_search_vss-stepcreate_index" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-search_vss-stepcreate_index" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_search_vss-stepcreate_index" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">FT.CREATE idx:bikes_vss ON JSON </span></span><span class="line hl"><span class="cl"> PREFIX 1 bikes: SCORE 1.0 </span></span><span class="line hl"><span class="cl"> SCHEMA </span></span><span class="line hl"><span class="cl"> $.model TEXT WEIGHT 1.0 NOSTEM </span></span><span class="line hl"><span class="cl"> $.brand TEXT WEIGHT 1.0 NOSTEM </span></span><span class="line hl"><span class="cl"> $.price NUMERIC </span></span><span class="line hl"><span class="cl"> $.type TAG SEPARATOR "," </span></span><span class="line hl"><span class="cl"> $.description AS description TEXT WEIGHT 1.0 </span></span><span class="line hl"><span class="cl"> $.description_embeddings AS vector VECTOR FLAT 6 TYPE FLOAT32 DIM 768 DISTANCE_METRIC COSINE</span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_search_vss-stepcreate_index')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <div class="flex-1 text-xs text-white overflow-ellipsis"> Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis. </div> <div class="text-right"> <a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight"> <svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg"> <path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5"> </path> <path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5"> </path> <path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5"> </path> <path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171"> </path> <path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171"> </path> <path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5"> </path> <path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171"> </path> <path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5"> </path> </svg> <span> Get Redis Insight </span> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepcreate_index" name="search_vss-stepcreate_index" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepcreate_index" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepcreate_index" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepcreate_index" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line hl"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">},</span> </span></span><span class="line hl"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">),</span> </span></span><span class="line hl"><span class="cl"><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepcreate_index')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepcreate_index" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> Here is a breakdown of the <code> VECTOR </code> field definition: </p> <ul> <li> <code> $.description_embeddings AS vector </code> : The vector field's JSON path and its field alias <code> vector </code> . </li> <li> <code> FLAT </code> : Specifies the indexing method, which is either a flat index or a hierarchical navigable small world graph ( <a href="https://arxiv.org/ftp/arxiv/papers/1603/1603.09320.pdf"> HNSW </a> ). </li> <li> <code> TYPE FLOAT32 </code> : Sets the float precision of a vector component, in this case a 32-bit floating point number. </li> <li> <code> DIM 768 </code> : The length or dimension of the embeddings, determined by the chosen embedding model. </li> <li> <code> DISTANCE_METRIC COSINE </code> : The chosen distance function: <a href="https://en.wikipedia.org/wiki/Cosine_similarity"> cosine distance </a> . </li> </ul> <p> You can find further details about all these options in the <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/"> vector reference documentation </a> . </p> <h3 id="2-check-the-state-of-the-index"> 2. Check the state of the index </h3> <p> As soon as you execute the <a href="/docs/latest/commands/ft.create"> FT.CREATE </a> command, the indexing process runs in the background. In a short time, all JSON documents should be indexed and ready to be queried. To validate that, you can use the <a href="/docs/latest/commands/ft.info"> FT.INFO </a> command, which provides details and statistics about the index. Of particular interest are the number of documents successfully indexed and the number of failures: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepvalidate_index"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_search_vss-stepvalidate_index" name="search_vss-stepvalidate_index" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_search_vss-stepvalidate_index" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-search_vss-stepvalidate_index" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_search_vss-stepvalidate_index" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">FT.INFO idx:bikes_vss</span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_search_vss-stepvalidate_index')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <div class="flex-1 text-xs text-white overflow-ellipsis"> Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis. </div> <div class="text-right"> <a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight"> <svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg"> <path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5"> </path> <path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5"> </path> <path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5"> </path> <path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171"> </path> <path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171"> </path> <path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5"> </path> <path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171"> </path> <path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5"> </path> </svg> <span> Get Redis Insight </span> </a> </div> </div> </div> <input class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepvalidate_index" name="search_vss-stepvalidate_index" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepvalidate_index" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepvalidate_index" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepvalidate_index" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line hl"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line hl"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepvalidate_index')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepvalidate_index" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <h2 id="perform-vector-searches"> Perform vector searches </h2> <p> This quick start guide focuses on vector search. However, you can learn more about how to query based on document metadata in the <a href="/docs/latest/develop/get-started/document-database/"> document database quick start guide </a> . </p> <h3 id="1-embed-your-queries"> 1. Embed your queries </h3> <p> The following code snippet shows a list of text queries you will use to perform vector search in Redis: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepdef_bulk_queries"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepdef_bulk_queries" name="search_vss-stepdef_bulk_queries" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepdef_bulk_queries" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepdef_bulk_queries" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepdef_bulk_queries" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepdef_bulk_queries')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepdef_bulk_queries" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> First, encode each input query as a vector embedding using the same SentenceTransformers model: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepenc_bulk_queries"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepenc_bulk_queries" name="search_vss-stepenc_bulk_queries" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepenc_bulk_queries" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepenc_bulk_queries" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepenc_bulk_queries" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepenc_bulk_queries')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepenc_bulk_queries" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <br/> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Tip: </div> It is vital that you use the same embedding model to embed your queries as you did your documents. Using a different model will result in poor semantic search results or error. </div> </div> <h3 id="2-k-nearest-neighbors-knn-search"> 2. K-nearest neighbors (KNN) search </h3> <p> The KNN algorithm calculates the distance between the query vector and each vector in Redis based on the chosen distance function. It then returns the top K items with the smallest distances to the query vector. These are the most semantically similar items. </p> <p> Now construct a query to do just that: </p> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s1">'(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]'</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s1">'vector_score'</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s1">'vector_score'</span><span class="p">,</span> <span class="s1">'id'</span><span class="p">,</span> <span class="s1">'brand'</span><span class="p">,</span> <span class="s1">'model'</span><span class="p">,</span> <span class="s1">'description'</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span></code></pre> </div> <p> Let's break down the above query template: </p> <ul> <li> The filter expression <code> (*) </code> means <code> all </code> . In other words, no filtering was applied. You could replace it with an expression that filters by additional metadata. </li> <li> The <code> KNN </code> part of the query searches for the top 3 nearest neighbors. </li> <li> The query vector must be passed in as the param <code> query_vector </code> . </li> <li> The distance to the query vector is returned as <code> vector_score </code> . </li> <li> The results are sorted by this <code> vector_score </code> . </li> <li> Finally, it returns the fields <code> vector_score </code> , <code> id </code> , <code> brand </code> , <code> model </code> , and <code> description </code> for each result. </li> </ul> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> To utilize a vector query with the <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> command, you must specify DIALECT 2 or greater. </div> </div> <p> You must pass the vectorized query as a byte array with the param name <code> query_vector </code> . The following code creates a Python NumPy array from the query vector and converts it into a compact, byte-level representation that can be passed as a parameter to the query: </p> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s1">'idx:bikes_vss'</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'query_vector'</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span></code></pre> </div> <p> With the template for the query in place, you can execute all queries in a loop. Notice that the script calculates the <code> vector_score </code> for each result as <code> 1 - doc.vector_score </code> . Because the cosine distance is used as the metric, the items with the smallest distance are closer and, therefore, more similar to the query. </p> <p> Then, loop over the matched documents and create a list of results that can be converted into a Pandas table to visualize the results: </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-stepdefine_bulk_query"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-stepdefine_bulk_query" name="search_vss-stepdefine_bulk_query" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-stepdefine_bulk_query" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-stepdefine_bulk_query" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-stepdefine_bulk_query" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">""" </span></span></span><span class="line hl"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line hl"><span class="cl"><span class="s2"> """</span> </span></span><span class="line hl"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line hl"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line hl"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line hl"><span class="cl"> <span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line hl"><span class="cl"> <span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line hl"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="p">{</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="p">}</span> </span></span><span class="line hl"><span class="cl"> <span class="p">)</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line hl"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line hl"><span class="cl"> <span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line hl"><span class="cl"> <span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-stepdefine_bulk_query')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-stepdefine_bulk_query" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <p> The query results show the individual queries' top three matches (our K parameter) along with the bike's id, brand, and model for each query. </p> <p> For example, for the query "Best Mountain bikes for kids", the highest similarity score ( <code> 0.54 </code> ) and, therefore the closest match was the 'Nord' brand 'Chook air 5' bike model, described as: </p> <blockquote> <p> The Chook Air 5 gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. The lower top tube makes it easy to mount and dismount in any situation, giving your kids greater safety on the trails. The Chook Air 5 is the perfect intro to mountain biking. </p> </blockquote> <p> From the description, this bike is an excellent match for younger children, and the embeddings accurately captured the semantics of the description. </p> <div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="search_vss-steprun_knn_query"> <input checked="" class="radiotab w-0 h-0" data-lang="python" id="Python_search_vss-steprun_knn_query" name="search_vss-steprun_knn_query" tabindex="1" type="radio"/> <label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_search_vss-steprun_knn_query" title="Open example"> Python </label> <div aria-labelledby="tab-search_vss-steprun_knn_query" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_search_vss-steprun_knn_query" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2">Code samples for vector database quickstart pages: </span></span></span><span class="line"><span class="cl"><span class="s2"> https://redis.io/docs/latest/develop/get-started/vector-database/ </span></span></span><span class="line"><span class="cl"><span class="s2">"""</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">time</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">requests</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.field</span> <span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.indexDefinition</span> <span class="kn">import</span> <span class="n">IndexDefinition</span><span class="p">,</span> <span class="n">IndexType</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.commands.search.query</span> <span class="kn">import</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">URL</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"https://raw.githubusercontent.com/bsbodden/redis_vss_getting_started"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"/main/data/bikes.json"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">bikes</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">bikes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ping</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; True</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bike</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bikes</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">redis_key</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"bikes:</span><span class="si">{</span><span class="n">i</span><span class="si">:</span><span class="s2">03</span><span class="si">}</span><span class="s2">"</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">redis_key</span><span class="p">,</span> <span class="s2">"$"</span><span class="p">,</span> <span class="n">bike</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">,</span> <span class="s2">"$.model"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['Summit']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">keys</span><span class="p">(</span><span class="s2">"bikes:*"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; ['bikes:001', 'bikes:002', ..., 'bikes:011']</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="s2">"$.description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">descriptions</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">sublist</span> <span class="ow">in</span> <span class="n">descriptions</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">sublist</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">embedder</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s2">"msmarco-distilbert-base-v4"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">embeddings</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">descriptions</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">VECTOR_DIMENSION</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">embeddings</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 768</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">pipeline</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">embedding</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">keys</span><span class="p">,</span> <span class="n">embeddings</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">pipeline</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> <span class="n">embedding</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">pipeline</span><span class="o">.</span><span class="n">execute</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [True, True, True, True, True, True, True, True, True, True, True]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">json</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"bikes:010"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "model": "Summit",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "brand": "nHill",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "price": 1200,</span> </span></span><span class="line"><span class="cl"><span class="c1"># "type": "Mountain Bike",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "specs": {</span> </span></span><span class="line"><span class="cl"><span class="c1"># "material": "alloy",</span> </span></span><span class="line"><span class="cl"><span class="c1"># "weight": "11.3"</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description": "This budget mountain bike from nHill performs well..."</span> </span></span><span class="line"><span class="cl"><span class="c1"># "description_embeddings": [</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.538114607334137,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.49465855956077576,</span> </span></span><span class="line"><span class="cl"><span class="c1"># -0.025176964700222015,</span> </span></span><span class="line"><span class="cl"><span class="c1"># ...</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.model"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"model"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.brand"</span><span class="p">,</span> <span class="n">no_stem</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"brand"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="p">(</span><span class="s2">"$.price"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"price"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="p">(</span><span class="s2">"$.type"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"type"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="p">(</span><span class="s2">"$.description"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"description"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">VectorField</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"$.description_embeddings"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"FLAT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"TYPE"</span><span class="p">:</span> <span class="s2">"FLOAT32"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DIM"</span><span class="p">:</span> <span class="n">VECTOR_DIMENSION</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"DISTANCE_METRIC"</span><span class="p">:</span> <span class="s2">"COSINE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="n">as_name</span><span class="o">=</span><span class="s2">"vector"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">),</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">definition</span> <span class="o">=</span> <span class="n">IndexDefinition</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="s2">"bikes:"</span><span class="p">],</span> <span class="n">index_type</span><span class="o">=</span><span class="n">IndexType</span><span class="o">.</span><span class="n">JSON</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">schema</span><span class="p">,</span> <span class="n">definition</span><span class="o">=</span><span class="n">definition</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 'OK'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">info</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">info</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="n">num_docs</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"num_docs"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="n">indexing_failures</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s2">"hash_indexing_failures"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(f"{num_docs} documents indexed with {indexing_failures} failures")</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11 documents indexed with 0 failures</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950', 'description_embeddings': ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:008',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Soothe Electric bike',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '1950'</span> </span></span><span class="line"><span class="cl"><span class="c1"># },</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@brand:Peaknetic @price:[0 1000]"</span><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)</span><span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"><span class="c1"># print(res)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; [</span> </span></span><span class="line"><span class="cl"><span class="c1"># Document {</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'id': 'bikes:009',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'payload': None,</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'brand': 'Peaknetic',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'model': 'Secto',</span> </span></span><span class="line"><span class="cl"><span class="c1"># 'price': '430'</span> </span></span><span class="line"><span class="cl"><span class="c1"># }</span> </span></span><span class="line"><span class="cl"><span class="c1"># ]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">queries</span> <span class="o">=</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Bike for small kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Best Mountain bikes for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Cheap Mountain bike for kids"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Female specific mountain bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Road bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Commuter bike for people over 60"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable commuter bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Good bike for college students"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Mountain bike for beginners"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Vintage bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"Comfortable city bike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">encoded_queries</span> <span class="o">=</span> <span class="n">embedder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">len</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 11</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">,</span> <span class="n">extra_params</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="s2">""" </span></span></span><span class="line"><span class="cl"><span class="s2"> Creates a query table. </span></span></span><span class="line"><span class="cl"><span class="s2"> """</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span> <span class="o">=</span> <span class="p">[]</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">encoded_query</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">encoded_queries</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">result_docs</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bikes_vss"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">query</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"query_vector"</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">encoded_query</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()}</span> </span></span><span class="line"><span class="cl"> <span class="o">|</span> <span class="p">(</span><span class="n">extra_params</span> <span class="k">if</span> <span class="n">extra_params</span> <span class="k">else</span> <span class="p">{}),</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">docs</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">doc</span> <span class="ow">in</span> <span class="n">result_docs</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_score</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">vector_score</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">results_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"query"</span><span class="p">:</span> <span class="n">queries</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="s2">"score"</span><span class="p">:</span> <span class="n">vector_score</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"id"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"brand"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">brand</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"model"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"description"</span><span class="p">:</span> <span class="n">doc</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># Optional: convert the table to Markdown using Pandas</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">results_list</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">by</span><span class="o">=</span><span class="p">[</span><span class="s2">"query"</span><span class="p">,</span> <span class="s2">"score"</span><span class="p">],</span> <span class="n">ascending</span><span class="o">=</span><span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"query"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)[</span><span class="s2">"query"</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="p">[</span><span class="s2">""</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span> <span class="o">=</span> <span class="n">queries_table</span><span class="p">[</span><span class="s2">"description"</span><span class="p">]</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="mi">497</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"..."</span><span class="p">)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">500</span> <span class="k">else</span> <span class="n">x</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">queries_table</span><span class="o">.</span><span class="n">to_markdown</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(*)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.54 | bikes:003...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">hybrid_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span><span class="s2">"(@brand:Peaknetic)=&gt;[KNN 3 @vector $query_vector AS vector_score]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span><span class="n">hybrid_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">,</span> <span class="n">encoded_queries</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Best Mountain bikes for kids | 0.3 | bikes:008...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">range_query</span> <span class="o">=</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">Query</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"@vector:[VECTOR_RANGE $range $query_vector]=&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="s2">"{$YIELD_DISTANCE_AS: vector_score}"</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"vector_score"</span><span class="p">,</span> <span class="s2">"id"</span><span class="p">,</span> <span class="s2">"brand"</span><span class="p">,</span> <span class="s2">"model"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">paging</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">table</span> <span class="o">=</span> <span class="n">create_query_table</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">range_query</span><span class="p">,</span> <span class="n">queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">encoded_queries</span><span class="p">[:</span><span class="mi">1</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"range"</span><span class="p">:</span> <span class="mf">0.55</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; | Bike for small kids | 0.52 | bikes:001 | Velorim |...</span> </span></span></code></pre> </div> <button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_search_vss-steprun_knn_query')" tabindex="1" title="Copy to clipboard"> <svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"> </path> </svg> <div class="tooltip relative inline-block"> <span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4"> Copied! </span> </div> </button> <button aria-controls="panel_Python_search_vss-steprun_knn_query" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility"> <svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z"> </path> </svg> <svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z"> </path> </svg> </button> <div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible"> <a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start"> Python Quick-Start </a> <div class="w-1/2"> </div> <div class="flex-1 text-right"> <a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/search_vss.py" tabindex="1" title="Improve this code example"> <svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd"> </path> </svg> </a> </div> </div> </div> </div> <table> <thead> <tr> <th style="text-align:left"> query </th> <th style="text-align:left"> score </th> <th style="text-align:left"> id </th> <th style="text-align:left"> brand </th> <th style="text-align:left"> model </th> <th style="text-align:left"> description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> Best Mountain bikes for kids </td> <td style="text-align:left"> 0.54 </td> <td style="text-align:left"> bikes:003 </td> <td style="text-align:left"> Nord </td> <td style="text-align:left"> Chook air 5 </td> <td style="text-align:left"> The Chook Air 5 gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. The lower top tube makes it easy to mount and dismount in any situation, giving your kids greater safety on the trails. The Chook Air 5 is the perfect intro to mountain biking. </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> 0.51 </td> <td style="text-align:left"> bikes:010 </td> <td style="text-align:left"> nHill </td> <td style="text-align:left"> Summit </td> <td style="text-align:left"> This budget mountain bike from nHill performs well both on bike paths and on the trail. The fork with 100mm of travel absorbs rough terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. The Shimano Tourney drivetrain offered enough gears for finding a comfortable pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. Whether you want an affordable bike that you can take to work, but also take trail riding on the weekends or you’re just after a stable,... </td> </tr> <tr> <td style="text-align:left"> </td> <td style="text-align:left"> 0.46 </td> <td style="text-align:left"> bikes:001 </td> <td style="text-align:left"> Velorim </td> <td style="text-align:left"> Jigger </td> <td style="text-align:left"> Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger is the vehicle of choice for the rare tenacious little rider raring to go. We say rare because this smokin’ little bike is not ideal for a nervous first-time rider, but it’s a true giddy up for a true speedster. The Jigger is a 12 inch lightweight kids bicycle and it will meet your little one’s need for speed. It’s a single... </td> </tr> </tbody> </table> <h2 id="next-steps"> Next steps </h2> <ol> <li> You can learn more about the query options, such as filters and vector range queries, by reading the <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/"> vector reference documentation </a> . </li> <li> The complete <a href="/docs/latest/develop/interact/search-and-query/"> Redis Query Engine documentation </a> might be interesting for you. </li> <li> If you want to follow the code examples more interactively, then you can use the <a href="https://github.com/RedisVentures/redis-vss-getting-started/blob/main/vector_similarity_with_redis.ipynb"> Jupyter notebook </a> that inspired this quick start guide. </li> <li> If you want to see more advanced examples of a Redis vector database in action, visit the <a href="https://github.com/redis-developer/redis-ai-resources"> Redis AI Resources </a> page on GitHub. </li> </ol> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/get-started/vector-database/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/shards/actions/.html
<section class="prose w-full py-12 max-w-none"> <h1> Shard actions requests </h1> <p class="text-lg -mt-5 mb-10"> REST API requests to perform shard actions </p> <h2 id="migrate"> Migrate </h2> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/requests/shards/actions/migrate/#post-multi-shards"> POST </a> </td> <td> <code> /v1/shards/actions/migrate </code> </td> <td> Migrate multiple shards </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/requests/shards/actions/migrate/#post-shard"> POST </a> </td> <td> <code> /v1/shards/{uid}/actions/migrate </code> </td> <td> Migrate a specific shard </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/shards/actions/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/asyncmap/.html
<section class="prose w-full py-12 max-w-none"> <h1> AsyncMap </h1> <p class="text-lg -mt-5 mb-10"> Asynchronously maps records one-to-one. </p> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kd">public</span> <span class="o">&lt;</span><span class="n">I</span> <span class="kd">extends</span> <span class="n">java</span><span class="o">.</span><span class="na">io</span><span class="o">.</span><span class="na">Serializable</span><span class="o">&gt;</span> <span class="n">GearsBuilder</span><span class="o">&lt;</span><span class="n">I</span><span class="o">&gt;</span> <span class="n">asyncMap</span><span class="err">​</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="n">gears</span><span class="o">.</span><span class="na">operations</span><span class="o">.</span><span class="na">AsyncMapOperation</span><span class="o">&lt;</span><span class="n">T</span><span class="o">,</span><span class="err">​</span><span class="n">I</span><span class="o">&gt;</span> <span class="n">mapper</span><span class="o">)</span> </span></span></code></pre> </div> <p> The <code> asyncMap </code> function allows you to use a <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsfuture/"> <code> GearsFuture </code> </a> object to asynchronously map each input record in the pipe to an output record, one-to-one. </p> <h2 id="parameters"> Parameters </h2> <p> Type parameters: </p> <table> <thead> <tr> <th> Name </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> I </td> <td> The template type of the returned builder </td> </tr> </tbody> </table> <p> Function parameters: </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> mapper </td> <td> <nobr> AsyncMapOperation&lt;T,​I&gt; </nobr> </td> <td> For each input record, returns a new output record </td> </tr> </tbody> </table> <h2 id="returns"> Returns </h2> <p> Returns a GearsBuilder object with a new template type. </p> <h2 id="example"> Example </h2> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">GearsBuilder</span><span class="o">.</span><span class="na">CreateGearsBuilder</span><span class="o">(</span><span class="n">reader</span><span class="o">).</span> </span></span><span class="line"><span class="cl"> <span class="n">asyncMap</span><span class="o">(</span><span class="n">r</span><span class="o">-&gt;{</span> </span></span><span class="line"><span class="cl"> <span class="n">GearsFuture</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">f</span> <span class="o">=</span> <span class="k">new</span> <span class="n">GearsFuture</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;();</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Thread</span><span class="o">(</span><span class="k">new</span> <span class="n">Runnable</span><span class="o">()</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="nd">@Override</span> </span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="k">try</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">Thread</span><span class="o">.</span><span class="na">sleep</span><span class="o">(</span><span class="mi">1</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">f</span><span class="o">.</span><span class="na">setResult</span><span class="o">(</span><span class="s">"done"</span><span class="o">);</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">Exception</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">}).</span><span class="na">start</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">f</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="o">});</span> </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/asyncmap/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/networking/mdns/.html
<section class="prose w-full py-12 max-w-none"> <h1> Client prerequisites for mDNS </h1> <p class="text-lg -mt-5 mb-10"> Requirements for using the mDNS protocol in development and testing environments. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> mDNS is only supported for development and testing environments. </div> </div> <p> If you choose to use the mDNS protocol when <a href="/docs/latest/operate/rs/7.4/networking/cluster-dns/"> you set the cluster name </a> , make sure that the configurations and prerequisites for resolving database endpoints are met on the client machines. If you have <a href="/docs/latest/operate/rs/7.4/databases/import-export/replica-of/"> Replica Of </a> databases on the cluster, the configurations and prerequisites are also required for the Redis Enterprise Software nodes. </p> <p> To prepare a client or node for mDNS: </p> <ol> <li> <p> Make sure that the clients and cluster nodes are on the same physical network or have the network infrastructure configured to allow multicasting between them. </p> </li> <li> <p> Install these prerequisite packages: </p> <ul> <li> <p> For Ubuntu: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">apt-get install libnss-mdns </span></span></code></pre> </div> </li> <li> <p> For RHEL/CentOS 6.x: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm </span></span><span class="line"><span class="cl">$ yum install nss-mdns </span></span><span class="line"><span class="cl">$ service avahi-daemon start </span></span></code></pre> </div> </li> <li> <p> For RHEL/CentOS 7: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rpm -ivh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm </span></span><span class="line"><span class="cl">$ yum install nss-mdns </span></span><span class="line"><span class="cl">$ service avahi-daemon start </span></span></code></pre> </div> </li> </ul> </li> <li> <p> If you are using <a href="/docs/latest/operate/rs/networking/multi-ip-ipv6/"> mDNS with IPv6 addresses </a> , update the hosts line in <code> /etc/nsswitch.conf </code> to: </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l">files mdns4_minimal</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="l">\[NOTFOUND=return\] mdns</span><span class="w"> </span></span></span></code></pre> </div> </li> </ol> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/networking/mdns/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/kubernetes-archive/.html
<section class="prose w-full py-12 max-w-none"> <h1> Archive </h1> <p class="text-lg -mt-5 mb-10"> Describes where to view the archive of Redis Enterprise for Kubernetes documentation. </p> <p> Previous versions of Redis Enterprise for Kubernetes documentation are available on the archived web site: </p> <ul> <li> <p> <a href="https://docs.redis.com/7.4/kubernetes/"> Redis Enterprise for Kubernetes v7.4 documentation archive </a> </p> </li> <li> <p> <a href="https://docs.redis.com/7.2/kubernetes/"> Redis Enterprise for Kubernetes v7.2 documentation archive </a> </p> </li> <li> <p> <a href="https://docs.redis.com/6.4/kubernetes/"> Redis Enterprise for Kubernetes v6.x documentation archive </a> </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/kubernetes-archive/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/management/security/encryption/.html
<section class="prose w-full py-12 max-w-none"> <h1> TLS </h1> <p class="text-lg -mt-5 mb-10"> Redis TLS support </p> <p> SSL/TLS is supported by Redis starting with version 6 as an optional feature that needs to be enabled at compile time. </p> <h2 id="getting-started"> Getting Started </h2> <h3 id="building"> Building </h3> <p> To build with TLS support you'll need OpenSSL development libraries (e.g. <code> libssl-dev </code> on Debian/Ubuntu). </p> <p> Build Redis with the following command: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">make <span class="nv">BUILD_TLS</span><span class="o">=</span>yes </span></span></code></pre> </div> <h3 id="tests"> Tests </h3> <p> To run Redis test suite with TLS, you'll need TLS support for TCL (i.e. <code> tcl-tls </code> package on Debian/Ubuntu). </p> <ol> <li> <p> Run <code> ./utils/gen-test-certs.sh </code> to generate a root CA and a server certificate. </p> </li> <li> <p> Run <code> ./runtest --tls </code> or <code> ./runtest-cluster --tls </code> to run Redis and Redis Cluster tests in TLS mode. </p> </li> </ol> <h3 id="running-manually"> Running manually </h3> <p> To manually run a Redis server with TLS mode (assuming <code> gen-test-certs.sh </code> was invoked so sample certificates/keys are available): </p> <pre><code>./src/redis-server --tls-port 6379 --port 0 \ --tls-cert-file ./tests/tls/redis.crt \ --tls-key-file ./tests/tls/redis.key \ --tls-ca-cert-file ./tests/tls/ca.crt </code></pre> <p> To connect to this Redis server with <code> redis-cli </code> : </p> <pre><code>./src/redis-cli --tls \ --cert ./tests/tls/redis.crt \ --key ./tests/tls/redis.key \ --cacert ./tests/tls/ca.crt </code></pre> <h3 id="certificate-configuration"> Certificate configuration </h3> <p> In order to support TLS, Redis must be configured with a X.509 certificate and a private key. In addition, it is necessary to specify a CA certificate bundle file or path to be used as a trusted root when validating certificates. To support DH based ciphers, a DH params file can also be configured. For example: </p> <pre tabindex="0"><code>tls-cert-file /path/to/redis.crt tls-key-file /path/to/redis.key tls-ca-cert-file /path/to/ca.crt tls-dh-params-file /path/to/redis.dh </code></pre> <h3 id="tls-listening-port"> TLS listening port </h3> <p> The <code> tls-port </code> configuration directive enables accepting SSL/TLS connections on the specified port. This is <strong> in addition </strong> to listening on <code> port </code> for TCP connections, so it is possible to access Redis on different ports using TLS and non-TLS connections simultaneously. </p> <p> You may specify <code> port 0 </code> to disable the non-TLS port completely. To enable only TLS on the default Redis port, use: </p> <pre tabindex="0"><code>port 0 tls-port 6379 </code></pre> <h3 id="client-certificate-authentication"> Client certificate authentication </h3> <p> By default, Redis uses mutual TLS and requires clients to authenticate with a valid certificate (authenticated against trusted root CAs specified by <code> ca-cert-file </code> or <code> ca-cert-dir </code> ). </p> <p> You may use <code> tls-auth-clients no </code> to disable client authentication. </p> <h3 id="replication"> Replication </h3> <p> A Redis master server handles connecting clients and replica servers in the same way, so the above <code> tls-port </code> and <code> tls-auth-clients </code> directives apply to replication links as well. </p> <p> On the replica server side, it is necessary to specify <code> tls-replication yes </code> to use TLS for outgoing connections to the master. </p> <h3 id="cluster"> Cluster </h3> <p> When Redis Cluster is used, use <code> tls-cluster yes </code> in order to enable TLS for the cluster bus and cross-node connections. </p> <h3 id="sentinel"> Sentinel </h3> <p> Sentinel inherits its networking configuration from the common Redis configuration, so all of the above applies to Sentinel as well. </p> <p> When connecting to master servers, Sentinel will use the <code> tls-replication </code> directive to determine if a TLS or non-TLS connection is required. </p> <p> In addition, the very same <code> tls-replication </code> directive will determine whether Sentinel's port, that accepts connections from other Sentinels, will support TLS as well. That is, Sentinel will be configured with <code> tls-port </code> if and only if <code> tls-replication </code> is enabled. </p> <h3 id="additional-configuration"> Additional configuration </h3> <p> Additional TLS configuration is available to control the choice of TLS protocol versions, ciphers and cipher suites, etc. Please consult the self documented <code> redis.conf </code> for more information. </p> <h3 id="performance-considerations"> Performance considerations </h3> <p> TLS adds a layer to the communication stack with overheads due to writing/reading to/from an SSL connection, encryption/decryption and integrity checks. Consequently, using TLS results in a decrease of the achievable throughput per Redis instance (for more information refer to this <a href="https://github.com/redis/redis/issues/7595"> discussion </a> ). </p> <h3 id="limitations"> Limitations </h3> <p> I/O threading is currently not supported with TLS. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/management/security/encryption/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/xgroup/.html
<section class="prose w-full py-12"> <h1 class="command-name"> XGROUP </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">XGROUP</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 5.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> Depends on subcommand. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This is a container command for stream consumer group management commands. </p> <p> To see the list of available commands you can call <a href="/docs/latest/commands/xgroup-help/"> <code> XGROUP HELP </code> </a> . </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/xgroup/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/command/.html
<section class="prose w-full py-12"> <h1 class="command-name"> COMMAND </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">COMMAND</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.8.13 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the total number of Redis commands </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @connection </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Return an array with details about every Redis command. </p> <p> The <code> COMMAND </code> command is introspective. Its reply describes all commands that the server can process. Redis clients can call it to obtain the server's runtime capabilities during the handshake. </p> <p> <code> COMMAND </code> also has several subcommands. Please refer to its subcommands for further details. </p> <p> <strong> Cluster note: </strong> this command is especially beneficial for cluster-aware clients. Such clients must identify the names of keys in commands to route requests to the correct shard. Although most commands accept a single key as their first argument, there are many exceptions to this rule. You can call <code> COMMAND </code> and then keep the mapping between commands and their respective key specification rules cached in the client. </p> <p> The reply it returns is an array with an element per command. Each element that describes a Redis command is represented as an array by itself. </p> <p> The command's array consists of a fixed number of elements. The exact number of elements in the array depends on the server's version. </p> <ol> <li> Name </li> <li> Arity </li> <li> Flags </li> <li> First key </li> <li> Last key </li> <li> Step </li> <li> <a href="/operate/oss_and_stack/management/security/acl"> ACL categories </a> (as of Redis 6.0) </li> <li> <a href="/develop/reference/command-tips.md"> Tips </a> (as of Redis 7.0) </li> <li> <a href="/develop/reference/key-specs.md"> Key specifications </a> (as of Redis 7.0) </li> <li> Subcommands (as of Redis 7.0) </li> </ol> <h2 id="name"> Name </h2> <p> This is the command's name in lowercase. </p> <p> <strong> Note: </strong> Redis command names are case-insensitive. </p> <h2 id="arity"> Arity </h2> <p> Arity is the number of arguments a command expects. It follows a simple pattern: </p> <ul> <li> A positive integer means a fixed number of arguments. </li> <li> A negative integer means a minimal number of arguments. </li> </ul> <p> Command arity <em> always includes </em> the command's name itself (and the subcommand when applicable). </p> <p> Examples: </p> <ul> <li> <a href="/docs/latest/commands/get/"> <code> GET </code> </a> 's arity is <em> 2 </em> since the command only accepts one argument and always has the format <code> GET _key_ </code> . </li> <li> <a href="/docs/latest/commands/mget/"> <code> MGET </code> </a> 's arity is <em> -2 </em> since the command accepts at least one argument, but possibly multiple ones: <code> MGET _key1_ [key2] [key3] ... </code> . </li> </ul> <h2 id="flags"> Flags </h2> <p> Command flags are an array. It can contain the following simple strings (status reply): </p> <ul> <li> <strong> admin: </strong> the command is an administrative command. </li> <li> <strong> asking: </strong> the command is allowed even during hash slot migration. This flag is relevant in Redis Cluster deployments. </li> <li> <strong> blocking: </strong> the command may block the requesting client. </li> <li> <strong> denyoom </strong> : the command is rejected if the server's memory usage is too high (see the <em> maxmemory </em> configuration directive). </li> <li> <strong> fast: </strong> the command operates in constant or log(N) time. This flag is used for monitoring latency with the <a href="/docs/latest/commands/latency/"> <code> LATENCY </code> </a> command. </li> <li> <strong> loading: </strong> the command is allowed while the database is loading. </li> <li> <strong> movablekeys: </strong> the <em> first key </em> , <em> last key </em> , and <em> step </em> values don't determine all key positions. Clients need to use <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> or <a href="/develop/reference/key-specs.md"> key specifications </a> in this case. See below for more details. </li> <li> <strong> no_auth: </strong> executing the command doesn't require authentication. </li> <li> <strong> no_async_loading: </strong> the command is denied during asynchronous loading (that is when a replica uses disk-less <code> SWAPDB SYNC </code> , and allows access to the old dataset). </li> <li> <strong> no_mandatory_keys: </strong> the command may accept key name arguments, but these aren't mandatory. </li> <li> <strong> no_multi: </strong> the command isn't allowed inside the context of a <a href="/docs/latest/develop/interact/transactions/"> transaction </a> . </li> <li> <strong> noscript: </strong> the command can't be called from <a href="/docs/latest/develop/interact/programmability/eval-intro/"> scripts </a> or <a href="/docs/latest/develop/interact/programmability/functions-intro/"> functions </a> . </li> <li> <strong> pubsub: </strong> the command is related to <a href="/docs/latest/develop/interact/pubsub/"> Redis Pub/Sub </a> . </li> <li> <strong> random </strong> : the command returns random results, which is a concern with verbatim script replication. As of Redis 7.0, this flag is a <a href="/develop/reference/command-tips.md"> command tip </a> . </li> <li> <strong> readonly: </strong> the command doesn't modify data. </li> <li> <strong> sort_for_script: </strong> the command's output is sorted when called from a script. </li> <li> <strong> skip_monitor: </strong> the command is not shown in <a href="/docs/latest/commands/monitor/"> <code> MONITOR </code> </a> 's output. </li> <li> <strong> skip_slowlog: </strong> the command is not shown in <a href="/docs/latest/commands/slowlog/"> <code> SLOWLOG </code> </a> 's output. As of Redis 7.0, this flag is a <a href="/develop/reference/command-tips.md"> command tip </a> . </li> <li> <strong> stale: </strong> the command is allowed while a replica has stale data. </li> <li> <strong> write: </strong> the command may modify data. </li> </ul> <h3 id="movablekeys"> Movablekeys </h3> <p> Consider <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> : </p> <pre tabindex="0"><code>1) 1) "sort" 2) (integer) -2 3) 1) write 2) denyoom 3) movablekeys 4) (integer) 1 5) (integer) 1 6) (integer) 1 ... </code></pre> <p> Some Redis commands have no predetermined key locations or are not easy to find. For those commands, the <em> movablekeys </em> flag indicates that the <em> first key </em> , <em> last key </em> , and <em> step </em> values are insufficient to find all the keys. </p> <p> Here are several examples of commands that have the <em> movablekeys </em> flag: </p> <ul> <li> <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> : the optional <em> STORE </em> , <em> BY </em> , and <em> GET </em> modifiers are followed by names of keys. </li> <li> <a href="/docs/latest/commands/zunion/"> <code> ZUNION </code> </a> : the <em> numkeys </em> argument specifies the number key name arguments. </li> <li> <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> : the keys appear <em> KEYS </em> keyword and only when the second argument is the empty string. </li> </ul> <p> Redis Cluster clients need to use other measures, as follows, to locate the keys for such commands. </p> <p> You can use the <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> command and have your Redis server report all keys of a given command's invocation. </p> <p> As of Redis 7.0, clients can use the <a href="#key-specifications"> key specifications </a> to identify the positions of key names. The only commands that require using <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> are <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> and <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> for clients that parse keys' specifications. </p> <p> For more information, please refer to the <a href="/develop/reference/key-specs.md"> key specifications page </a> . </p> <h2 id="first-key"> First key </h2> <p> The position of the command's first key name argument. For most commands, the first key's position is 1. Position 0 is always the command name itself. </p> <h2 id="last-key"> Last key </h2> <p> The position of the command's last key name argument. Redis commands usually accept one, two or multiple number of keys. </p> <p> Commands that accept a single key have both <em> first key </em> and <em> last key </em> set to 1. </p> <p> Commands that accept two key name arguments, e.g. <a href="/docs/latest/commands/brpoplpush/"> <code> BRPOPLPUSH </code> </a> , <a href="/docs/latest/commands/smove/"> <code> SMOVE </code> </a> and <a href="/docs/latest/commands/rename/"> <code> RENAME </code> </a> , have this value set to the position of their second key. </p> <p> Multi-key commands that accept an arbitrary number of keys, such as <a href="/docs/latest/commands/mset/"> <code> MSET </code> </a> , use the value -1. </p> <h2 id="step"> Step </h2> <p> The step, or increment, between the <em> first key </em> and the position of the next key. </p> <p> Consider the following two examples: </p> <pre tabindex="0"><code>1) 1) "mset" 2) (integer) -3 3) 1) write 2) denyoom 4) (integer) 1 5) (integer) -1 6) (integer) 2 ... </code></pre> <pre tabindex="0"><code>1) 1) "mget" 2) (integer) -2 3) 1) readonly 2) fast 4) (integer) 1 5) (integer) -1 6) (integer) 1 ... </code></pre> <p> The step count allows us to find keys' positions. For example <a href="/docs/latest/commands/mset/"> <code> MSET </code> </a> : Its syntax is <code> MSET _key1_ _val1_ [key2] [val2] [key3] [val3]... </code> , so the keys are at every other position (step value of <em> 2 </em> ). Unlike <a href="/docs/latest/commands/mget/"> <code> MGET </code> </a> , which uses a step value of <em> 1 </em> . </p> <h2 id="acl-categories"> ACL categories </h2> <p> This is an array of simple strings that are the ACL categories to which the command belongs. Please refer to the <a href="/operate/oss_and_stack/management/security/acl"> Access Control List </a> page for more information. </p> <h2 id="command-tips"> Command tips </h2> <p> Helpful information about the command. To be used by clients/proxies. </p> <p> Please check the <a href="/develop/reference/command-tips.md"> Command tips </a> page for more information. </p> <h2 id="key-specifications"> Key specifications </h2> <p> This is an array consisting of the command's key specifications. Each element in the array is a map describing a method for locating keys in the command's arguments. </p> <p> For more information please check the <a href="/develop/reference/key-specs.md"> key specifications page </a> . </p> <h2 id="subcommands"> Subcommands </h2> <p> This is an array containing all of the command's subcommands, if any. Some Redis commands have subcommands (e.g., the <code> REWRITE </code> subcommand of <a href="/docs/latest/commands/config/"> <code> CONFIG </code> </a> ). Each element in the array represents one subcommand and follows the same specifications as those of <code> COMMAND </code> 's reply. </p> <h2 id="examples"> Examples </h2> <p> The following is <code> COMMAND </code> 's output for the <a href="/docs/latest/commands/get/"> <code> GET </code> </a> command: </p> <pre tabindex="0"><code>1) 1) "get" 2) (integer) 2 3) 1) readonly 2) fast 4) (integer) 1 5) (integer) 1 6) (integer) 1 7) 1) @read 2) @string 3) @fast 8) (empty array) 9) 1) 1) "flags" 2) 1) read 3) "begin_search" 4) 1) "type" 2) "index" 3) "spec" 4) 1) "index" 2) (integer) 1 5) "find_keys" 6) 1) "type" 2) "range" 3) "spec" 4) 1) "lastkey" 2) (integer) 0 3) "keystep" 4) (integer) 1 5) "limit" 6) (integer) 0 10) (empty array) ... </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a nested list of command details. The order of the commands in the array is random. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/command/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/proxies/.html
<section class="prose w-full py-12 max-w-none"> <h1> Proxy requests </h1> <p class="text-lg -mt-5 mb-10"> Proxy requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-all-proxies"> GET </a> </td> <td> <code> /v1/proxies </code> </td> <td> Get all proxies </td> </tr> <tr> <td> <a href="#get-proxy"> GET </a> </td> <td> <code> /v1/proxies/{uid} </code> </td> <td> Get a proxy </td> </tr> <tr> <td> <a href="#put-proxy"> PUT </a> </td> <td> <code> /v1/proxies/{uid} </code> </td> <td> Update a proxy </td> </tr> <tr> <td> <a href="#put-all-proxies"> PUT </a> </td> <td> <code> /v1/proxies </code> </td> <td> Update all proxies </td> </tr> </tbody> </table> <h2 id="get-all-proxies"> Get all proxies </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/proxies </span></span></code></pre> </div> <p> Get all the proxies in the cluster. </p> <h3 id="permissions"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_all_proxies_info"> view_all_proxies_info </a> </td> <td> admin <br/> cluster_member <br/> cluster_viewer <br/> db_member <br/> db_viewer </td> </tr> </tbody> </table> <h3 id="get-all-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /proxies </span></span></code></pre> </div> <h4 id="headers"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> </tbody> </table> <h3 id="get-all-response"> Response </h3> <p> Returns a JSON array of <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/proxy/"> proxy objects </a> . </p> <h4 id="example-json-body"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"client_keepintvl"</span><span class="p">:</span> <span class="mi">30</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_worker_server_conns"</span><span class="p">:</span> <span class="mi">16384</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"client_keepcnt"</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_threads"</span><span class="p">:</span> <span class="mi">64</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ignore_bdb_cconn_output_buff_limits"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"dynamic_threads_scaling"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_worker_client_conns"</span><span class="p">:</span> <span class="mi">16384</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_servers"</span><span class="p">:</span> <span class="mi">4096</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"client_keepidle"</span><span class="p">:</span> <span class="mi">180</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"duration_usage_threshold"</span><span class="p">:</span> <span class="mi">30</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_worker_txns"</span><span class="p">:</span> <span class="mi">65536</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"threads"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_listeners"</span><span class="p">:</span> <span class="mi">1024</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"conns"</span><span class="p">:</span> <span class="mi">500000</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ignore_bdb_cconn_limit"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"threads_usage_threshold"</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"backlog"</span><span class="p">:</span> <span class="mi">1024</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"threads"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="c1">// additional fields... </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span></code></pre> </div> <h3 id="get-all-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error </td> </tr> </tbody> </table> <h2 id="get-proxy"> Get proxy </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/proxies/<span class="o">{</span>int: uid<span class="o">}</span> </span></span></code></pre> </div> <p> Get a single proxy's info. </p> <h3 id="permissions-1"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_proxy_info"> view_proxy_info </a> </td> <td> admin <br/> cluster_member <br/> cluster_viewer <br/> db_member <br/> db_viewer </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request-1"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /proxies/1 </span></span></code></pre> </div> <h4 id="headers-1"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> </tbody> </table> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The proxy's unique node ID </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/proxy/"> proxy object </a> . </p> <h4 id="example-json-body-1"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"client_keepintvl"</span><span class="p">:</span> <span class="mi">30</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_worker_server_conns"</span><span class="p">:</span> <span class="mi">16384</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"client_keepcnt"</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_threads"</span><span class="p">:</span> <span class="mi">64</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ignore_bdb_cconn_output_buff_limits"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"dynamic_threads_scaling"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_worker_client_conns"</span><span class="p">:</span> <span class="mi">16384</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_servers"</span><span class="p">:</span> <span class="mi">4096</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"client_keepidle"</span><span class="p">:</span> <span class="mi">180</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"duration_usage_threshold"</span><span class="p">:</span> <span class="mi">30</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_worker_txns"</span><span class="p">:</span> <span class="mi">65536</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"threads"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_listeners"</span><span class="p">:</span> <span class="mi">1024</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"conns"</span><span class="p">:</span> <span class="mi">500000</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ignore_bdb_cconn_limit"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"threads_usage_threshold"</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"backlog"</span><span class="p">:</span> <span class="mi">1024</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="get-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Proxy UID does not exist </td> </tr> </tbody> </table> <h2 id="put-proxy"> Update proxy </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/proxies/<span class="o">{</span>int: uid<span class="o">}</span> </span></span></code></pre> </div> <p> Updates a proxy object, notifies the proxy, and waits for acknowledgment (ACK) unless the node is dead. </p> <p> Automatically restarts the proxy service if <code> allow_restart </code> is <code> true </code> and any updated parameters require a restart for the changes to take effect. For example, a restart is required if you change <code> threads </code> to a lower number. </p> <p> However, if <code> allow_restart </code> is <code> false </code> , such changes only take effect after the next proxy restart. </p> <h3 id="permissions-2"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#update_proxy"> update_proxy </a> </td> <td> admin </td> </tr> </tbody> </table> <h3 id="put-request"> Request </h3> <h4 id="example-http-request-2"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /proxies/1 </span></span></code></pre> </div> <h4 id="example-json-body-2"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"allow_restart"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"proxy"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"threads"</span><span class="p">:</span> <span class="mi">8</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h4 id="headers-2"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> <tr> <td> Content-Type </td> <td> application/json </td> <td> Request body media type </td> </tr> </tbody> </table> <h4 id="url-parameters-1"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The unique ID of the updated proxy. Corresponds to the node ID. </td> </tr> </tbody> </table> <h4 id="request-body"> Request body </h4> <p> Include a JSON object in the request body. The JSON object can contain the boolean field <code> allow_restart </code> and a <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/proxy/"> proxy object </a> with updated fields. </p> <h3 id="put-response"> Response </h3> <p> Returns a status code to indicate the success or failure of the proxy update. </p> <h3 id="put-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error, the request has been processed </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"> 400 Bad Request </a> </td> <td> Bad content provided </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Proxy does not exist </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> Error while waiting for confirmation from proxy </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5"> 504 Gateway Timeout </a> </td> <td> Timeout while waiting for confirmation from proxy </td> </tr> </tbody> </table> <h2 id="put-all-proxies"> Update all proxies </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/proxies </span></span></code></pre> </div> <p> Updates all the proxy objects, notifies the proxies, and waits for acknowledgment (ACK) unless the node is dead. </p> <p> Automatically restarts the relevant proxy services if <code> allow_restart </code> is <code> true </code> and any updated parameters require a restart for the changes to take effect. </p> <p> However, if <code> allow_restart </code> is <code> false </code> , such changes only take effect after the next proxy restart. </p> <h3 id="permissions-3"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#update_proxy"> update_proxy </a> </td> <td> admin </td> </tr> </tbody> </table> <h3 id="put-all-request"> Request </h3> <h4 id="example-http-request-3"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /proxies </span></span></code></pre> </div> <h4 id="example-json-body-3"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"allow_restart"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"proxy"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"threads"</span><span class="p">:</span> <span class="mi">8</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"max_threads"</span><span class="p">:</span> <span class="mi">12</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h4 id="headers-3"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> <tr> <td> Content-Type </td> <td> application/json </td> <td> Request body media type </td> </tr> </tbody> </table> <h4 id="request-body-1"> Request body </h4> <p> Include a JSON object in the request body. The JSON object can contain the boolean field <code> allow_restart </code> and a <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/proxy/"> proxy object </a> with updated fields. </p> <h3 id="put-all-response"> Response </h3> <p> Returns a status code to indicate the success or failure of the proxy updates. </p> <h3 id="put-all-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error, the request has been processed </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"> 400 Bad Request </a> </td> <td> Bad content provided </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> Error while waiting for confirmation from proxy </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5"> 504 Gateway Timeout </a> </td> <td> Timeout while waiting for confirmation from proxy </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/proxies/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/crdbs/.html
<section class="prose w-full py-12 max-w-none"> <h1> CRDBs requests </h1> <p class="text-lg -mt-5 mb-10"> Active-Active database requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-all-crdbs"> GET </a> </td> <td> <code> /v1/crdbs </code> </td> <td> Get all Active-Active databases </td> </tr> <tr> <td> <a href="#get-crdb"> GET </a> </td> <td> <code> /v1/crdbs/{crdb_guid} </code> </td> <td> Get a specific Active-Active database </td> </tr> <tr> <td> <a href="#patch-crdbs"> PATCH </a> </td> <td> <code> /v1/crdbs/{crdb_guid} </code> </td> <td> Update an Active-Active database </td> </tr> <tr> <td> <a href="#post-crdb"> POST </a> </td> <td> <code> /v1/crdbs </code> </td> <td> Create a new Active-Active database </td> </tr> <tr> <td> <a href="#delete-crdb"> DELETE </a> </td> <td> <code> /v1/crdbs/{crdb_guid} </code> </td> <td> Delete an Active-Active database </td> </tr> </tbody> </table> <h2 id="get-all-crdbs"> Get all Active-Active databases </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/crdbs </span></span></code></pre> </div> <p> Get a list of all Active-Active databases on the cluster. </p> <h3 id="get-all-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /crdbs </span></span></code></pre> </div> <h4 id="headers"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> X-Task-ID </td> <td> string </td> <td> Specified task ID </td> </tr> <tr> <td> X-Result-TTL </td> <td> integer </td> <td> Time (in seconds) to keep task result </td> </tr> </tbody> </table> <h3 id="get-all-response"> Response </h3> <p> Returns a JSON array of <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/"> CRDB objects </a> . </p> <h5 id="get-all-status-codes"> Status codes </h5> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> A list of Active-Active database. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"> 401 Unauthorized </a> </td> <td> Unauthorized request. Invalid credentials </td> </tr> </tbody> </table> <h2 id="get-crdb"> Get an Active-Active database </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/crdbs/<span class="o">{</span>crdb_guid<span class="o">}</span> </span></span></code></pre> </div> <p> Get a specific Active-Active database. </p> <h3 id="get-request"> Request </h3> <h4 id="example-http-request-1"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> GET /crdbs/552bbccb-99f3-4142-bd17-93d245f0bc79 </span></span></code></pre> </div> <h4 id="headers-1"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> X-Task-ID </td> <td> string </td> <td> Specified task ID </td> </tr> <tr> <td> X-Result-TTL </td> <td> integer </td> <td> Time (in seconds) to keep task result </td> </tr> </tbody> </table> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> crdb_guid </td> <td> string </td> <td> Globally unique Active-Active database ID (GUID) </td> </tr> </tbody> </table> <h4 id="query-parameters"> Query parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> instance_id </td> <td> integer </td> <td> Instance from which to get the Active-Active database information </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/"> CRDB object </a> . </p> <h4 id="get-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> Active-Active database information is returned. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"> 401 Unauthorized </a> </td> <td> Unauthorized request. Invalid credentials </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Database or configuration does not exist. </td> </tr> </tbody> </table> <h2 id="patch-crdbs"> Update an Active-Active database </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PATCH /v1/crdbs/<span class="o">{</span>crdb_guid<span class="o">}</span> </span></span></code></pre> </div> <p> Update an Active-Active database's configuration. </p> <p> In order to add or remove instances, use <a href="/docs/latest/operate/rs/references/rest-api/requests/crdbs/updates/#post-crdbs-updates"> <nobr> <code> POST crdbs/{crdb_guid}/updates </code> </nobr> </a> instead. </p> <h3 id="patch-request"> Request </h3> <h4 id="example-http-request-2"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> PATCH /crdbs/552bbccb-99f3-4142-bd17-93d245f0bc79 </span></span></code></pre> </div> <h4 id="headers-2"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> X-Task-ID </td> <td> string </td> <td> Specified task ID </td> </tr> <tr> <td> X-Result-TTL </td> <td> integer </td> <td> Time (in seconds) to keep task result </td> </tr> </tbody> </table> <h4 id="url-parameters-1"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> crdb_guid </td> <td> string </td> <td> Globally unique Active-Active database ID (GUID) </td> </tr> </tbody> </table> <h4 id="request-body"> Request body </h4> <p> Include a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/"> CRDB object </a> with updated fields in the request body. </p> <h3 id="patch-response"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb_task/"> CRDB task object </a> . </p> <h4 id="patch-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> The request has been accepted. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"> 400 Bad Request </a> </td> <td> The posted Active-Active database contains invalid parameters. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"> 401 Unauthorized </a> </td> <td> Unauthorized request. Invalid credentials </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Configuration or Active-Active database not found. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"> 406 Not Acceptable </a> </td> <td> The posted Active-Active database cannot be accepted. </td> </tr> </tbody> </table> <h2 id="post-crdb"> Create an Active-Active database </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/crdbs </span></span></code></pre> </div> <p> Create a new Active-Active database. </p> <h3 id="post-request"> Request </h3> <h4 id="example-http-request-3"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> POST /crdbs </span></span></code></pre> </div> <h4 id="headers-3"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> X-Task-ID </td> <td> string </td> <td> Specified task ID </td> </tr> <tr> <td> X-Result-TTL </td> <td> integer </td> <td> Time (in seconds) to keep task result </td> </tr> </tbody> </table> <h4 id="request-body-1"> Request body </h4> <p> Include a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/"> CRDB object </a> , which defines the Active-Active database, in the request body. </p> <h5 id="example-body"> Example body </h5> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"default_db_config"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"sample-crdb"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"memory_size"</span><span class="p">:</span> <span class="mi">214748365</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"instances"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"cluster"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://&lt;cluster1_FQDN&gt;:9443"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"credentials"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"username"</span><span class="p">:</span> <span class="s2">"&lt;username&gt;"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"password"</span><span class="p">:</span> <span class="s2">"&lt;password&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"cluster-1"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"compression"</span><span class="p">:</span> <span class="mi">6</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"cluster"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://&lt;cluster2_FQDN&gt;:9443"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"credentials"</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"username"</span><span class="p">:</span> <span class="s2">"&lt;username&gt;"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"password"</span><span class="p">:</span> <span class="s2">"&lt;password&gt;"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"cluster-2"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"compression"</span><span class="p">:</span> <span class="mi">6</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"sample-crdb"</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> This JSON body creates an Active-Active database without TLS and with two participating clusters. </p> <h3 id="post-response"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb_task/"> CRDB task object </a> . </p> <h4 id="post-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> The request has been accepted. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"> 400 Bad Request </a> </td> <td> The request is invalid or malformed. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"> 401 Unauthorized </a> </td> <td> Unauthorized request. Invalid credentials </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"> 406 Not Acceptable </a> </td> <td> The posted Active-Active database cannot be accepted. </td> </tr> </tbody> </table> <h2 id="delete-crdb"> Delete an Active-Active database </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /v1/crdbs/<span class="o">{</span>crdb_guid<span class="o">}</span> </span></span></code></pre> </div> <p> Delete an Active-Active database. </p> <h3 id="delete-request"> Request </h3> <h4 id="example-http-request-4"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> DELETE /crdbs/552bbccb-99f3-4142-bd17-93d245f0bc79 </span></span></code></pre> </div> <h4 id="headers-4"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> X-Task-ID </td> <td> string </td> <td> Specified task ID </td> </tr> <tr> <td> X-Result-TTL </td> <td> integer </td> <td> Time (in seconds) to keep task result </td> </tr> </tbody> </table> <h4 id="url-parameters-2"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> crdb_guid </td> <td> string </td> <td> Globally unique Active-Active database ID (GUID) </td> </tr> </tbody> </table> <h3 id="delete-response"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb_task/"> CRDB task object </a> . </p> <h4 id="delete-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> Action was successful. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"> 401 Unauthorized </a> </td> <td> Unauthorized request. Invalid credentials </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Configuration or Active-Active database not found. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"> 406 Not Acceptable </a> </td> <td> The Active-Active GUID is invalid or the Active-Active database was already deleted. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/crdbs/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-4-4-dec-2016/.html
<section class="prose w-full py-12 max-w-none"> <h1> RLEC 4.4 Release Notes (December 2016) </h1> <p> If you are upgrading from a previous version, make sure to review the <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/"> upgrade instructions </a> before beginning the upgrade process. </p> <p> You can upgrade to this version from any 4.3 version. If you have a version older than 4.3 you must first upgrade to 4.3 and only then upgrade to this version. </p> <h2 id="new-features"> New features </h2> <ul> <li> Databases can now be configured to have multiple proxies for improved performance. Note that when you upgrade the cluster to this version and then upgrade existing databases, the databases will be updated to use the Single proxy policy and Dense shard placement policy. For additional details, refer to <a href="/docs/latest/operate/rs/databases/configure/proxy-policy/"> Multiple active proxies </a> . </li> <li> Support for Redis version 3.2 added. When you install or upgrade the cluster the new default version for Redis databases will be 3.2 and when you upgrade the databases they will be updated to this version. If you would like to change the default version to Redis 3.0, refer to the instruction in the <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/"> Upgrading databases </a> If you would like to upgrade existing databases to the latest 3.0 minor version, refer to the Known Issues section below. </li> <li> The cluster can now be configured to support both private and public IPs to connect to database endpoints through both public and private networks. For additional details, refer to <a href="/docs/latest/operate/rs/networking/private-public-endpoints/"> Private and Public Endpoints </a> . </li> <li> <strong> rladmin status </strong> command output has been enhanced to include an indication on which node rladmin is running by adding the '*' sign next to the node entry, and to show the host name of the machine the node is running on. </li> <li> Users can now be assigned security roles to control what level of the databases or cluster the users can view and/or edit. </li> </ul> <h2 id="changes"> Changes </h2> <ul> <li> As result of adding the support for multiple proxies for a database, the following changes have been made: <ul> <li> When you upgrade the cluster to this version and then upgrade existing databases, the databases will be updated to use the Single proxy policy and Dense shard placement policy. </li> <li> <strong> rladmin status </strong> command output has been updated. </li> <li> <strong> failover [db &lt;db:id | name&gt;] endpoint &lt;id1 .. idN&gt; </strong> and <strong> migrate [db &lt;db:id | name&gt; | node &lt;origin node:id&gt;] endpoint &lt;id&gt; target_node &lt;id&gt; </strong> commands are no longer relevant for databases using the <strong> single | all-master-shards | all-nodes </strong> proxy policy. Instead proxies can be bound or unbounded to databases as needed. </li> <li> New <strong> rladmin </strong> commands were added, such as <strong> bind </strong> and <strong> placement </strong> . </li> </ul> </li> <li> RLEC has been updated to remove the need to use <strong> sudo </strong> in runtime. You still need to be root or use <strong> sudo </strong> when initially installing RLEC. </li> <li> You no longer need to be root or use <strong> sudo </strong> to run the rladmin command, now it is preferred to be a non-privileged user that is member of the <em> redislabs </em> group to run the command. </li> <li> All cluster services are now run using the supervisor mechanism. As a result starting, stopping and restarting RLEC services should be done using <strong> supervisorctl </strong> command from the OS CLI. </li> <li> Linux OS vm.swappiness is now advised to be set to zero, for more information see <a href="/docs/latest/operate/rs/installing-upgrading/configuring/linux-swap/"> Disabling Swap in Linux </a> . </li> </ul> <h2 id="important-fixed-issues-since-430"> Important fixed issues since 4.3.0 </h2> <ul> <li> RLEC-7542 - Add ability to create and manage role based user security </li> <li> RLEC-8283 - The cluster recovery process does not work properly when the cluster that needs to be recovered does not have a node with ID 1. </li> <li> RLEC-8284 - Add functionality to rladmin to mark a node as a quorum only node </li> <li> RLEC-8498 - Backup fails under rare conditions </li> <li> RLEC-8579 - rladmin supports uppercase for external_addr value </li> <li> RLEC-8656 - Fixed conflict with SELinux </li> <li> RLEC-8687 - Fixed issue where strong password requirements were not honored correctly. </li> <li> RLEC-8694 - DMC failed while creating DB with 75 (150 replicated) shards </li> <li> RLEC-8700 - Fixed issue with network split scenario </li> <li> RLEC-8833 - Fixed issue where in some cases endpoint were not getting new IPs after node replacement. </li> <li> RLEC-9069 - Fixed issue related to RHEL 7 and IPv6. </li> <li> RLEC-9156 - Fixed issue causing a full resync of data when a source or destination failure occurred. </li> <li> RLEC-9173 - Issue with writing data after master and replica failed </li> <li> RLEC-9235 - Issue with SSL connection error and self signed certificates </li> <li> RLEC-9491 - Fixed alerting issue due to incorrect measurement </li> <li> RLEC-9534 - Fixed issue with node remove command after RLEC uninstalled </li> <li> RLEC-9658 - Failed to import backup file from FTP server. </li> <li> RLEC-9737 - Fixed issue with backup process to use ephemeral storage when needed </li> <li> RLEC-9761 - UI had incorrect value increments </li> <li> RLEC-9827 - Server with a high number of cores and running RHEL can have issues running systune.sh </li> <li> RLEC-9853 - Fixed issues with logrotate on RHEL 7.1 so it runs as non-privileged user </li> <li> RLEC-9858 - If proxy crashed, in some cases this would prevent completion of redis failover process </li> <li> RLEC-9893 - DB recovery process doesn't recognize original rack name when in uppercase </li> <li> RLEC-9905 - x.509 certificate signed by custom CA cannot be loaded in UI </li> <li> RLEC-9925 - master endpoint and shards goes down if co-hosted with master of the cluster and the node goes down (single proxy policy) </li> <li> RLEC-9926 - Master shard could remain down if on the same node as the master of the cluster and the entire node goes down </li> <li> RLEC-10340 - Fixed a typo that crashed rladmin status output in some cases </li> </ul> <p> Changes in 4.4.2-42: </p> <ul> <li> RLEC-11941 - Upgrade to 4.4.2-35 on RHEL6 - leash failed when python2.6 is installed </li> <li> RLEC-11994 - RLEC 4.4.2-35: the UI doesn't display the DBs with replication </li> </ul> <p> Changes in 4.4.2 - 49 </p> <ul> <li> RLEC-11209 - Unable to run upgrade due to running_actions check </li> <li> RLEC-12647 - Backup to S3 with periods in bucket name are failing in some cases </li> </ul> <h2 id="known-issues"> Known issues </h2> <ul> <li> <strong> Issue: </strong> When upgrading to this version from a previous RLEC version, <strong> rladmin status </strong> output will show the database status as having an old version. When you upgrade the Redis database (using <strong> rladmin upgrade db </strong> command) the Redis version will be updated to 3.2 even if you updated the cluster's Redis default version to 3.0. <strong> Workaround: </strong> If you would like to cancel the old version indication in <strong> rladmin status </strong> without upgrading the Redis version to 3.2 you should run the <strong> rladmin upgrade db </strong> command with the <strong> keep_current_version </strong> flag which will ensure the database is upgraded to the latest 3.0 version supported by RLEC. </li> <li> <strong> Issue: </strong> RLEC-9200 - in a database configured with multiple proxies, if a client sends the MONITOR, CLIENT LIST or CLIENT KILL commands, only commands from clients connected from the same proxy are returned instead of all commands from all connections. <strong> Workaround: </strong> If you would like to get a result across all clients, you need to send the monitor command to all proxies and aggregate them. </li> <li> <strong> Issue: </strong> RLEC-9296 - Different actions in the cluster, like node failure or taking a node offline, might cause the Proxy policy to change Manual. <strong> Workaround: </strong> You can use the <strong> rladmin bind [db &lt;db:id | name&gt;] endpoint &lt;id&gt; policy &lt;single | all-master-shards | all-nodes&gt; </strong> command to set the policy back to the required policy, which will ensure all needed proxies are bounded. Note that existing client connections might disconnected as result of this process. </li> <li> <strong> Issue: </strong> RLEC-8787 - In some cases when using the replica-of feature, if the source database(s) are larget than the target database, the memory limit on the target database is not enforced and that used memory of the target database can go over the memory limit set. <strong> Workaround: </strong> You should make sure that the total memory limit of all source databases is not bigger than the memory limit of the target database. </li> <li> <strong> Issue: </strong> RLEC-8487 - Some Redis processes stay running after purging RLEC from the machine and causes an attempt to reinstall RLEC to fail. <strong> Workaround: </strong> Run the purge process for a second time and ensure that the Redis processes were removed. </li> <li> <strong> Issue: </strong> RLEC-8747 - When upgrading to this version, if the UI is open in the browser the UI might not work properly after the upgrade. <strong> Workaround: </strong> Refresh the browser and the UI will return to work properly. </li> <li> <strong> Issue: </strong> In the Replica Of process, if the target database does not have replication enabled and it is restarted or fails for any reason, the data on the target database might not be in sync with the source database, although the status of the Replica Of process indicates that it is. <strong> Workaround: </strong> You must manually stop and restart the synchronization process in order to ensure the databases are in sync. </li> <li> <strong> Issue: </strong> In the Replica Of process, if the source database is resharded while the Replica Of process is active, the synchronization process will fail. <strong> Workaround: </strong> You must manually stop and restart the synchronization process after the resharding of the source database is done. </li> <li> <strong> Issue: </strong> In the Replica Of process, if there is very high traffic on the database the Replica Of process might be restarted frequently due to the "replica buffer" being exceeded. In this case, you will often see the status of the Replica Of process display as "Syncing". <strong> Workaround: </strong> You must manually increase the "replica buffer" size through rladmin. To find the appropriate buffer size please contact support at: <a href="mailto:[email protected]"> [email protected] </a> . </li> <li> <strong> Issue: </strong> In a cluster that is configured to support rack-zone awareness, if the user forces migration of a master or replica shard through rladmin to a node on the same rack-zone as its corresponding master or replica shard, and later runs the rebalance process, the rebalance process will not migrate the shards to ensure rack-zone awareness compliance. <strong> Workaround: </strong> In the scenario described above, you must use rladmin to manually migrate the shard to a node on a valid rack-zone in order to ensure rack-zone awareness compliance. </li> <li> <strong> Issue: </strong> DNS doesn't change after having removed the external IP address. <strong> Workaround: </strong> Unbind IP from affected node and then bind it back. </li> <li> <strong> Issue </strong> : CCS gets an error and won't start if /var/opt/redislabs/persist/ does not exist. <strong> Workaround </strong> : Make sure this directory is not deleted and continues to exist. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/rlec-4-4-dec-2016/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/action/.html
<section class="prose w-full py-12 max-w-none"> <h1> Action object </h1> <p class="text-lg -mt-5 mb-10"> An object that represents cluster actions </p> <p> The cluster allows you to invoke general maintenance actions such as rebalancing or taking a node offline by moving all of its entities to other nodes. </p> <p> Actions are implemented as tasks in the cluster. Every task has a unique <code> task_id </code> assigned by the cluster, a task name which describes the task, a status, and additional task-specific parameters. </p> <p> The REST API provides a simplified interface that allows callers to invoke actions and query their status without a specific <code> task_id </code> . </p> <p> The action lifecycle is based on the following status and status transitions: </p> <a href="/docs/latest/images/rs/rest-api-action-cycle.png#no-click" sdata-lightbox="/images/rs/rest-api-action-cycle.png#no-click"> <img alt="Action lifecycle" src="/docs/latest/images/rs/rest-api-action-cycle.png#no-click"/> </a> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> progress </td> <td> float <nobr> (range: 0-100) </nobr> </td> <td> Represents percent completed (As of v7.4.2, the return value type changed to 'float' to provide improved progress indication) </td> </tr> <tr> <td> status </td> <td> queued </td> <td> Requested operation and added it to the queue to await processing </td> </tr> <tr> <td> </td> <td> starting </td> <td> Picked up operation from the queue and started processing </td> </tr> <tr> <td> </td> <td> running </td> <td> Currently executing operation </td> </tr> <tr> <td> </td> <td> cancelling </td> <td> Operation cancellation is in progress </td> </tr> <tr> <td> </td> <td> cancelled </td> <td> Operation cancelled </td> </tr> <tr> <td> </td> <td> completed </td> <td> Operation completed </td> </tr> <tr> <td> </td> <td> failed </td> <td> Operation failed </td> </tr> </tbody> </table> <p> When a task fails, the <code> error_code </code> and <code> error_message </code> fields describe the error. </p> <p> Possible <code> error_code </code> values: </p> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> internal_error </td> <td> An internal error that cannot be mapped to a more precise error code </td> </tr> <tr> <td> insufficient_resources </td> <td> The cluster does not have sufficient resources to complete the required operation </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/action/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.16.0/.html
<section class="prose w-full py-12"> <h1> RedisInsight v2.16.0, December 2022 </h1> <p class="text-lg -mt-5 mb-10"> RedisInsight v2.16.0 </p> <h2 id="2160-december-2022"> 2.16.0 (December 2022) </h2> <p> This is the General Availability (GA) release of RedisInsight 2.16. </p> <h3 id="highlights"> Highlights </h3> <ul> <li> Bulk import database connections from a file </li> <li> Navigation enhancements for the Tree view </li> <li> Pre-populated host, port, and database alias in the form when adding a new Redis database </li> </ul> <h3 id="details"> Details </h3> <p> <strong> Features and improvements </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1492"> #1492 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1497"> #1497 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1500"> #1500 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1502"> #1502 </a> Migrate your database connections from other Redis GUIs, including RESP.app, with the new feature to bulk import database connections from a file. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1506"> #1506 </a> Pre-populated host (127.0.0.1), port (6379, or 26379 for <a href="https://redis.io/docs/management/sentinel/"> Sentinel </a> connection type), and database alias in the form when adding a new Redis database </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1473"> #1473 </a> <strong> Browser </strong> view is renamed <strong> List </strong> view to avoid confusion with the Browser tool </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1464"> #1464 </a> Navigation enhancements for the Tree view, covering cases when filters are applied, the list of keys is refreshed or the view is switched to the Tree view </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1481"> #1481 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1482"> #1482 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1489"> #1489 </a> Indication of new database connections that have been manually added, auto-discovered or imported, but not opened yet </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1499"> #1499 </a> Display values of <a href="https://redis.io/docs/stack/json/"> JSON </a> keys when <a href="https://redis.io/commands/json.debug-memory/"> JSON.DEBUG MEMORY </a> is not available </li> </ul> <p> <strong> Bugs </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1514"> #1514 </a> Scan the database even when the <a href="https://redis.io/commands/dbsize/"> DBSIZE </a> returns 0 </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.16.0/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/installing-upgrading/install/.html
<section class="prose w-full py-12 max-w-none"> <h1> Install Redis Enterprise Software </h1> <p class="text-lg -mt-5 mb-10"> Install Redis Enterprise Software on Linux. </p> <p> After you <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/"> plan your deployment </a> , <a href="/docs/latest/operate/rs/installing-upgrading/install/prepare-install/download-install-package/"> download a Redis Enterprise Software installation package </a> , and finish <a href="/docs/latest/operate/rs/installing-upgrading/install/prepare-install/"> installation preparation </a> : </p> <ol> <li> <p> <a href="/docs/latest/operate/rs/installing-upgrading/install/install-on-linux/"> Install the Redis Enterprise Software package </a> on one of the nodes in the cluster. </p> </li> <li> <p> Repeat this process for each node in the cluster. </p> </li> </ol> <p> For installation on machines without an internet connection, see <a href="/docs/latest/operate/rs/installing-upgrading/install/offline-installation/"> Offline installation </a> . </p> <h2 id="permissions-and-access"> Permissions and access </h2> <ul> <li> <p> Redis Enterprise Software installation creates the <code> redislabs:redislabs </code> user and group. </p> <p> Assigning other users to the <code> redislabs </code> group is optional. Users belonging to the <code> redislabs </code> group have permission to read and execute (e.g. use the <code> rladmin </code> status command) but are not allowed to write (or delete) files or directories. </p> </li> <li> <p> Redis Enterprise Software is certified to run with permissions set to <code> 750 </code> , an industry standard. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> Do not reduce permissions to <code> 700 </code> . This configuration has not been tested and is not supported. </div> </div> </li> </ul> <h2 id="more-info-and-options"> More info and options </h2> <p> If you've already installed Redis Enterprise Software, you can also: </p> <ul> <li> <p> <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/"> Upgrade an existing deployment </a> . </p> </li> <li> <p> <a href="/docs/latest/operate/rs/installing-upgrading/uninstalling/"> Uninstall an existing deployment </a> . </p> </li> </ul> <p> To learn more about customization and find answers to related questions, see: </p> <ul> <li> <a href="/docs/latest/operate/rs/installing-upgrading/configuring/centos-rhel-firewall/"> CentOS/RHEL Firewall configuration </a> </li> <li> <a href="/docs/latest/operate/rs/installing-upgrading/configuring/change-location-socket-files/"> Change socket file location </a> </li> <li> <a href="/docs/latest/operate/rs/networking/cluster-dns/"> Cluster DNS configuration </a> </li> <li> <a href="/docs/latest/operate/rs/networking/cluster-lba-setup/"> Cluster load balancer setup </a> </li> <li> <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/file-locations/"> File locations </a> </li> <li> <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/supported-platforms/"> Supported platforms </a> </li> <li> <a href="/docs/latest/operate/rs/installing-upgrading/install/manage-installation-questions/"> Manage installation questions </a> </li> <li> <a href="/docs/latest/operate/rs/networking/mdns/"> mDNS client prerequisites </a> </li> <li> <a href="/docs/latest/operate/rs/installing-upgrading/install/customize-user-and-group/"> User and group ownership </a> </li> </ul> <h2 id="next-steps"> Next steps </h2> <p> After your cluster is set up with nodes, you can: </p> <ul> <li> <a href="/docs/latest/operate/rs/security/access-control/create-users/"> Add users </a> to the cluster with specific permissions. To begin, start with <a href="/docs/latest/operate/rs/security/access-control/"> Access control </a> . </li> <li> <a href="/docs/latest/operate/rs/databases/create/"> Create databases </a> to use with your applications. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/installing-upgrading/install/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/databases/import-export/replica-of/.html
<section class="prose w-full py-12 max-w-none"> <h1> Replica Of geo-distributed Redis </h1> <p class="text-lg -mt-5 mb-10"> Replica Of provides read-only access to replicas of the dataset from different geographical locations. </p> <p> In Redis Enterprise, the Replica Of feature provides active-passive geo-distribution to applications for read-only access to replicas of the dataset from different geographical locations. The Redis Enterprise implementation of active-passive replication is called Replica Of. </p> <p> In Replica Of, an administrator designates a database as a replica (destination) of one or more databases (sources). After the initial data load from source to destination is completed, all write commands are synchronized from the sources to the destination. Replica Of lets you distribute the read load of your application across multiple databases or synchronize the database, either within Redis Enterprise or external to Redis Enterprise, to another database. </p> <p> You can <a href="/docs/latest/operate/rs/databases/import-export/replica-of/create/"> create Active-Passive </a> databases on Redis Enterprise Software or Redis Cloud. </p> <p> <a href="/docs/latest/operate/rs/databases/active-active/"> Active-Active Geo-Distribution (CRDB) </a> provides these benefits and also provides write access to all of the database replicas. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> Configuring a database as a replica of the database that it replicates creates a cyclical replication and is not supported. </div> </div> <p> The Replica Of is defined in the context of the destination database by specifying the source databases. </p> <p> A destination database can have a maximum of thirty-two (32) source databases. </p> <p> If only one source is defined, then the command execution order in the source is kept in the destination. However, when multiple sources are defined, commands that are replicated from the source databases are executed in the order in which they reach the destination database. As a result, commands that were executed in a certain order when compared across source databases might be executed in a different order on the destination database. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> The Replica Of feature should not be confused with the in-memory <a href="/docs/latest/operate/rs/databases/durability-ha/replication/"> Database replication </a> feature, which is used for creating a master / replica configuration that enables ensuring database high-availability. </div> </div> <h2 id="replication-process"> Replication process </h2> <p> When a database is defined as a replica of another database, all its existing data is deleted and replaced by data that is loaded from the source database. </p> <p> Once the initial data load is completed, an ongoing synchronization process takes place to keep the destination always synchronized with its source. During the ongoing synchronization process, there is a certain delay between the time when a command was executed on the source and when it is executed on the destination. This delay is referred to as the <strong> Lag </strong> . </p> <p> When there is a <strong> synchronization error </strong> , <strong> the process might stop </strong> or it might continue running on the assumption that the error automatically resolves. The result depends on the error type. See more details below. </p> <p> In addition, <strong> the user can manually stop the synchronization process </strong> . </p> <p> When the process is in the stopped state - whether stopped by the user or by the system - the user can restart the process. <strong> Restarting the process causes the synchronization process to flush the DB and restart the process from the beginning </strong> . </p> <h3 id="replica-of-status"> Replica Of status </h3> <p> The replication process can have the following statuses: </p> <ul> <li> <strong> Syncing </strong> - indicates that the synchronization process has started from scratch. Progress is indicated in percentages (%). </li> <li> <strong> Synced </strong> - indicates that the initial synchronization process was completed and the destination is synchronizing changes on an ongoing basis. The <strong> Lag </strong> delay in synchronization with the source is indicated as a time duration. </li> <li> <strong> Sync stopped </strong> - indicates that the synchronization process is currently not running and the user needs to restart it in order for it to continue running. This status happens if the user stops the process, or if certain errors arose that prevent synchronization from continuing without manual intervention. See more details below. </li> </ul> <p> The statuses above are shown for the source database. In addition, a timestamp is shown on the source indicating when the last command from the source was executed on the destination. </p> <p> The system also displays the destination database status as an aggregate of the statuses of all the sources. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> If you encounter issues with the Replica Of process, refer to the troubleshooting section <a href="/docs/latest/operate/rs/databases/import-export/replica-of/replicaof-repeatedly-fails/"> Replica Of repeatedly fails </a> . </div> </div> <h3 id="synchronization-errors"> Synchronization errors </h3> <p> Certain errors that occur during the synchronization process require user intervention for their resolution. When such errors occur, the synchronization process is automatically stopped. </p> <p> For other errors, the synchronization process continues running on the assumption that the error automatically resolves. </p> <p> Examples of errors that require user intervention for their resolution and that stop the synchronization process include: </p> <ul> <li> Error authenticating with the source database. </li> <li> Cross slot violation error while executing a command on a sharded destination database. </li> <li> Out-of-memory error on a source or on the destination database. </li> </ul> <p> Example of an error that does not cause the synchronization process to stop: </p> <ul> <li> Connection error with the source database. A connection error might occur occasionally, for example as result of temporary network issues that get resolved. Depending on the connection error and its duration the process might be able to start syncing from the last point it reached (partial sync) or require a complete resynchronization from scratch across all sources (full sync). </li> </ul> <h2 id="encryption"> Encryption </h2> <p> Replica Of supports the ability to encrypt uni-directional replication communications between source and destination clusters utilizing TLS 1.2 based encryption. </p> <h2 id="data-compression-for-replica-of"> Data compression for Replica Of </h2> <p> When the Replica Of is defined across different Redis Enterprise Software clusters, it may be beneficial to compress the data that flows through the network (depending on where the clusters physically reside and the available network). </p> <p> Compressing the data reduces the traffic and can help: </p> <ul> <li> Resolve throughput issues </li> <li> Reduce network traffic costs </li> </ul> <p> Compressing the data does have trade-offs, which is why it should not always be turned on by default. For example: </p> <ul> <li> It uses CPU and disk resources to compress the data before sending it to the network and decompress it on the other side. </li> <li> It takes time to compress and decompress the data which can increase latency. </li> <li> Replication is disk-based and done gradually, shard by shard in the case of a multi-shard database. This may have an impact on replication times depending on the speed of the disks and load on the database. </li> <li> If traffic is too fast and the compression takes too much time it can cause the replication process to fail and be restarted. </li> </ul> <p> It is advised that you test compression out in a lower environment before enabling it in production. </p> <p> In the Redis Enterprise Software management UI, when designating a Replica Of source from a different Redis Enterprise Software cluster, there is also an option to enable compression. When enabled, gzip compression with level -6 is utilized. </p> <h2 id="database-clustering-sharding-implications"> Database clustering (sharding) implications </h2> <p> If a <strong> source </strong> database is sharded, that entire database is treated as a single source for the destination database. </p> <p> If the <strong> destination </strong> database is sharded, when the commands replicated from the source are executed on the destination database, the destination database's hashing function is executed to determine to which shard/s the command refers. </p> <p> The source and destination can have different shard counts and functions for placement of keys. </p> <h3 id="synchronization-in-active-passive-replication"> Synchronization in Active-Passive Replication </h3> <p> In Active-Passive databases, one cluster hosts the source database that receives read-write operations and the other clusters host destination databases that receive synchronization updates from the source database. </p> <p> When there is a significant difference between the source and destination databases, the destination database flushes all of the data from its memory and starts synchronizing the data again. This process is called a <strong> full sync </strong> . </p> <p> For example, if the database updates for the destination databases that are stored by the destination database in a synchronization backlog exceed their allocated memory, the source database starts a full sync. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> When you failover to the destination database for write operations, make sure that you disable <strong> Replica Of </strong> before you direct clients to the destination database. This avoids a full sync that can overwrite your data. </div> </div> <h2 id="active-passive-replication-backlog"> Active-Passive replication backlog </h2> <p> In addition to the <a href="/docs/latest/operate/rs/databases/durability-ha/replication/#database-replication-backlog"> database replication backlog </a> , active-passive databases maintain a replication backlog (per shard) to synchronize the database instances between clusters. By default, the replication backlog is set to one percent (1%) of the database size divided by the database number of shards and ranges between 1MB to 250MB per shard. Use the <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/"> <code> rladmin </code> </a> utility to control the size of the replication backlog. You can set it to <code> auto </code> or set a specific size. </p> <p> For an Active-Passive database: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin tune db &lt;db:id | name&gt; repl_backlog &lt;Backlog size in MB or 'auto'&gt; </span></span></code></pre> </div> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> On an Active-Passive database, the replication backlog configuration applies to both the replication backlog for shards synchronization and for synchronization of database instances between clusters. </div> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/databases/import-export/replica-of/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/write-behind/architecture/.html
<section class="prose w-full py-12 max-w-none"> <h1> Write-behind architecture </h1> <p class="text-lg -mt-5 mb-10"> Discover the main components of Write-behind </p> <p> Write-behind lets you integrate Redis Enterprise (as the source of changes to data) and downstream databases or datastores. Write-behind captures any changes to a selected set of key patterns in a Redis keyspace and asynchronously writes them in small batches to the downstream database. This means that your app doesn't need to handle the data remodeling or manage the connection with the downstream database. </p> <p> Write-behind can normalize a key in Redis to several records in one or more tables at the target. To learn more about write-behind declarative jobs and normalization, see the <a href="/docs/latest/integrate/write-behind/quickstart/write-behind-guide/"> write-behind quick start guide </a> . </p> <h2 id="write-behind-topology"> Write-behind topology </h2> <p> Write-behind's CLI and engine are shipped as one product that can run both ingest and write-behind pipelines. However, the two different types of pipeline have different topologies. </p> <p> The Write-behind engine is installed on the Redis database that contains the application data and not on a separate staging Redis database. The Write-behind data streams and its control plane add only a small footprint of a few hundred MB to the Redis database. In the write-behind topology, Write-behind processes data in parallel on each shard and establishes a single connection from each shard to the downstream database. </p> <h3 id="model-translation"> Model translation </h3> <p> Write-behind can track changes to the following Redis types: </p> <ul> <li> <a href="/docs/latest/develop/data-types/hashes/"> Hash </a> </li> <li> <a href="/docs/latest/develop/data-types/json/"> JSON </a> </li> <li> <a href="/docs/latest/develop/data-types/sets/"> Set </a> </li> <li> <a href="/docs/latest/develop/data-types/sorted-sets/"> Sorted Set </a> </li> </ul> <p> Unlike the ingest scenario, write-behind has no default behavior for model translation. You must always create a declarative job to specify the mapping between Redis keys and target database records. The job configuration has <code> keys </code> and <code> mapping </code> sections that help make this an easy task. </p> <h2 id="write-behind-components"> Write-behind components </h2> <h3 id="write-behind-cli"> Write-behind CLI </h3> <p> Write-behind's Python-based CLI is highly intuitive to use and performs validations to help you avoid mistakes. The CLI makes it easy to set up Write-behind and manage it over its entire lifecycle. </p> <h3 id="write-behind-engine"> Write-behind Engine </h3> <p> Write-behind uses Redis Gears as its runtime environment. The Gears and Write-behind engine logic are installed on all source Redis Enterprise database shards, but only primary shards process events and handle the pipeline. </p> <p> The Write-behind Engine reads Redis change events from Redis Streams (one for each tracked key-pattern), processes them, and translates them to SQL or whatever other language the target database uses. </p> <p> Write-behind writes changes to the target in small batches using transactions. Write-behind guarantees <em> at-least once </em> delivery. If any network problems, disconnections, or other temporary failures occur, Write-behind will keep attempting to write the changes to the target. If a hard reject occurs, Write-behind keeps the reject record and the reason in a <em> dead letter queue (DLQ) </em> . </p> <h3 id="write-behind-configuration"> Write-behind configuration </h3> <p> The Write-behind configuration is persisted at the cluster level. The configuration is written by the CLI <a href="/docs/latest/integrate/write-behind/reference/cli/redis-di-deploy/"> <code> deploy </code> </a> command, which saves all changes to the configuration file. This mechanism allows for automatic configuration of new shards whenever you need them, and it can survive shard and node failure. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/write-behind/architecture/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/ocsp/.html
<section class="prose w-full py-12 max-w-none"> <h1> OCSP object </h1> <p class="text-lg -mt-5 mb-10"> An object that represents the cluster's OCSP configuration </p> <p> An API object that represents the cluster's OCSP configuration. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> ocsp_functionality </td> <td> boolean (default: false) </td> <td> Enables or turns off OCSP for the cluster </td> </tr> <tr> <td> query_frequency </td> <td> integer <nobr> (range: 60-86400) </nobr> (default: 3600) </td> <td> The time interval in seconds between OCSP queries to check the certificate’s status </td> </tr> <tr> <td> recovery_frequency </td> <td> integer <nobr> (range: 60-86400) </nobr> (default: 60) </td> <td> The time interval in seconds between retries after the OCSP responder returns an invalid status for the certificate </td> </tr> <tr> <td> recovery_max_tries </td> <td> integer <nobr> (range: 1-100) </nobr> (default: 5) </td> <td> The number of retries before the validation query fails and invalidates the certificate </td> </tr> <tr> <td> responder_url </td> <td> string </td> <td> The OCSP server URL embedded in the proxy certificate (if available) (read-only) </td> </tr> <tr> <td> response_timeout </td> <td> integer <nobr> (range: 1-60) </nobr> (default: 1) </td> <td> The time interval in seconds to wait for a response before timing out </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/ocsp/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/clusters/optimize/optimization/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster environment optimization </h1> <p class="text-lg -mt-5 mb-10"> Optimize your cluster environments for better performance. </p> <p> Redis Enterprise Software uses various algorithms to optimize performance. As part of this process, Redis Enterprise Software examines usage and load to adjust its runtime configuration. Depending on your specific usage and load, Redis Enterprise Software might take some time to adjust for optimal performance. </p> <p> To ensure optimal performance, you must run your workload several times and for a long duration until performance stabilizes. </p> <h2 id="failure-detection-sensitivity-policies"> Failure detection sensitivity policies </h2> <p> You can optimize your cluster's thresholds and timeouts for different environments using the <code> failure_detection_sensitivity </code> cluster policy: </p> <ul> <li> <p> <code> high </code> (previously known as <code> local-network watchdog_profile </code> ) – high failure detection sensitivity, lower thresholds, and faster failure detection and failover </p> </li> <li> <p> <code> low </code> (previously known as <code> cloud watchdog_profile </code> ) – low failure detection sensitivity and higher tolerance for latency variance (also called network jitter) </p> </li> </ul> <p> Depending on which policy you choose, Redis Enterprise Software uses different thresholds to make operation-related decisions. </p> <p> The default policy is <code> high </code> failure detection sensitivity for <code> local-network </code> environments. If you are running Redis Enterprise in a cloud environment, you should change the configuration. </p> <h2 id="change-failure-detection-sensitivity"> Change failure detection sensitivity </h2> <p> To change the cluster's <code> failure_detection_sensitivity </code> , run one of the following <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-cluster"> <code> rladmin </code> </a> commands. </p> <ul> <li> <p> For Redis Enterprise Software version 6.4.2-69 and later, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster failure_detection_sensitivity <span class="o">[</span> low <span class="p">|</span> high <span class="o">]</span> </span></span></code></pre> </div> </li> <li> <p> For Redis Enterprise Software version 6.4.2-61 and earlier, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster watchdog_profile <span class="o">[</span> cloud <span class="p">|</span> local-network <span class="o">]</span> </span></span></code></pre> </div> </li> </ul> <p> If Redis Enterprise Software still does not meet your performance expectations after following these instructions, <a href="https://redis.com/company/support/"> contact support </a> for help optimizing your environment. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/clusters/optimize/optimization/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/cloud-integrations/gcp-marketplace/.html
<section class="prose w-full py-12 max-w-none"> <h1> Sign up for Redis Cloud with Google Cloud Marketplace </h1> <p class="text-lg -mt-5 mb-10"> Shows how to subscribe to Redis Cloud using Google Cloud Marketplace </p> <p> You can use Google Cloud Marketplace to subscribe to Redis Cloud. This lets you provision according to your needs and pay using your Google Cloud account. </p> <p> Here's how to subscribe to Redis Cloud with Google Cloud Marketplace: </p> <ol> <li> <p> Sign in to the <a href="https://console.cloud.google.com/"> Google Cloud console </a> . </p> </li> <li> <p> Identify the Google Cloud Billing account that will subscribe to Redis Cloud. This account must have one of the following sets of Identity and Access Management (IAM) Roles: </p> <ul> <li> <a href="https://cloud.google.com/billing/docs/how-to/billing-access#overview-of-cloud-billing-roles-in-cloud-iam"> Billing Administrator </a> ( <code> roles/billing.admin </code> ), OR </li> <li> <a href="https://cloud.google.com/billing/docs/how-to/billing-access#overview-of-cloud-billing-roles-in-cloud-iam"> Billing User </a> ( <code> roles/billing.user </code> ) AND <a href="https://cloud.google.com/marketplace/docs/access-control#roles-permissions"> Consumer Procurement Order Administrator </a> </li> </ul> <p> If you don't have the correct roles, request access from your Google Cloud Billing Administrator or Organization Administrator. For more information about granting roles, see <a href="https://cloud.google.com/marketplace/docs/access-control"> Access control for Google Cloud Marketplace </a> . </p> </li> <li> <p> Search Google Cloud Marketplace for <a href="https://console.cloud.google.com/marketplace/product/redis-marketplace-isaas/redis-enterprise-cloud-flexible-plan"> Redis® Cloud Cache and Vector Database </a> . </p> <a href="/docs/latest/images/rc/gcp-marketplace-rc-payg-plan.png" sdata-lightbox="/images/rc/gcp-marketplace-rc-payg-plan.png"> <img alt="The Redis Cloud - Pay as You Go plan listing on Google Cloud Marketplace" src="/docs/latest/images/rc/gcp-marketplace-rc-payg-plan.png"/> </a> <p> Alternatively, in the navigation panel, select <strong> View all products </strong> and select <strong> Redis Cloud </strong> under <strong> Databases </strong> . You can pin Redis Cloud for easy access. </p> <p> Or, click on the URL provided by your Redis seller for a private offer for <a href="https://console.cloud.google.com/marketplace/product/redis-marketplace-isaas/redis-enterprise-cloud-flexible-plan"> Redis® Cloud Cache and Vector Database </a> and accept the private offer. </p> </li> <li> <p> Select the <strong> Subscribe </strong> button. This redirects you to the subscription details page. </p> </li> <li> <p> Under <strong> Purchase Details </strong> , select the Google Cloud Billing account that will subscribe to Redis Cloud. Review the subscription details, accept the terms, and select <strong> Subscribe </strong> . </p> </li> <li> <p> When you subscribe for the first time, select <strong> Sign Up with Redis </strong> . This will redirect you to the <a href="https://cloud.redis.io"> Redis Cloud console </a> . </p> </li> <li> <p> Create a Redis Cloud account or sign in to an existing account. You must have the <strong> Account Owner </strong> role. </p> </li> <li> <p> Select the Redis account to be mapped to your GCP Marketplace account and confirm that your Marketplace account will pay for your Redis Cloud resources going forward. </p> <a href="/docs/latest/images/rc/gcp-marketplace-map-account-dialog.png" sdata-lightbox="/images/rc/gcp-marketplace-map-account-dialog.png"> <img alt="Use the GCP Marketplace dialog to map your Redis Cloud account to your Google Cloud Marketplace account." src="/docs/latest/images/rc/gcp-marketplace-map-account-dialog.png" width="75%"/> </a> </li> <li> <p> Select <strong> Connect account </strong> to confirm your choice. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> You must complete this step to bill your Redis Cloud resources to your Google Cloud Marketplace account. </div> </div> </li> <li> <p> After you connect your Redis account to your Google Cloud Marketplace account, a message appears in the upper left corner of the account panel. </p> <a href="/docs/latest/images/rc/gcp-marketplace-billing-badge.png" sdata-lightbox="/images/rc/gcp-marketplace-billing-badge.png"> <img alt="The Google Cloud Marketplace badge appears when your Redis Cloud account is mapped to a Google Cloud Marketplace account." src="/docs/latest/images/rc/gcp-marketplace-billing-badge.png"/> </a> </li> <li> <p> On the Google Cloud Marketplace listing, select <strong> Manage on provider </strong> to go to the <a href="https://cloud.redis.io"> Redis Cloud console </a> . </p> <a href="/docs/latest/images/rc/gcp-marketplace-manage-on-provider.png" sdata-lightbox="/images/rc/gcp-marketplace-manage-on-provider.png"> <img alt="The Manage on Provider button" src="/docs/latest/images/rc/gcp-marketplace-manage-on-provider.png"/> </a> </li> </ol> <p> At this point, you can create a new database using the <a href="/docs/latest/operate/rc/databases/create-database/"> standard workflow </a> , with one important change. You don't need to enter a payment method, as it automatically uses your Google Cloud Marketplace account. </p> <p> To confirm this, review the payment method associated with your subscription. </p> <p> Additional users can be added on the Redis Cloud console using the <a href="/docs/latest/operate/rc/security/access-control/access-management/"> Access Management </a> page. </p> <p> If your Google Cloud Marketplace account is deactivated or otherwise unavailable, you can't use your subscription until you update the billing method. For help, <a href="https://redis.io/support/"> contact support </a> . </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/cloud-integrations/gcp-marketplace/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/json.debug-memory/.html
<section class="prose w-full py-12"> <h1 class="command-name"> JSON.DEBUG MEMORY </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">JSON.DEBUG MEMORY key [path]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/json"> JSON 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key </dd> </dl> <p> Report a value's memory usage in bytes </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key to parse. </p> </details> <h2 id="optional-arguments"> Optional arguments </h2> <details open=""> <summary> <code> path </code> </summary> <p> is JSONPath to specify. Default is root <code> $ </code> . </p> </details> <h2 id="return"> Return </h2> <p> JSON.DEBUG MEMORY returns an integer reply specified as the value size in bytes. For more information about replies, see <a href="/docs/latest/develop/reference/protocol-spec/"> Redis serialization protocol specification </a> . </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Report a value's memory usage in bytes </b> </summary> <p> Create a JSON document. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.SET item:2 $ <span class="s1">'{"name":"Wireless earbuds","description":"Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":64.99,"stock":17,"colors":["black","white"], "max_level":[80, 100, 120]}'</span> </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> Get the values' memory usage in bytes. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.DEBUG MEMORY item:2 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">253</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/json.set/"> <code> JSON.SET </code> </a> | <a href="/docs/latest/commands/json.arrlen/"> <code> JSON.ARRLEN </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <ul> <li> <a href="/docs/latest/develop/data-types/json/"> RedisJSON </a> </li> <li> <a href="/docs/latest/develop/interact/search-and-query/indexing/"> Index and search JSON documents </a> </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/json.debug-memory/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/nodes/snapshots/.html
<section class="prose w-full py-12 max-w-none"> <h1> Node snapshot requests </h1> <p class="text-lg -mt-5 mb-10"> Node snapshot requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-snapshots"> GET </a> </td> <td> <code> /v1/nodes/{uid}/snapshots </code> </td> <td> Get node snapshots </td> </tr> <tr> <td> <a href="#delete-snapshot"> DELETE </a> </td> <td> <code> /v1/nodes/{uid}/snapshots/{snapshot_name} </code> </td> <td> Delete a node snapshot </td> </tr> </tbody> </table> <h2 id="get-snapshots"> Get node snapshots </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/nodes/<span class="o">{</span>int: uid<span class="o">}</span>/snapshots </span></span></code></pre> </div> <p> Get all cluster node snapshots of the specified node. </p> <h3 id="permissions"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/permissions/#view_node_info"> view_node_info </a> </td> <td> admin <br/> cluster_member <br/> cluster_viewer <br/> db_member <br/> db_viewer <br/> user_manager </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /nodes/1/snapshots </span></span></code></pre> </div> <h4 id="headers"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cnm.cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> </tbody> </table> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The unique ID of the node requested. </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns an array of node snapshot JSON objects. </p> <h4 id="example-json-body"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"created_time"</span><span class="p">:</span> <span class="s2">"2024-01-10 20:55:54"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"nightly_snapshot_1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"created_time"</span><span class="p">:</span> <span class="s2">"2024-01-11 20:55:54"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"nightly_snapshot_2"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">]</span> </span></span></code></pre> </div> <h3 id="get-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Node UID does not exist </td> </tr> </tbody> </table> <h2 id="delete-snapshot"> Delete node snapshot </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /v1/nodes/<span class="o">{</span>int: uid<span class="o">}</span>/snapshots/<span class="o">{</span>snapshot_name<span class="o">}</span> </span></span></code></pre> </div> <p> Delete a cluster node snapshot. Snapshots created by maintenance mode are not deleted. </p> <h3 id="permissions-1"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/permissions/#update_node"> update_node </a> </td> <td> admin </td> </tr> </tbody> </table> <h3 id="delete-request"> Request </h3> <h4 id="example-http-request-1"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /nodes/1/snapshots/nightly_snapshot_19 </span></span></code></pre> </div> <h4 id="request-headers"> Request headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> cluster.fqdn </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> application/json </td> <td> Accepted media type </td> </tr> </tbody> </table> <h4 id="url-parameters-1"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The unique ID of the updated node. </td> </tr> <tr> <td> snapshot_name </td> <td> string </td> <td> The unique name of the snapshot to delete. </td> </tr> </tbody> </table> <h3 id="delete-response"> Response </h3> <p> Returns a JSON object that represents the deleted node snapshot. </p> <h4 id="example-json-body-1"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"created_time"</span><span class="p">:</span> <span class="s2">"2024-01-11 20:55:54"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"nightly_snapshot_19"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h4 id="delete-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> No error </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4"> 403 Forbidden </a> </td> <td> Node snapshot is a maintenance snapshot and cannot be deleted </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Node uid does not exist </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Snapshot name does not exist for this node uid </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/nodes/snapshots/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/crdbs/updates/.html
<section class="prose w-full py-12 max-w-none"> <h1> CRDB updates requests </h1> <p class="text-lg -mt-5 mb-10"> Update Active-Active configuration requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#post-crdbs-updates"> POST </a> </td> <td> <code> /v1/crdbs/{crdb_guid}/updates </code> </td> <td> Modify Active-Active confgurarion </td> </tr> </tbody> </table> <h2 id="post-crdbs-updates"> Modify Active-Active configuration </h2> <pre><code>POST /v1/crdbs/{crdb_guid}/updates </code></pre> <p> Modify Active-Active configuration. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> This is a very powerful API request and can cause damage if used incorrectly. </div> </div> <p> In order to add or remove instances, you must use this API. For simple configuration updates, it is recommended to use PATCH on /crdbs/{crdb_guid} instead. </p> <p> Updating default_db_config affects both existing and new instances that may be added. </p> <p> When you update db_config, it changes the configuration of the database that you specify. This field overrides corresponding fields (if any) in default_db_config. </p> <h3 id="post-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>POST /crdbs/1/updates </code></pre> <h4 id="request-headers"> Request headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> X-Task-ID </td> <td> string </td> <td> Specified task ID </td> </tr> <tr> <td> X-Result-TTL </td> <td> integer </td> <td> Time (in seconds) to keep task result </td> </tr> </tbody> </table> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> crdb_guid </td> <td> string </td> <td> Globally unique Active-Active database ID (GUID) </td> </tr> </tbody> </table> <h4 id="request-body"> Request body </h4> <p> Include a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/modify_request/"> CRDB modify_request object </a> with updated fields in the request body. </p> <h3 id="post-response"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb_task/"> CRDB task object </a> . </p> <h3 id="post-status-codes"> Status codes </h3> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> The request has been accepted. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"> 400 Bad Request </a> </td> <td> The posted Active-Active database contains invalid parameters. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"> 401 Unauthorized </a> </td> <td> Unauthorized request. Invalid credentials </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Configuration, instance or Active-Active database not found. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"> 406 Not Acceptable </a> </td> <td> The posted Active-Active database cannot be accepted. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/crdbs/updates/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/groupstream.html
<section class="prose w-full py-12"> <h1> Commands </h1> </section>
https://redis.io/docs/latest/operate/rs/7.4/databases/migrate-shards/.html
<section class="prose w-full py-12 max-w-none"> <h1> Migrate database shards </h1> <p class="text-lg -mt-5 mb-10"> How to migrate database shards to other nodes in a Redis Software cluster. </p> <p> To migrate database shards to other nodes in the cluster, you can use the <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/migrate/"> <code> rladmin migrate </code> </a> command or <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/actions/migrate/"> REST API requests </a> . </p> <h2 id="use-cases-for-shard-migration"> Use cases for shard migration </h2> <p> Migrate database shards to a different node in the following scenarios: </p> <ul> <li> <p> Before node removal. </p> </li> <li> <p> To balance the database manually in case of latency issues or uneven load distribution across nodes. </p> </li> <li> <p> To manage node resources, such as memory usage. </p> </li> </ul> <h2 id="considerations-for-shard-migration"> Considerations for shard migration </h2> <p> For databases with replication: </p> <ul> <li> <p> Migrating a shard will not cause disruptions since a primary shard will still be available. </p> </li> <li> <p> If you try to migrate a primary shard, it will be demoted to a replica shard and a replica shard will be promoted to primary before the migration. If you set <code> "preserve_roles": true </code> in the request, a second failover will occur after the migration finishes to change the migrated shard's role back to primary. </p> </li> </ul> <p> For databases without replication, the migrated shard will not be available until the migration is done. </p> <p> Connected clients shouldn't be disconnected in either case. </p> <p> If too many primary shards are placed on the same node, it can impact database performance. </p> <h2 id="migrate-specific-shard"> Migrate specific shard </h2> <p> To migrate a specific database shard, use one of the following methods: </p> <ul> <li> <p> <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/migrate/#migrate-shard"> <code> rladmin migrate shard </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin migrate shard &lt;shard_id&gt; target_node &lt;node_id&gt; </span></span></code></pre> </div> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/actions/migrate/#post-shard"> Migrate shard </a> REST API request: </p> <p> Specify the ID of the shard to migrate in the request path and the destination node's ID as the <code> target_node_uid </code> in the request body. See the <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/actions/migrate/#post-request-body"> request reference </a> for more options. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/shards/&lt;shard_id&gt;/actions/migrate </span></span><span class="line"><span class="cl"><span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"target_node_uid"</span>: &lt;node_id&gt; </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span></code></pre> </div> <p> Example JSON response body: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"action_uid"</span><span class="p">:</span> <span class="s2">"&lt;action_id&gt;"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Migrate was triggered"</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> You can track the action's progress with a <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/actions/#get-action"> <code> GET /v1/actions/&lt;action_uid&gt; </code> </a> request. </p> </li> </ul> <h2 id="migrate-multiple-shards"> Migrate multiple shards </h2> <p> To migrate multiple database shards, use one of the following methods: </p> <ul> <li> <p> <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/migrate/#migrate-shard"> <code> rladmin migrate shard </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin migrate shard &lt;shard_id1&gt; &lt;shard_id2&gt; &lt;shard_id3&gt; target_node &lt;node_id&gt; </span></span></code></pre> </div> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/actions/migrate/#post-multi-shards"> Migrate multiple shards </a> REST API request: </p> <p> Specify the IDs of the shards to migrate in the <code> shard_uids </code> list and the destination node's ID as the <code> target_node_uid </code> in the request body. See the <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/actions/migrate/#post-multi-request-body"> request reference </a> for more options. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/shards/actions/migrate </span></span><span class="line"><span class="cl"><span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"shard_uids"</span>: <span class="o">[</span><span class="s2">"&lt;shard_id1&gt;"</span>,<span class="s2">"&lt;shard_id2&gt;"</span>,<span class="s2">"&lt;shard_id3&gt;"</span><span class="o">]</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"target_node_uid"</span>: &lt;node_id&gt; </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span></code></pre> </div> <p> Example JSON response body: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"action_uid"</span><span class="p">:</span> <span class="s2">"&lt;action_id&gt;"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Migrate was triggered"</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> You can track the action's progress with a <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/actions/#get-action"> <code> GET /v1/actions/&lt;action_uid&gt; </code> </a> request. </p> </li> </ul> <h2 id="migrate-all-shards-from-a-node"> Migrate all shards from a node </h2> <p> To migrate all shards from a specific node to another node, run <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/migrate/#migrate-all_shards"> <code> rladmin migrate all_shards </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin migrate node &lt;origin_node_id&gt; all_shards target_node &lt;node_id&gt; </span></span></code></pre> </div> <h2 id="migrate-primary-shards"> Migrate primary shards </h2> <p> You can use the <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/migrate/#migrate-all_master_shards"> <code> rladmin migrate all_master_shards </code> </a> command to migrate all primary shards for a specific database or node to another node in the cluster. </p> <p> To migrate a specific database's primary shards: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin migrate db db:&lt;id&gt; all_master_shards target_node &lt;node_id&gt; </span></span></code></pre> </div> <p> To migrate all primary shards from a specific node: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin migrate node &lt;origin_node_id&gt; all_master_shards target_node &lt;node_id&gt; </span></span></code></pre> </div> <h2 id="migrate-replica-shards"> Migrate replica shards </h2> <p> You can use the <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/migrate/#migrate-all_slave_shards"> <code> rladmin migrate all_slave_shards </code> </a> command to migrate all replica shards for a specific database or node to another node in the cluster. </p> <p> To migrate a specific database's replica shards: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin migrate db db:&lt;id&gt; all_slave_shards target_node &lt;node_id&gt; </span></span></code></pre> </div> <p> To migrate all replica shards from a specific node: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin migrate node &lt;origin_node_id&gt; all_slave_shards target_node &lt;node_id&gt; </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/migrate-shards/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/tools/insight/release-notes/v2.2.0/.html
<section class="prose w-full py-12"> <h1> RedisInsight v2.2.0, May 2022 </h1> <p class="text-lg -mt-5 mb-10"> RedisInsight v2.2.0 </p> <h2 id="220-may-2022"> 2.2.0 (May 2022) </h2> <p> This is the General Availability (GA) release of RedisInsight 2.2.0 </p> <h3 id="headlines"> Headlines: </h3> <ul> <li> SlowLog: New tool based on results of the <a href="https://redis.io/commands/slowlog/"> Slowlog </a> command to analyze slow operations in Redis instances </li> <li> Streams: Added support for <a href="https://redis.io/docs/manual/data-types/streams/"> Redis Streams </a> </li> <li> Open the list of keys or key details in full screen </li> <li> Automatically refresh the list of keys and key values with a timer </li> </ul> <h3 id="details"> Details </h3> <p> <strong> Features and improvements: </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/621"> #621 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/645"> #645 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/649"> #649 </a> Added SlowLog, a tool that displays the list of logs captured by the <a href="https://redis.io/commands/slowlog/"> Slowlog </a> command to analyze all commands that exceed a specified runtime, which helps in troubleshooting performance issues. Specify both the runtime and the maximum length of SlowLog (which are server configurations) to configure the list of commands logged and set the auto-refresh interval to automatically update the list of commands displayed. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/597"> #597 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/598"> #598 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/601"> #601 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/603"> #603 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/608"> #608 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/613"> #613 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/614"> #614 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/632"> #632 </a> Support for <a href="https://redis.io/docs/manual/data-types/streams/"> Redis Streams </a> , including creation and deletion of Streams, addition and deletion of entries, and filtration of entries per timestamp. <a href="https://redis.io/docs/manual/data-types/streams/#consumer-groups"> Consumer groups </a> will be added in a future release. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/643"> #643 </a> List of keys or key details are supported in full screen mode. To open the key list in full screen, close the key details. To open key details in full screen, use the new <strong> Full Screen </strong> control in key details section. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/633"> #633 </a> Automatically refresh the list of keys and key values with a timer. To do so, enable the <strong> Auto Refresh </strong> mode by clicking the control next to the <strong> Refresh </strong> button and set the refresh rate. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/634"> #634 </a> Removed the max value limitation in the <strong> Database Index </strong> field of the form for adding a new database. </li> </ul> <p> <strong> Bugs Fixed: </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/656"> #656 </a> Binary key names will not trigger errors in databases with enabled OSS Cluster API. Data type, TTL, and size of such keys are displayed in the list of keys in all Redis instances. Key details are currently not available. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/insight/release-notes/v2.2.0/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/json.set.html
<section class="prose w-full py-12"> <h1 class="command-name"> JSON.SET </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">JSON.SET key path value [NX | XX]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/json"> JSON 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(M+N) when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key </dd> </dl> <p> Set the JSON value at <code> path </code> in <code> key </code> </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key to modify. </p> </details> <details open=""> <summary> <code> path </code> </summary> <p> is JSONPath to specify. Default is root <code> $ </code> . For new Redis keys the <code> path </code> must be the root. For existing keys, when the entire <code> path </code> exists, the value that it contains is replaced with the <code> json </code> value. For existing keys, when the <code> path </code> exists, except for the last element, a new child is added with the <code> json </code> value. </p> <p> Adds a key (with its respective value) to a JSON Object (in a RedisJSON data type key) only if it is the last child in the <code> path </code> , or it is the parent of a new child being added in the <code> path </code> . Optional arguments <code> NX </code> and <code> XX </code> modify this behavior for both new RedisJSON data type keys as well as the JSON Object keys in them. </p> </details> <details open=""> <summary> <code> value </code> </summary> <p> is value to set at the specified path </p> </details> <h2 id="optional-arguments"> Optional arguments </h2> <details open=""> <summary> <code> NX </code> </summary> <p> sets the key only if it does not already exist. </p> </details> <details open=""> <summary> <code> XX </code> </summary> <p> sets the key only if it already exists. </p> </details> <h2 id="return-value"> Return value </h2> <p> JSET.SET returns a simple string reply: <code> OK </code> if executed correctly or <code> nil </code> if the specified <code> NX </code> or <code> XX </code> conditions were not met. For more information about replies, see <a href="/docs/latest/develop/reference/protocol-spec/"> Redis serialization protocol specification </a> . </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Replace an existing value </b> </summary> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.SET doc $ <span class="s1">'{"a":2}'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.SET doc $.a <span class="s1">'3'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.GET doc $ </span></span><span class="line"><span class="cl"><span class="s2">"[{\"a\":3}]"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Add a new value </b> </summary> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.SET doc $ <span class="s1">'{"a":2}'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.SET doc $.b <span class="s1">'8'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.GET doc $ </span></span><span class="line"><span class="cl"><span class="s2">"[{\"a\":2,\"b\":8}]"</span></span></span></code></pre> </div> </details> <details open=""> <summary> <b> Update multi-paths </b> </summary> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.SET doc $ <span class="s1">'{"f1": {"a":1}, "f2":{"a":2}}'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.SET doc $..a <span class="m">3</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.GET doc </span></span><span class="line"><span class="cl"><span class="s2">"{\"f1\":{\"a\":3},\"f2\":{\"a\":3}}"</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/json.get/"> <code> JSON.GET </code> </a> | <a href="/docs/latest/commands/json.mget/"> <code> JSON.MGET </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <ul> <li> <a href="/docs/latest/develop/data-types/json/"> RedisJSON </a> </li> <li> <a href="/docs/latest/develop/interact/search-and-query/indexing/"> Index and search JSON documents </a> </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/json.set/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/shard/backup/.html
<section class="prose w-full py-12 max-w-none"> <h1> Backup object </h1> <p class="text-lg -mt-5 mb-10"> Documents the backup object used with Redis Enterprise Software REST API calls. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> progress </td> <td> number, (range: 0-100) </td> <td> Shard backup progress (percentage) </td> </tr> <tr> <td> status </td> <td> 'exporting' <br/> 'succeeded' <br/> 'failed' </td> <td> Status of scheduled periodic backup process </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/shard/backup/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/blmpop/.html
<section class="prose w-full py-12"> <h1 class="command-name"> BLMPOP </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">BLMPOP timeout numkeys key [key ...] &lt;LEFT | RIGHT&gt; [COUNT count]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 7.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N+M) where N is the number of provided keys and M is the number of elements returned. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @list </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @blocking </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> <code> BLMPOP </code> is the blocking variant of <a href="/docs/latest/commands/lmpop/"> <code> LMPOP </code> </a> . </p> <p> When any of the lists contains elements, this command behaves exactly like <a href="/docs/latest/commands/lmpop/"> <code> LMPOP </code> </a> . When used inside a <a href="/docs/latest/commands/multi/"> <code> MULTI </code> </a> / <a href="/docs/latest/commands/exec/"> <code> EXEC </code> </a> block, this command behaves exactly like <a href="/docs/latest/commands/lmpop/"> <code> LMPOP </code> </a> . When all lists are empty, Redis will block the connection until another client pushes to it or until the <code> timeout </code> (a double value specifying the maximum number of seconds to block) elapses. A <code> timeout </code> of zero can be used to block indefinitely. </p> <p> See <a href="/docs/latest/commands/lmpop/"> <code> LMPOP </code> </a> for more information. </p> <h2 id="resp2-reply"> RESP2 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Nil reply </a> : when no element could be popped and the <em> timeout </em> is reached. </li> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a two-element array with the first element being the name of the key from which elements were popped, and the second element being an array of the popped elements. </li> </ul> <h2 id="resp3-reply"> RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#nulls"> Null reply </a> : when no element could be popped and the <em> timeout </em> is reached. </li> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a two-element array with the first element being the name of the key from which elements were popped, and the second element being an array of the popped elements. </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/blmpop/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/hpersist/.html
<section class="prose w-full py-12"> <h1 class="command-name"> HPERSIST </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">HPERSIST key FIELDS numfields field [field ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 7.4.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of arguments to the command </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @hash </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Remove the existing expiration on a hash key's field(s), turning the field(s) from <em> volatile </em> (a field with expiration set) to <em> persistent </em> (a field that will never expire as no TTL (time to live) is associated). </p> <h2 id="examples"> Examples </h2> <pre tabindex="0"><code>redis&gt; HSET mykey field1 "hello" field2 "world" (integer 2) redis&gt; HEXPIRE mykey 300 FIELDS 2 field1 field2 1) (integer) 1 2) (integer) 1 redis&gt; HTTL mykey FIELDS 2 field1 field2 1) (integer) 283 2) (integer) 283 redis&gt; HPERSIST mykey FIELDS 1 field2 1) (integer) 1 redis&gt; HTTL mykey FIELDS 2 field1 field2 1) (integer) 268 2) (integer) -1 </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <ul> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> . For each field: <ul> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> -2 </code> if no such field exists in the provided hash key, or the provided key does not exist. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> -1 </code> if the field exists but has no associated expiration set. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 1 </code> the expiration was removed. </li> </ul> </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/hpersist/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/node_identity/.html
<section class="prose w-full py-12 max-w-none"> <h1> Node identity object </h1> <p class="text-lg -mt-5 mb-10"> Documents the node_identity object used with Redis Enterprise Software REST API calls. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> bigstore_driver </td> <td> 'rocksdb' </td> <td> Bigstore driver name or none (deprecated) </td> </tr> <tr> <td> bigstore_enabled </td> <td> boolean </td> <td> Bigstore enabled or disabled </td> </tr> <tr> <td> identity </td> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/identity/"> identity </a> object </td> <td> Node identity </td> </tr> <tr> <td> limits </td> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/limits/"> limits </a> object </td> <td> Node limits </td> </tr> <tr> <td> paths </td> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/paths/"> paths </a> object </td> <td> Storage paths object </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/node_identity/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/hexpireat/.html
<section class="prose w-full py-12"> <h1 class="command-name"> HEXPIREAT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">HEXPIREAT key unix-time-seconds [NX | XX | GT | LT] FIELDS numfields field [field ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 7.4.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of arguments to the command </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @hash </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> <code> HEXPIREAT </code> has the same effect and semantics as <a href="/docs/latest/commands/hexpire/"> <code> HEXPIRE </code> </a> , but instead of specifying the number of seconds for the TTL (time to live), it takes an absolute <a href="http://en.wikipedia.org/wiki/Unix_time"> Unix timestamp </a> in seconds since Unix epoch. A timestamp in the past will delete the field immediately. </p> <p> For the specific semantics of the command, see <a href="/docs/latest/commands/hexpire/"> <code> HEXPIRE </code> </a> . </p> <h2 id="options"> Options </h2> <p> The <code> HEXPIREAT </code> command supports a set of options: </p> <ul> <li> <code> NX </code> -- For each specified field, set expiration only when the field has no expiration. </li> <li> <code> XX </code> -- For each specified field, set expiration only when the field has an existing expiration. </li> <li> <code> GT </code> -- For each specified field, set expiration only when the new expiration is greater than current one. </li> <li> <code> LT </code> -- For each specified field, set expiration only when the new expiration is less than current one. </li> </ul> <p> A non-volatile key is treated as an infinite TTL for the purposes of <code> GT </code> and <code> LT </code> . The <code> NS </code> , <code> XX </code> , <code> GT </code> , and <code> LT </code> options are mutually exclusive. </p> <h2 id="example"> Example </h2> <pre tabindex="0"><code>redis&gt; HSET mykey field1 "hello" field2 "world" (integer 2) redis&gt; HEXPIREAT mykey 1715704971 FIELDS 2 field1 field2 1) (integer) 1 2) (integer) 1 redis&gt; HTTL mykey FIELDS 2 field1 field2 1) (integer) 567 2) (integer) 567 </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> . For each field: <ul> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> -2 </code> if no such field exists in the provided hash key, or the provided key does not exist. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 0 </code> if the specified NX, XX, GT, or LT condition has not been met. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 1 </code> if the expiration time was set/updated. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 2 </code> when <code> HEXPIRE </code> or <code> HPEXPIRE </code> is called with 0 seconds or milliseconds, or when <code> HEXPIREAT </code> or <code> HPEXPIREAT </code> is called with a past Unix time in seconds or milliseconds. </li> </ul> </li> <li> <a href="../../develop/reference/protocol-spec#simple-errors"> Simple error reply </a> : <ul> <li> if parsing failed, mandatory arguments are missing, unknown arguments are specified, or argument values are of the wrong type or out of range. </li> <li> if the provided key exists but is not a hash. </li> </ul> </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/hexpireat/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/configuring-aws-instances/.html
<section class="prose w-full py-12 max-w-none"> <h1> Configure AWS EC2 instances for Redis Enterprise Software </h1> <p class="text-lg -mt-5 mb-10"> Considerations for installing and running Redis Enterprise Software on Amazon Elastic Cloud Compute (EC2) instances. </p> <p> There are some special considerations for installing and running Redis Enterprise Software on Amazon Elastic Cloud Compute (EC2) instances. </p> <p> These include: </p> <ul> <li> <a href="#storage"> Storage considerations </a> </li> <li> <a href="#instance-types"> Instance types </a> </li> <li> <a href="#security"> Security group configuration </a> </li> </ul> <h2 id="storage"> Storage considerations </h2> <p> AWS EC2 instances are ephemeral, but your persistent database storage should not be. If you require a persistent storage location for your database, the storage must be located outside of the instance. When you set up an instance, make sure it has a properly sized EBS-backed volume connected. When you set up Redis Enterprise Software on the instance, make sure that <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/persistent-ephemeral-storage/"> the persistence storage </a> is configured to use this volume. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <p> After <a href="/docs/latest/operate/rs/installing-upgrading/"> installing the Redis Enterprise Software package </a> on the instance and <strong> before </strong> running through <a href="/docs/latest/operate/rs/clusters/new-cluster-setup/"> the setup process </a> , you must give the group <code> redislabs </code> permission to the EBS volume by running the following command from the OS command-line interface (CLI): </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">chown redislabs:redislabs /&lt; ebs folder name&gt; </span></span></code></pre> </div> </div> </div> <p> Another feature that may be of importance to you is the use of Provisioned IOPS for EBS-backed volumes. Provisioned IOPS guarantee a certain level of disk performance. There are two features in Redis Enterprise Software where this feature could be critical to use: </p> <ol> <li> When using <a href="/docs/latest/operate/rs/databases/auto-tiering/"> Auto Tiering </a> </li> <li> When using AOF on every write and there is a high write load. In this case, the provisioned IOPS should be on the nodes used as replicas in the cluster. </li> </ol> <h2 id="instance-types"> Instance types </h2> <p> Choose an instance type that has (at minimum) enough free memory and disk space to meet the Redis Enterprise Software <a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements/"> hardware requirements </a> . </p> <p> In addition, some instance types are optimized for EBS-backed volumes and some are not. If you are using persistent storage, you should use an instance type that is, especially if disk drain rate matters to your database implementation. </p> <h2 id="security"> Security group configuration </h2> <p> When configuring the security group: </p> <ul> <li> Define a custom TCP rule for port 8443 to allow web browser access to the Redis Enterprise Software Cluster Manager UI from the IP address range you use to access the Cluster Manager UI. </li> <li> If you are using the DNS resolving option with Redis Enterprise Software, define a DNS UDP rule for port 53 to allow access to the databases' endpoints by using the <a href="/docs/latest/operate/rs/networking/cluster-dns/"> DNS resolving mechanism </a> . </li> <li> To create a cluster that has multiple nodes all running as instances on AWS, you need to define a security group that has an All TCP rule for all ports, 0 - 65535, and add it to all instances that are part of the cluster. This ensures that all nodes are able to communicate with each other. To limit the number of open ports, you can open only the <a href="/docs/latest/operate/rs/networking/port-configurations/"> ports used by Redis Enterprise Software </a> . </li> </ul> <p> After successfully launching the instances: </p> <ol> <li> Install Redis Enterprise Software from the <a href="/docs/latest/operate/rs/installing-upgrading/"> Linux package or AWS AMI </a> . </li> <li> <a href="/docs/latest/operate/rs/clusters/new-cluster-setup/"> Set up the cluster </a> . </li> </ol> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/configuring-aws-instances/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/pubsub-channels/.html
<section class="prose w-full py-12"> <h1 class="command-name"> PUBSUB CHANNELS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">PUBSUB CHANNELS [pattern]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.8.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @pubsub </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Lists the currently <em> active channels </em> . </p> <p> An active channel is a Pub/Sub channel with one or more subscribers (excluding clients subscribed to patterns). </p> <p> If no <code> pattern </code> is specified, all the channels are listed, otherwise if pattern is specified only channels matching the specified glob-style pattern are listed. </p> <p> Cluster note: in a Redis Cluster clients can subscribe to every node, and can also publish to every other node. The cluster will make sure that published messages are forwarded as needed. That said, <a href="/docs/latest/commands/pubsub/"> <code> PUBSUB </code> </a> 's replies in a cluster only report information from the node's Pub/Sub context, rather than the entire cluster. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a list of active channels, optionally matching the specified pattern. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/pubsub-channels/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/cloud-integrations/aws-cloud-accounts/iam-resources/.html
<section class="prose w-full py-12 max-w-none"> <h1> Create IAM resources for AWS cloud accounts </h1> <div class="banner-article rounded-md"> <p> Self-managed AWS accounts are deprecated, so this article has been archived. </p> </div> <p> For most Redis Cloud Pro databases deployed to Amazon Web Services (AWS), we manage the supporting infrastructure for you in dedicated AWS accounts. </p> <p> You can manage this infrastructure with your own AWS accounts. </p> <p> You'll want these accounts to be separate from any AWS application accounts and you'll need to create dedicated <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html"> identity and access management </a> (IAM) resources to allow us to manage the infrastructure. </p> <p> In the new AWS account, you need to create: </p> <ul> <li> An <strong> instance role </strong> </li> <li> A user with an <strong> access key </strong> </li> <li> A role that grants <strong> AWS console access </strong> </li> </ul> <p> Save the access key in a secure location so that you can enter it when you <a href="/docs/latest/operate/rc/cloud-integrations/aws-cloud-accounts/"> register the cloud account </a> with your the Redis Cloud subscription. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> <p> We use the provided credentials to configure your AWS environment and provision required resources. </p> <p> To make sure that we can manage your AWS resources, you must not: </p> <ul> <li> Manually change the configurations of provisioned resources, such as security groups </li> <li> Manually stop or terminate provisioned instances </li> </ul> </div> </div> <p> For help creating an AWS user, see the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html"> AWS IAM documentation </a> . </p> <p> You can use one of the following tools to create IAM resources: </p> <ul> <li> <a href="/docs/latest/operate/rc/cloud-integrations/aws-cloud-accounts/iam-resources/cloudformation/"> CloudFormation </a> - The AWS automation tool </li> <li> <a href="/docs/latest/operate/rc/cloud-integrations/aws-cloud-accounts/iam-resources/terraform/"> Terraform </a> - Widely supported in the Redis community for additional automation </li> <li> The <a href="/docs/latest/operate/rc/cloud-integrations/aws-cloud-accounts/iam-resources/aws-console/"> AWS Console </a> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/cloud-integrations/aws-cloud-accounts/iam-resources/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/crdb/create/.html
<section class="prose w-full py-12 max-w-none"> <h1> crdb-cli crdb create </h1> <p class="text-lg -mt-5 mb-10"> Creates an Active-Active database. </p> <p> Creates an Active-Active database. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb create --name &lt;name&gt; </span></span><span class="line"><span class="cl"> --memory-size &lt;maximum_memory&gt; </span></span><span class="line"><span class="cl"> --instance <span class="nv">fqdn</span><span class="o">=</span>&lt;cluster_fqdn&gt;,username<span class="o">=</span>&lt;username&gt;,password<span class="o">=</span>&lt;password&gt;<span class="o">[</span>,url<span class="o">=</span>&lt;url&gt;,replication_endpoint<span class="o">=</span>&lt;endpoint&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> --instance <span class="nv">fqdn</span><span class="o">=</span>&lt;cluster_fqdn&gt;,username<span class="o">=</span>&lt;username&gt;,password<span class="o">=</span>&lt;password&gt;<span class="o">[</span>,url<span class="o">=</span>&lt;url&gt;,replication_endpoint<span class="o">=</span>&lt;endpoint&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--port &lt;port_number&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--no-wait<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--default-db-config &lt;configuration&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--default-db-config-file &lt;filename&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--compression &lt;0-6&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--causal-consistency <span class="o">{</span> <span class="nb">true</span> <span class="p">|</span> <span class="nb">false</span> <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--password &lt;password&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--replication <span class="o">{</span> <span class="nb">true</span> <span class="p">|</span> <span class="nb">false</span> <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--encryption <span class="o">{</span> <span class="nb">true</span> <span class="p">|</span> <span class="nb">false</span> <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--sharding <span class="o">{</span> <span class="nb">false</span> <span class="p">|</span> <span class="nb">true</span> <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--shards-count &lt;number_of_shards&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--shard-key-regex &lt;regex_rule&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--oss-cluster <span class="o">{</span> <span class="nb">true</span> <span class="p">|</span> <span class="nb">false</span> <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--bigstore <span class="o">{</span> <span class="nb">true</span> <span class="p">|</span> <span class="nb">false</span> <span class="o">}]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--bigstore-ram-size &lt;maximum_memory&gt;<span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>--with-module <span class="nv">name</span><span class="o">=</span>&lt;module_name&gt;,version<span class="o">=</span>&lt;module_version&gt;,args<span class="o">=</span>&lt;module_args&gt;<span class="o">]</span> </span></span></code></pre> </div> <h3 id="prerequisites"> Prerequisites </h3> <p> Before you create an Active-Active database, you must have: </p> <ul> <li> At least two participating clusters </li> <li> <a href="/docs/latest/operate/rs/7.4/networking/port-configurations/"> Network connectivity </a> between the participating clusters </li> </ul> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter &amp; options(s) </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> name &lt;CRDB_name&gt; </td> <td> string </td> <td> Name of the Active-Active database (required) </td> </tr> <tr> <td> memory-size &lt;maximum_memory&gt; </td> <td> size in bytes, kilobytes (KB), or gigabytes (GB) </td> <td> Maximum database memory (required) </td> </tr> <tr> <td> instance <br/> fqdn=&lt;cluster_fqdn&gt;, <br/> username=&lt;username&gt;, <br/> password=&lt;password&gt; </td> <td> strings </td> <td> The connection information for the participating clusters (required for each participating cluster) </td> </tr> <tr> <td> port &lt;port_number&gt; </td> <td> integer </td> <td> TCP port for the Active-Active database on all participating clusters </td> </tr> <tr> <td> default-db-config &lt;configuration&gt; </td> <td> string </td> <td> Default database configuration options </td> </tr> <tr> <td> default-db-config-file &lt;filename&gt; </td> <td> filepath </td> <td> Default database configuration options from a file </td> </tr> <tr> <td> no-wait </td> <td> </td> <td> Prevents <code> crdb-cli </code> from running another command before this command finishes </td> </tr> <tr> <td> compression </td> <td> 0-6 </td> <td> The level of data compression: <br/> <br/> 0 = No compression <br/> <br/> 6 = High compression and resource load (Default: 3) </td> </tr> <tr> <td> causal-consistency </td> <td> true <br/> false ( <em> default </em> ) </td> <td> <a href="/docs/latest/operate/rs/7.4/databases/active-active/causal-consistency/"> Causal consistency </a> applies updates to all instances in the order they were received </td> </tr> <tr> <td> password &lt;password&gt; </td> <td> string </td> <td> Password for access to the database </td> </tr> <tr> <td> replication </td> <td> true <br/> false ( <em> default </em> ) </td> <td> Activates or deactivates <a href="/docs/latest/operate/rs/7.4/databases/durability-ha/replication/"> database replication </a> where every master shard replicates to a replica shard </td> </tr> <tr> <td> encryption </td> <td> true <br/> false ( <em> default </em> ) </td> <td> Activates or deactivates encryption </td> </tr> <tr> <td> sharding </td> <td> true <br/> false ( <em> default </em> ) </td> <td> Activates or deactivates sharding (also known as <a href="/docs/latest/operate/rs/7.4/databases/durability-ha/replication/"> database clustering </a> ). Cannot be updated after the database is created </td> </tr> <tr> <td> shards-count &lt;number_of_shards&gt; </td> <td> integer </td> <td> If sharding is enabled, this specifies the number of Redis shards for each database instance </td> </tr> <tr> <td> oss-cluster </td> <td> true <br/> false ( <em> default </em> ) </td> <td> Activates <a href="/docs/latest/operate/rs/7.4/clusters/optimize/oss-cluster-api/"> OSS cluster API </a> </td> </tr> <tr> <td> shard-key-regex &lt;regex_rule&gt; </td> <td> string </td> <td> If clustering is enabled, this defines a regex rule (also known as a <a href="/docs/latest/operate/rs/7.4/databases/durability-ha/clustering/#custom-hashing-policy"> hashing policy </a> ) that determines which keys are located in each shard (defaults to <code> {u'regex': u'.*\\{(?&lt;tag&gt;.*)\\}.*'}, {u'regex': u'(?&lt;tag&gt;.*)'} </code> ) </td> </tr> <tr> <td> bigstore </td> <td> true <br/> <br/> false ( <em> default </em> ) </td> <td> If true, the database uses Auto Tiering to add flash memory to the database </td> </tr> <tr> <td> bigstore-ram-size &lt;size&gt; </td> <td> size in bytes, kilobytes (KB), or gigabytes (GB) </td> <td> Maximum RAM limit for databases with Auto Tiering enabled </td> </tr> <tr> <td> with-module <br/> name=&lt;module_name&gt;, <br/> version=&lt;module_version&gt;, <br/> args=&lt;module_args&gt; </td> <td> strings </td> <td> Creates a database with a specific module </td> </tr> <tr> <td> eviction-policy </td> <td> noeviction ( <em> default </em> ) <br/> allkeys-lru <br/> allkeys-lfu <br/> allkeys-random <br/> volatile-lru <br/> volatile-lfu <br/> volatile-random <br/> volatile-ttl </td> <td> Sets <a href="/docs/latest/operate/rs/7.4/databases/memory-performance/eviction-policy/"> eviction policy </a> </td> </tr> <tr> <td> proxy-policy </td> <td> all-nodes <br/> all-master-shards <br/> single </td> <td> Sets proxy policy </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns the task ID of the task that is creating the database. </p> <p> If <code> --no-wait </code> is specified, the command exits. Otherwise, it will wait for the database to be created and then return the CRDB GUID. </p> <h3 id="examples"> Examples </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ crdb-cli crdb create --name database1 --memory-size 1GB --port <span class="m">12000</span> <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> --instance <span class="nv">fqdn</span><span class="o">=</span>cluster1.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> --instance <span class="nv">fqdn</span><span class="o">=</span>cluster2.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin </span></span><span class="line"><span class="cl">Task 633aaea3-97ee-4bcb-af39-a9cb25d7d4da created </span></span><span class="line"><span class="cl"> ---&gt; Status changed: queued -&gt; started </span></span><span class="line"><span class="cl"> ---&gt; CRDB GUID Assigned: crdb:d84f6fe4-5bb7-49d2-a188-8900e09c6f66 </span></span><span class="line"><span class="cl"> ---&gt; Status changed: started -&gt; finished </span></span></code></pre> </div> <p> To create an Active-Active database with two shards in each instance and with encrypted traffic between the clusters: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb create --name mycrdb --memory-size 100mb --port <span class="m">12000</span> --instance <span class="nv">fqdn</span><span class="o">=</span>cluster1.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --instance <span class="nv">fqdn</span><span class="o">=</span>cluster2.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --shards-count <span class="m">2</span> --encryption <span class="nb">true</span> </span></span></code></pre> </div> <p> To create an Active-Active database with two shards and with RediSearch 2.0.6 module: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb create --name mycrdb --memory-size 100mb --port <span class="m">12000</span> --instance <span class="nv">fqdn</span><span class="o">=</span>cluster1.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --instance <span class="nv">fqdn</span><span class="o">=</span>cluster2.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --shards-count <span class="m">2</span> --with-module <span class="nv">name</span><span class="o">=</span>search,version<span class="o">=</span><span class="s2">"2.0.6"</span>,args<span class="o">=</span><span class="s2">"PARTITIONS AUTO"</span> </span></span></code></pre> </div> <p> To create an Active-Active database with two shards and with encrypted traffic between the clusters: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb create --name mycrdb --memory-size 100mb --port <span class="m">12000</span> --instance <span class="nv">fqdn</span><span class="o">=</span>cluster1.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --instance <span class="nv">fqdn</span><span class="o">=</span>cluster2.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --encryption <span class="nb">true</span> --shards-count <span class="m">2</span> </span></span></code></pre> </div> <p> To create an Active-Active database with 1 shard in each instance and not wait for the response: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb create --name mycrdb --memory-size 100mb --port <span class="m">12000</span> --instance <span class="nv">fqdn</span><span class="o">=</span>cluster1.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --instance <span class="nv">fqdn</span><span class="o">=</span>cluster2.redis.local,username<span class="o">=</span>[email protected],password<span class="o">=</span>admin --no-wait </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/crdb/create/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-6-0-april-2020/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software Release Notes 5.6.0 (April 2020) </h1> <p class="text-lg -mt-5 mb-10"> Install improvements for RHEL 6 and 7. Active-Active support for HyperLogLog. Auto Tiering now supports RedisJSON. Active-Active default changes for high availability and OSS Cluster API support. Backup support for Google Cloud Storage and Azure Blob storage. </p> <p> <a href="https://redislabs.com/download-center/"> Redis Enterprise Software (RS) 5.6.0 </a> is now available. This major version release includes: </p> <ul> <li> Improved installation process to be customizable </li> <li> Support for the HyperLogLog data type in Active-Active databases </li> <li> RedisJSON support in databases with Auto Tiering enabled </li> <li> Support for Redis OSS Cluster API for Active-Active and Replica Of databases </li> <li> Replica HA enabled by default for Active-Active databases </li> <li> Cloud backup locations support </li> <li> Support for Red Hat Enterprise Linux version 7.7, 7.8 </li> <li> Additional enhancements, and minor bug fixes </li> </ul> <h2 id="information"> Information </h2> <h3 id="upgrade"> Upgrade </h3> <ul> <li> Follow <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/"> these instructions </a> for upgrading to RS 5.6.0 from RS 5.0.2 and above. </li> <li> For Active-Active databases, you must upgrade the <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/#upgrade-activeactive-databases"> feature set version </a> . </li> </ul> <h3 id="end-of-life"> End of life </h3> <ul> <li> End of Life (EOL) for Redis Enterprise Software 5.6 and previous RS versions can be found <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/"> here </a> . EOL for Redis Modules can be found <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/modules-lifecycle/#modules-endoflife-schedule"> here </a> . </li> <li> Support of Red Hat Enterprise Linux 6 and Oracle Linux 6 <a href="/docs/latest/operate/rs/references/supported-platforms/"> operating systems platforms </a> will end on November 30, 2020. </li> <li> Support of OpenStack Object Storage ("Swift") for <a href="https://docs.redis.com/latest/rs/databases/import-export/import-data/"> backup, import and export location </a> will end on November 30, 2020. </li> </ul> <h2 id="new-features"> New features </h2> <h3 id="redis-software-installer"> Redis Software installer </h3> <p> Redis Enterprise Software installer adds the ability to specify custom installation paths and a custom installation user, group, or both on RHEL versions 6 and 7. </p> <p> When you run the installer you can specify the installation, the configuration and the var as well as the user and the group: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo ./install.sh --install-dir &lt;path&gt; --config-dir &lt;path&gt; --var-dir &lt;path&gt; --os-user &lt;user&gt; --os-group &lt;group&gt; </span></span></code></pre> </div> <p> For more information, check out the <a href="https://docs.redis.com/latest/rs/installing-upgrading/"> Redis Enterprise Software installer documentation </a> . </p> <h3 id="hyperloglog-on-active-active"> Hyperloglog on Active-Active </h3> <p> RS 5.6.0 adds the support of <a href="http://www.antirez.com/news/75"> HyperLogLog </a> data structure for <a href="/docs/latest/operate/rs/databases/import-export/replica-of/"> Active-Active Redis </a> databases. </p> <p> Because HyperLogLog is a counting data structure by nature, conflicts can occur when deleting entries. For efficiency, performance and memory considerations, conflicts between instances are resolved with DEL (delete) operations winning over ADD operations that took place in concurrent or before the DEL operation. </p> <p> For more information, check out the <a href="/docs/latest/operate/rs/databases/active-active/develop/hyperloglog-active-active.md"> HyperLogLog on Active-Active documentation </a> . </p> <h3 id="redisjson-on-auto-tiering"> RedisJSON on Auto Tiering </h3> <p> RS 5.6.0 adds support for <a href="/docs/latest/operate/rs/databases/auto-tiering/"> Auto Tiering </a> databases with <a href="https://docs.redis.com/latest/modules"> Redis Modules </a> . <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/json/"> RedisJSON </a> is the first module to be available to run on a database with Auto Tiering enabled. </p> <p> Using RedisJSON on Auto Tiering allows you to benefit from high performance redis with high data volume at lower costs. </p> <h3 id="oss-cluster-api-support"> OSS Cluster API support </h3> <p> For more information, check out the <a href="/docs/latest/operate/rs/databases/configure/oss-cluster-api/"> OSS Cluster API documentation </a> . </p> <p> <strong> Support for Active-Active and Replica Of databases </strong> </p> <p> You can configure <a href="/docs/latest/operate/rs/databases/import-export/replica-of/"> Active-Active </a> databases to use the <a href="https://docs.redis.com/latest/rs/clusters/optimize/oss-cluster-api/"> OSS Cluster API </a> using the admin console. The OSS Cluster API improves the performance of user operations against your database. </p> <p> You can also create or modify an Active-Active Redis database in OSS Cluster mode using the <code> crdb-cli </code> tool with the <code> --oss-cluster </code> option to apply the changes to all of the instances. </p> <p> <strong> Create and edit database using the admin console </strong> </p> <p> You can configure OSS Cluster API for databases using the admin console. </p> <p> For Active-Active databases, you can create the database with OSS Cluster API enabled for all of its instances. When you enable OSS Cluster after the Active-Active database is created, the change applies only to the local instance. </p> <h3 id="replica-ha-defaults-for-active-active"> Replica HA defaults for Active-Active </h3> <p> To enhance the availability and the consistency of <a href="/docs/latest/operate/rs/databases/active-active/"> Active-Active geo-distributed Redis </a> , <a href="/docs/latest/operate/rs/databases/configure/replica-ha/"> Replica HA </a> is enabled by default for all existing and new Active-Active Redis Databases. </p> <p> To disable Replica HA for for a local instance of an Active-Active database, run this command on the instance: <code> rladmin tune db &lt;bdb_uid&gt; slave_ha disabled </code> </p> <h3 id="cloud-backup-locations-support"> Cloud backup locations support </h3> <p> Redis Enterprise 5.6.0 adds the ability to configure Azure Blob Storage and Google Cloud Storage as backup, import, and export locations. </p> <h3 id="red-hat-enterprise-linux-77-78"> Red Hat Enterprise Linux 7.7, 7.8 </h3> <p> Redis Enterprise 5.6.0 adds RHEL 7.7, 7.8 to its <a href="/docs/latest/operate/rs/references/supported-platforms/"> supported platforms </a> . </p> <h2 id="redis-modules"> Redis modules </h2> <p> The following GA releases of Redis Modules are bundled in RS 5.6.0: </p> <ul> <li> <a href="https://redislabs.com/redis-enterprise/redis-bloom/"> RedisBloom </a> , version <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.2-release-notes"> 2.2.1 </a> </li> <li> <a href="https://redislabs.com/redis-enterprise/redis-graph/"> RedisGraph </a> , version <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.0-release-notes"> 2.0.10 </a> </li> <li> <a href="https://redislabs.com/redis-enterprise/redis-json/"> RedisJson </a> , version <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-1.0-release-notes"> 1.0.4 </a> </li> <li> <a href="https://redislabs.com/redis-enterprise/redis-search/"> RediSearch </a> , version <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-1.6-release-notes"> 1.6.11 </a> (updated) </li> <li> <a href="https://redislabs.com/redis-enterprise/redis-time-series/"> RedisTimeSeries </a> , version <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.2-release-notes"> 1.2.3 </a> </li> </ul> <h2 id="additional-capabilities"> Additional capabilities </h2> <ul> <li> OSS Redis version <a href="https://raw.githubusercontent.com/antirez/redis/5.0/00-RELEASENOTES"> 5.0.8 </a> is merged into RS 5.6.0. </li> <li> Starting RS 5.6.0, to upgrade modules during database upgrade you must use the module_args option instead of keep_module_args or <argument> or “ ” (for no arguments). The module_args option must follow with one of the following (Always in quotation marks): “keep_args” or “ “ or “ <argument> ”. For more info and examples, check out <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/"> upgrading Redis Modules documentation </a> . </argument> </argument> </li> <li> rladmin adds the ability to demote the cluster master node when setting it to <a href="/docs/latest/operate/rs/clusters/maintenance-mode/"> maintenance mode </a> by using the <code> demote_node </code> option: </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;node_uid&gt; maintenance_mode on demote_node </span></span></code></pre> </div> <ul> <li> The <code> SENTINEL MASTER </code> command output format was updated to be aligned with OSS equivalent output. </li> </ul> <h2 id="important-fixes"> Important fixes </h2> <ul> <li> RS38315, RS33747 - Added the LUA script name (SHA) and its arguments to the warning message indicating the LUA script has been running for more than 5 seconds. </li> <li> RS38706 - Fixed a bug which caused a stuck state machine in some scenarios of restoring DB from RDB. </li> <li> RS34309 - Improved internal passwords handling. </li> <li> RS38498 - Fixed a bug in the upgrade process of a database to avoid failure when saving large RDB (Redis Database Backup) file. </li> <li> RS38706 - Fixed a bug that caused a stuck state machine after restoring a snapshot of an Active-Active database. </li> <li> RS43996 - Fixed a bug in the upgrade process when using ./install.sh -y and firewalld is not running. </li> <li> RS45777 - Fixed a bug that caused clients on a shared connection to the proxy to get disonnected. Disconnections occured in case a response for a request of an already disconnected client was received. With build 5.6.0-39: </li> <li> RS45627, RS47382 - Fixed bugs causing clients to disconnect when using XREAD and XREADGROUP commands in blocking mode on other clients’ connections. </li> <li> RS44656 - Fixed a bug causing TLS mode for clients connections to toggle between ‘all communication’ to ‘for crdb communication only’ when performing a global configuration change. </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <h3 id="active-active-databases"> Active-Active databases </h3> <ul> <li> RS51359 - Active-Active databases, using replication and Append Only File (AOF) for <a href="/docs/latest/operate/rs/databases/configure/database-persistence/"> database persistence </a> , are suffering from memory leaks on replica shards, causing them to grow bigger than the master shards. Customers are advised to upgrade to RS 6.0.12. Meanwhile, you can use a snapshot for database persistence or restart the replica shards. </li> </ul> <h3 id="upgrade-notes"> Upgrade notes </h3> <ul> <li> <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-2-april-2019/"> RS 5.4.2 </a> introduced new Active-Active Redis Database capabilities that improve its compatibility with open source Redis. Now the string data-type in Active-Active Redis Database is implicitly and dynamically typed, just like open source Redis. To use the new capabilities on nodes that are upgraded from version RS 5.4.2 or lower, you must <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/#upgrading-crdbs"> upgrade the Active-Active Redis Database protocol </a> . </li> <li> When you upgrade an Active-Active Redis with active AOF from version <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-2-april-2019/"> RS 5.4.2 </a> or lower to version <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-4-june-2019/"> RS 5.4.4 </a> or higher: <ul> <li> If replication is enabled, you must run the BGREWRITEAOF command on all replica shards after the upgrade. </li> <li> If replication is not enabled, you must run the BGREWRITEAOF command on all shards after the upgrade. </li> </ul> </li> <li> Node upgrade fails if the SSL certificates were configured in version 5.0.2 or above by manually updating the certificates on the disk instead of <a href="/docs/latest/operate/rs/security/certificates/updating-certificates/"> updating them through the API </a> . For assistance with this issue, contact Support. </li> <li> Starting from <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-2-april-2019/"> RS 5.4.2 </a> , to preserve the current Redis major.minor version during database upgrade you must use the keep_redis_version option instead of keep_current_version. </li> <li> Google Chrome browser on macOS Catalina requires a self-signed certificate generated after June 2019 to include the extendedKeyUsage field in order to connect to the RS admin console. If you use a self-signed certificate that does not include this field, <a href="/docs/latest/operate/rs/security/certificates/updating-certificates/"> update the self-signed certificate </a> . </li> </ul> <h3 id="modules-upgrade"> Modules upgrade </h3> <ul> <li> We recommend that you test module upgrade commands in a test environment before you upgrade modules in a production environment. The module upgrade arguments are not validated during the upgrade process and incorrect arguments can cause unexpected downtime. </li> <li> Before you upgrade a database with RediSearch Module to Redis 5.0, you must <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/"> upgrade the RediSearch Module </a> to version 1.4.2 or above. </li> </ul> <h3 id="cluster-api"> Cluster API </h3> <ul> <li> <p> The API for removing a node is updated in <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-2-april-2019/"> RS 5.4.2 </a> or higher. The API call must include json data and the "Content-Type: application/json" header. For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">curl -X POST -H <span class="s2">"Content-Type: application/json"</span> -i -k -u [email protected]:password https://localhost:9443/v1/nodes/3/actions/remove --data <span class="s2">"{}"</span> </span></span></code></pre> </div> </li> </ul> <h3 id="discover-service"> Discover service </h3> <ul> <li> For <a href="/docs/latest/operate/rs/databases/durability-ha/discovery-service/"> Redis Sentinel (Discovery Service) </a> , every database name must be unique across the cluster. </li> </ul> <h3 id="redis-commands"> Redis commands </h3> <ul> <li> The capability of disabling specific Redis commands does not work on commands specific to Redis Modules. </li> <li> The CLIENT ID command cannot guarantee incremental IDs between clients that connect to different nodes under multi proxy policies. </li> <li> CLIENT UNBLOCK command is not supported in RS 5.4 and above </li> <li> Starting from RS 5.4.2 and after upgrading the CRDB, TYPE commands for string data-type in CRDBs return "string" (OSS Redis standard). </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-6-0-april-2020/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/object-encoding/.html
<section class="prose w-full py-12"> <h1 class="command-name"> OBJECT ENCODING </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">OBJECT ENCODING key</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.2.3 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @keyspace </code> <span class="mr-1 last:hidden"> , </span> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns the internal encoding for the Redis object stored at <code> &lt;key&gt; </code> </p> <p> Redis objects can be encoded in different ways: </p> <ul> <li> <p> Strings can be encoded as: </p> <ul> <li> <code> raw </code> , normal string encoding. </li> <li> <code> int </code> , strings representing integers in a 64-bit signed interval, encoded in this way to save space. </li> <li> <code> embstr </code> , an embedded string, which is an object where the internal simple dynamic string, <code> sds </code> , is an unmodifiable string allocated in the same chuck as the object itself. <code> embstr </code> can be strings with lengths up to the hardcoded limit of <code> OBJ_ENCODING_EMBSTR_SIZE_LIMIT </code> or 44 bytes. </li> </ul> </li> <li> <p> Lists can be encoded as: </p> <ul> <li> <code> linkedlist </code> , simple list encoding. No longer used, an old list encoding. </li> <li> <code> ziplist </code> , Redis &lt;= 6.2, a space-efficient encoding used for small lists. </li> <li> <code> listpack </code> , Redis &gt;= 7.0, a space-efficient encoding used for small lists. </li> <li> <code> quicklist </code> , encoded as linkedlist of ziplists or listpacks. </li> </ul> </li> <li> <p> Sets can be encoded as: </p> <ul> <li> <code> hashtable </code> , normal set encoding. </li> <li> <code> intset </code> , a special encoding used for small sets composed solely of integers. </li> <li> <code> listpack </code> , Redis &gt;= 7.2, a space-efficient encoding used for small sets. </li> </ul> </li> <li> <p> Hashes can be encoded as: </p> <ul> <li> <code> zipmap </code> , no longer used, an old hash encoding. </li> <li> <code> hashtable </code> , normal hash encoding. </li> <li> <code> ziplist </code> , Redis &lt;= 6.2, a space-efficient encoding used for small hashes. </li> <li> <code> listpack </code> , Redis &gt;= 7.0, a space-efficient encoding used for small hashes. </li> </ul> </li> <li> <p> Sorted Sets can be encoded as: </p> <ul> <li> <code> skiplist </code> , normal sorted set encoding. </li> <li> <code> ziplist </code> , Redis &lt;= 6.2, a space-efficient encoding used for small sorted sets. </li> <li> <code> listpack </code> , Redis &gt;= 7.0, a space-efficient encoding used for small sorted sets. </li> </ul> </li> <li> <p> Streams can be encoded as: </p> <ul> <li> <code> stream </code> , encoded as a radix tree of listpacks. </li> </ul> </li> </ul> <p> All the specially encoded types are automatically converted to the general type once you perform an operation that makes it impossible for Redis to retain the space saving encoding. </p> <h2 id="resp2-reply"> RESP2 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Nil reply </a> : if the key doesn't exist. </li> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : the encoding of the object. </li> </ul> <h2 id="resp3-reply"> RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#nulls"> Null reply </a> : if the key doesn't exist. </li> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : the encoding of the object. </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/object-encoding/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.0-release-notes/redisearch.io.html
<section class="prose w-full py-12 max-w-none"> <h1> Graph </h1> <p class="text-lg -mt-5 mb-10"> RedisGraph is a queryable graph database built on Redis. </p> <div class="banner-article rounded-md"> <p> Redis, Inc. has announced the end of life of RedisGraph. We will carry out the process gradually and in accordance with our commitment to our customers. See <a href="https://redis.io/blog/redisgraph-eol/"> details </a> . </p> </div> <p> RedisGraph is the first queryable <a href="https://github.com/opencypher/openCypher/blob/master/docs/property-graph-model.adoc"> Property Graph </a> database to use <a href="https://en.wikipedia.org/wiki/Sparse_matrix"> sparse matrices </a> to represent the <a href="https://en.wikipedia.org/wiki/Adjacency_matrix"> adjacency matrix </a> in graphs and <a href="http://faculty.cse.tamu.edu/davis/GraphBLAS.html"> linear algebra </a> to query the graph. </p> <h2 id="primary-features"> Primary features </h2> <ul> <li> Based on the <a href="https://github.com/opencypher/openCypher/blob/master/docs/property-graph-model.adoc"> Property Graph Model </a> <ul> <li> Nodes (vertices) and Relationships (edges) that may have attributes </li> <li> Nodes that can be labeled </li> <li> Relationships have a relationship type </li> </ul> </li> <li> Graphs represented as sparse adjacency matrices </li> <li> <a href="http://www.opencypher.org/"> Cypher </a> as query language <ul> <li> Cypher queries translated into linear algebra expressions </li> </ul> </li> </ul> <h2 id="commands"> Commands </h2> <p> See <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/commands/"> Graph commands </a> for a list of graph commands that are supported in Redis Enterprise. </p> <h2 id="clients"> Clients </h2> <p> For a list of available RedisGraph clients, see <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/clients.md"> RedisGraph client libraries </a> . </p> <h2 id="configuration"> Configuration </h2> <p> See <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/configuration.md"> Configuration parameters </a> for the complete list of RedisGraph configuration parameters. </p> <p> To learn which configuration parameters are supported in Redis Enterprise, see <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/config/"> Graph configuration compatibility with Redis Enterprise </a> . </p> <h2 id="design"> Design </h2> <p> For an overview of RedisGraph's design, see <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/design/_index.md"> RedisGraph: A High Performance In-Memory Graph Database </a> . </p> <h3 id="client-specification"> Client specification </h3> <p> RedisGraph client libraries should follow the <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/design/client_spec.md"> Technical specification for writing RedisGraph client libraries </a> . </p> <h3 id="result-set-structure"> Result set structure </h3> <p> <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/design/result_structure.md"> RedisGraph result set structure </a> describes the format RedisGraph uses to print data when using <code> redis-cli </code> . </p> <h3 id="graphbulk-endpoint"> GRAPH.BULK endpoint </h3> <p> You can import new graphs from CSV files using <code> redisgraph-bulk-loader </code> . </p> <p> See the <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/design/bulk_spec.md"> <code> GRAPH.BULK </code> implementation details </a> for more information. </p> <h2 id="data-types"> Data types </h2> <p> RedisGraph supports a number of distinct data types, including: </p> <ul> <li> <p> Graph types: </p> <ul> <li> Nodes </li> <li> Relationships </li> <li> Paths </li> </ul> </li> <li> <p> Scalar types: </p> <ul> <li> Strings </li> <li> Booleans </li> <li> Integers </li> <li> Floating-point values </li> <li> Geospatial points </li> <li> Null </li> </ul> </li> <li> <p> Collection types: </p> <ul> <li> Arrays </li> <li> Maps </li> </ul> </li> </ul> <p> See <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/datatypes.md"> RedisGraph data types </a> for details. </p> <h2 id="cypher-coverage"> Cypher coverage </h2> <p> RedisGraph implements a subset of the Cypher language. See <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/cypher_support.md"> Cypher coverage </a> for more information. </p> <h2 id="path-algorithms"> Path algorithms </h2> <p> To learn how to find single-pair and single-source paths using <code> algo.SPpaths </code> and <code> algo.SSpaths </code> , see <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/path_algorithm.md"> Path algorithms </a> . </p> <h2 id="known-limitations"> Known limitations </h2> <p> RedisGraph has several <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/known_limitations.md"> known limitations </a> . </p> <h2 id="more-info"> More info </h2> <ul> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/graph-quickstart/"> Graph quick start </a> </p> </li> <li> <p> <a href="https://github.com/RedisGraph/RedisGraph/tree/master/docs/docs"> RedisGraph documentation on GitHub </a> </p> </li> <li> <p> <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/References.md"> References </a> </p> </li> <li> <p> <a href="https://github.com/RedisGraph/RedisGraph/"> RedisGraph source </a> </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/restore-asking/.html
<section class="prose w-full py-12"> <h1 class="command-name"> RESTORE-ASKING </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">RESTORE-ASKING key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 3.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)). </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @keyspace </code> <span class="mr-1 last:hidden"> , </span> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> The <code> RESTORE-ASKING </code> command is an internal command. It is used by a Redis cluster master during slot migration. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> . <br/> <h2> History </h2> <ul> <li> Starting with Redis version 3.0.0: Added the <code> REPLACE </code> modifier. </li> <li> Starting with Redis version 5.0.0: Added the <code> ABSTTL </code> modifier. </li> <li> Starting with Redis version 5.0.0: Added the <code> IDLETIME </code> and <code> FREQ </code> options. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/restore-asking/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.10-release-notes.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisTimeSeries 1.10 release notes </h1> <p class="text-lg -mt-5 mb-10"> RESP3 support. Performance improvements. </p> <h2 id="requirements"> Requirements </h2> <p> RedisTimeSeries v1.10.12 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 7.2 </li> <li> Minimum Redis Enterprise Software version (cluster): 7.2.4 </li> </ul> <h2 id="v11012-march-2024"> v1.10.12 (March 2024) </h2> <p> This is a maintenance release for RedisTimeSeries 1.10. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1593"> #1593 </a> More detailed LibMR error messages </li> </ul> </li> </ul> <h2 id="v11011-october-2023"> v1.10.11 (October 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.10. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGears/LibMR/pull/51"> LibMR#51 </a> Crash on SSL initialization failure (MOD-5647) </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1538"> #1538 </a> Amazon Linux 2: crash on SSL initialization. We now use openssl11-devel instead of openssl-devel (MOD-6015) </li> </ul> </li> </ul> <h2 id="v1109-october-2023"> v1.10.9 (October 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.10. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1516"> #1516 </a> Added support for CBL-Mariner 2 </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1514"> #1514 </a> Added support for Rocky Linux 9 and RHEL9 </li> </ul> </li> </ul> <h2 id="v1106-september-2023"> v1.10.6 (September 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.10. </p> <p> Update urgency: <code> SECURITY </code> : There are security fixes in the release. </p> <p> Details: </p> <ul> <li> <p> Security and privacy: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1506"> #1506 </a> Don’t expose internal commands (MOD-5643) </li> </ul> </li> </ul> <h2 id="v110-ga-v1104-july-2023"> v1.10 GA (v1.10.4) (July 2023) </h2> <p> This is the General Availability release of RedisTimeSeries 1.10. </p> <h3 id="headlines"> Headlines </h3> <p> RedisTimeSeries 1.10 introduces support for RESP3, performance improvements, and bug fixes. </p> <h3 id="details"> Details </h3> <p> Bug fixes (since 1.10-RC3): </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1494"> #1494 </a> Potential crash when using an invalid argument value </li> </ul> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <ul> <li> <p> The version inside Redis will be 1.10.4 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a GA flag. </p> </li> <li> <p> Minimal Redis version: 7.2 </p> </li> </ul> </div> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.10-release-notes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/config/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin cluster config </h1> <p class="text-lg -mt-5 mb-10"> Updates the cluster's configuration. </p> <p> Updates the cluster configuration. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> rladmin cluster config </span></span><span class="line"><span class="cl"> <span class="o">[</span> auditing db_conns audit_protocol <span class="o">{</span> TCP <span class="p">|</span> <span class="nb">local</span> <span class="o">}</span> </span></span><span class="line"><span class="cl"> audit_address &lt;audit_address&gt; audit_port &lt;audit_port&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span>bigstore_driver <span class="o">{</span>speedb <span class="p">|</span> rocksdb<span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> control_cipher_suites &lt;BoringSSL cipher list&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> cm_port &lt;number&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> cm_session_timeout_minutes &lt;minutes&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> cnm_http_port &lt;number&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> cnm_https_port &lt;number&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> crdb_coordinator_port &lt;number&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> data_cipher_list &lt;openSSL cipher list&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> data_cipher_suites_tls_1_3 &lt;openSSL cipher list&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> debuginfo_path &lt;filepath&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> encrypt_pkeys <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> envoy_admin_port &lt;new-port&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> envoy_mgmt_server_port &lt;new-port&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> gossip_envoy_admin_port &lt;new-port&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> handle_redirects <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> handle_metrics_redirects <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> http_support <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> ipv6 <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> min_control_TLS_version <span class="o">{</span> 1.2 <span class="p">|</span> 1.3 <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> min_data_TLS_version <span class="o">{</span> 1.2 <span class="p">|</span> 1.3 <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> min_sentinel_TLS_version <span class="o">{</span> 1.2 <span class="p">|</span> 1.3 <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> reserved_ports &lt;list of ports/port ranges&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> s3_url &lt;URL&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> s3_ca_cert &lt;filepath&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> saslauthd_ldap_conf &lt;/tmp/ldap.conf&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> sentinel_tls_mode <span class="o">{</span> allowed <span class="p">|</span> required <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> sentinel_cipher_suites &lt;golang cipher list&gt; <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> services <span class="o">{</span> cm_server <span class="p">|</span> crdb_coordinator <span class="p">|</span> crdb_worker <span class="p">|</span> </span></span><span class="line"><span class="cl"> mdns_server <span class="p">|</span> pdns_server <span class="p">|</span> saslauthd <span class="p">|</span> </span></span><span class="line"><span class="cl"> stats_archiver <span class="o">}</span> <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span><span class="line"><span class="cl"> <span class="o">[</span> upgrade_mode <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> audit_address </td> <td> string </td> <td> TCP/IP address where a listener can capture <a href="/docs/latest/operate/rs/7.4/security/audit-events/"> audit event notifications </a> </td> </tr> <tr> <td> audit_port </td> <td> string </td> <td> Port where a listener can capture <a href="/docs/latest/operate/rs/7.4/security/audit-events/"> audit event notifications </a> </td> </tr> <tr> <td> audit_protocol </td> <td> <code> tcp </code> <br/> <code> local </code> </td> <td> Protocol used for <a href="/docs/latest/operate/rs/7.4/security/audit-events/"> audit event notifications </a> <br/> For production systems, only <code> tcp </code> is supported. </td> </tr> <tr> <td> control_cipher_suites </td> <td> list of ciphers </td> <td> Cipher suites used for TLS connections to the Cluster Manager UI (specified in the format understood by the BoringSSL library) <br/> (previously named <code> cipher_suites </code> ) </td> </tr> <tr> <td> cm_port </td> <td> integer </td> <td> UI server listening port </td> </tr> <tr> <td> cm_session_timeout_minutes </td> <td> integer </td> <td> Timeout in minutes for the CM session </td> </tr> <tr> <td> cnm_http_port </td> <td> integer </td> <td> HTTP REST API server listening port </td> </tr> <tr> <td> cnm_https_port </td> <td> integer </td> <td> HTTPS REST API server listening port </td> </tr> <tr> <td> crdb_coordinator_port </td> <td> integer, (range: 1024-65535) (default: 9081) </td> <td> CRDB coordinator port </td> </tr> <tr> <td> data_cipher_list </td> <td> list of ciphers </td> <td> Cipher suites used by the the data plane (specified in the format understood by the OpenSSL library) </td> </tr> <tr> <td> data_cipher_suites_tls_1_3 </td> <td> list of ciphers </td> <td> Specifies the enabled TLS 1.3 ciphers for the data plane </td> </tr> <tr> <td> debuginfo_path </td> <td> filepath </td> <td> Local directory to place generated support package files </td> </tr> <tr> <td> encrypt_pkeys </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enable or turn off encryption of private keys </td> </tr> <tr> <td> envoy_admin_port </td> <td> integer, (range: 1024-65535) </td> <td> Envoy admin port. Changing this port during runtime might result in an empty response because envoy serves as the cluster gateway. </td> </tr> <tr> <td> envoy_mgmt_server_port </td> <td> integer, (range: 1024-65535) </td> <td> Envoy management server port </td> </tr> <tr> <td> gossip_envoy_admin_port </td> <td> integer, (range: 1024-65535) </td> <td> Gossip envoy admin port </td> </tr> <tr> <td> handle_redirects </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enable or turn off handling DNS redirects when DNS is not configured and running behind a load balancer </td> </tr> <tr> <td> handle_metrics_redirects </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enable or turn off handling cluster redirects internally for Metrics API </td> </tr> <tr> <td> http_support </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enable or turn off using HTTP for REST API connections </td> </tr> <tr> <td> ipv6 </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enable or turn off IPv6 connections to the Cluster Manager UI </td> </tr> <tr> <td> min_control_TLS_version </td> <td> <code> 1.2 </code> <br/> <code> 1.3 </code> </td> <td> The minimum TLS protocol version that is supported for the control path </td> </tr> <tr> <td> min_data_TLS_version </td> <td> <code> 1.2 </code> <br/> <code> 1.3 </code> </td> <td> The minimum TLS protocol version that is supported for the data path </td> </tr> <tr> <td> min_sentinel_TLS_version </td> <td> <code> 1.2 </code> <br/> <code> 1.3 </code> </td> <td> The minimum TLS protocol version that is supported for the discovery service </td> </tr> <tr> <td> reserved_ports </td> <td> list of ports/port ranges </td> <td> List of reserved ports and/or port ranges to avoid using for database endpoints (for example <code> reserved_ports 11000 13000-13010 </code> ) </td> </tr> <tr> <td> s3_url </td> <td> string </td> <td> The URL of S3 export and import </td> </tr> <tr> <td> s3_ca_cert </td> <td> string </td> <td> The CA certificate filepath for S3 export and import </td> </tr> <tr> <td> saslauthd_ldap_conf </td> <td> filepath </td> <td> Updates LDAP authentication configuration for the cluster </td> </tr> <tr> <td> sentinel_cipher_suites </td> <td> list of ciphers </td> <td> Cipher suites used by the discovery service (supported ciphers are implemented by the <a href="https://golang.org/src/crypto/tls/cipher_suites.go"> cipher_suites.go </a> package) </td> </tr> <tr> <td> sentinel_tls_mode </td> <td> <code> allowed </code> <br/> <code> required </code> <br/> <code> disabled </code> </td> <td> Define the SSL policy for the discovery service <br/> (previously named <code> sentinel_ssl_policy </code> ) </td> </tr> <tr> <td> services </td> <td> <code> cm_server </code> <br/> <code> crdb_coordinator </code> <br/> <code> crdb_worker </code> <br/> <code> mdns_server </code> <br/> <code> pdns_server </code> <br/> <code> saslauthd </code> <br/> <code> stats_archiver </code> <br/> <br/> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enable or turn off selected cluster services </td> </tr> <tr> <td> upgrade_mode </td> <td> <code> enabled </code> <br/> <code> disabled </code> </td> <td> Enable or turn off upgrade mode on the cluster </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Reports whether the cluster was configured successfully. Displays an error message if the configuration attempt fails. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster config cm_session_timeout_minutes <span class="m">20</span> </span></span><span class="line"><span class="cl">Cluster configured successfully </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/config/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/installing-redisgears/.html
<section class="prose w-full py-12 max-w-none"> <h1> Install RedisGears </h1> <p> Before you can use RedisGears, you have to install the RedisGears module on your Redis Enterprise cluster. </p> <h2 id="minimum-requirements"> Minimum requirements </h2> <ul> <li> Redis Enterprise 6.0.12 or later </li> <li> The <a href="/docs/latest/operate/rs/clusters/new-cluster-setup/"> cluster is setup </a> and all of the nodes are joined to the cluster </li> </ul> <h2 id="install-redisgears"> Install RedisGears </h2> <p> If your cluster uses Redis Enterprise v6.0.12 or later and has internet access, you only need to download the RedisGears package. It automatically fetches dependencies like the Python and JVM plugins during online installation. </p> <p> Offline installation requires you to manually upload dependencies to the master node. </p> <h3 id="install-redisgears-and-dependencies"> Install RedisGears and dependencies </h3> <ol> <li> <p> Download the <strong> RedisGears </strong> package from the Redis Enterprise <a href="https://cloud.redis.io/#/rlec-downloads"> download center </a> . </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> For offline installation of RedisGears v1.2 and later, you also need to download the <strong> RedisGears Dependencies </strong> packages for both Python and Java. <br/> For RedisGears v1.0, you only need the Python dependency package. </div> </div> </li> <li> <p> Upload the RedisGears package to a node in the cluster. </p> </li> <li> <p> For offline installation only, copy the dependencies to the following directory on the master node: <code> $modulesdatadir/rg/&lt;version-integer&gt;/deps/ </code> </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ cp redisgears-jvm.&lt;OS&gt;.&lt;version&gt;.tgz <span class="nv">$modulesdatadir</span>/rg/&lt;version-integer&gt;/deps/ </span></span></code></pre> </div> <p> Replace these fields with your own values: </p> <ul> <li> <p> <code> &lt;OS&gt; </code> : the operating system running Redis Enterprise </p> </li> <li> <p> <code> &lt;version&gt; </code> : the RedisGears version <code> (x.y.z) </code> </p> </li> <li> <p> <code> &lt;version-integer&gt; </code> : the RedisGears version as an integer, calculated as <nobr> <code> (x*10000 + y*100 + z) </code> </nobr> </p> <p> For example, the <code> &lt;version-integer&gt; </code> for RedisGears version 1.2.5 is 10205. </p> </li> </ul> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Skip this step unless your cluster does not have internet access. </div> </div> </li> <li> <p> Add RedisGears to the cluster with a <code> POST </code> request to the master node's <a href="/docs/latest/operate/rs/references/rest-api/requests/modules/#post-module-v2"> <code> /v2/modules </code> </a> REST API endpoint: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v2/modules </span></span><span class="line"><span class="cl"><span class="o">{</span><span class="s2">"module=@/tmp/redisgears.&lt;OS&gt;.&lt;version&gt;.zip"</span><span class="o">}</span> </span></span></code></pre> </div> </li> </ol> <p> Here, the <em> module </em> parameter specifies the full path of the module package and must be submitted as form-data. In addition, the package must be available and accessible to the server processing the request. </p> <p> After the install is complete, RedisGears will appear in the list of available modules on the <strong> settings </strong> and <strong> create database </strong> pages of the Redis Enterprise admin console. </p> <h3 id="enable-redisgears-for-a-database"> Enable RedisGears for a database </h3> <p> After installation, create a new database and enable RedisGears: </p> <ul> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/python/install/"> With Python </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/install/"> With the JVM </a> </p> </li> </ul> <h2 id="uninstall-redisgears"> Uninstall RedisGears </h2> <p> To uninstall RedisGears, make a <a href="/docs/latest/operate/rs/references/rest-api/requests/modules/#delete-module-v2"> <code> DELETE </code> request to the <code> /v2/modules </code> REST API endpoint </a> . </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/installing-redisgears/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/syncer_state/replica/.html
<section class="prose w-full py-12 max-w-none"> <h1> Replica syncer state requests </h1> <p class="text-lg -mt-5 mb-10"> Replica syncer state requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-syncer-state"> GET </a> </td> <td> <code> /v1/bdbs/{uid}/syncer_state/replica </code> </td> <td> Get a CRDB replica's syncer state </td> </tr> </tbody> </table> <h2 id="get-syncer-state"> Get replica syncer state </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/bdbs/<span class="o">{</span>int: uid<span class="o">}</span>/syncer_state/replica </span></span></code></pre> </div> <p> Get a CRDB replica's syncer state as JSON. </p> <h3 id="permissions"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_bdb_info"> view_bdb_info </a> </td> <td> admin <br/> cluster_member <br/> cluster_viewer <br/> db_member <br/> db_viewer </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/bdbs/1/syncer_state/replica </span></span></code></pre> </div> <h4 id="headers"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> The domain name or IP of the cluster. </td> </tr> <tr> <td> Accept </td> <td> application/json </td> </tr> </tbody> </table> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The unique ID of the database requested. </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns a JSON object that represents the syncer state. </p> <h4 id="example-json-body"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"DB"</span><span class="p">:</span> <span class="mi">22</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"RunID"</span><span class="p">:</span> <span class="mi">1584086516</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="c1">// additional fields... </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="p">}</span> </span></span></code></pre> </div> <h4 id="get-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> OK </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Syncer state key does not exist </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> Internal error </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4"> 503 Service Unavailable </a> </td> <td> Redis connection error, service unavailable </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/syncer_state/replica/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/rs-7-4-6-102/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software release notes 7.4.6-102 (October 2024) </h1> <p class="text-lg -mt-5 mb-10"> Updated module feature sets with later versions of RediSearch and RedisTimeSeries. </p> <p> This is a maintenance release for ​ <a href="https://redis.com/redis-enterprise-software/download-center/software/"> ​Redis Enterprise Software version 7.4.6 </a> . </p> <h2 id="highlights"> Highlights </h2> <p> This version offers: </p> <ul> <li> Updated module feature sets with later versions of RediSearch and RedisTimeSeries </li> </ul> <h2 id="new-in-this-release"> New in this release </h2> <h4 id="redis-module-feature-sets"> Redis module feature sets </h4> <p> Redis Enterprise comes packaged with several modules. As of version 7.4.2, Redis Enterprise includes two feature sets, compatible with different Redis database versions. </p> <p> Bundled Redis modules compatible with Redis database version 7.2: </p> <ul> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.8-release-notes/"> RediSearch 2.8.19 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.6-release-notes/"> RedisJSON 2.6.13 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.10-release-notes/"> RedisTimeSeries 1.10.15 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.6-release-notes/"> RedisBloom 2.6.15 </a> </p> </li> <li> <p> <a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.20-m21"> RedisGears 2.0.20 preview </a> : The RedisGears preview will not be promoted to GA and will be removed in a future release. </p> </li> </ul> <p> Bundled Redis modules compatible with Redis database versions 6.0 and 6.2: </p> <ul> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.6-release-notes/"> RediSearch 2.6.23 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.4-release-notes/"> RedisJSON 2.4.9 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.8-release-notes/"> RedisTimeSeries 1.8.15 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.4-release-notes/"> RedisBloom 2.4.12 </a> </p> </li> <li> <p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.10-release-notes/"> RedisGraph v2.10.15 </a> : RedisGraph end-of-life has been announced and will be removed in a future release. See the <a href="https://redis.io/blog/redisgraph-eol/"> RedisGraph end-of-life announcement </a> for more details. </p> </li> </ul> <h2 id="version-changes"> Version changes </h2> <h3 id="product-lifecycle-updates"> Product lifecycle updates </h3> <h4 id="end-of-life-policy-extension"> End-of-life policy extension </h4> <p> The end-of-life policy for Redis Enterprise Software versions 6.2 and later has been extended to 24 months after the formal release of the subsequent major version. For the updated end-of-life schedule, see the <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/"> Redis Enterprise Software product lifecycle </a> . </p> <h4 id="supported-upgrade-paths"> Supported upgrade paths </h4> <p> Redis Enterprise Software versions 6.2.4 and 6.2.8 do not support direct upgrades beyond version 7.4.x. Versions 6.2.10, 6.2.12, and 6.2.18 are part of the <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-cluster/#supported-upgrade-paths"> upgrade path </a> . To upgrade from 6.2.4 or 6.2.8 to versions later than 7.4.x, an intermediate upgrade is required. </p> <p> The next major Redis Enterprise Software release will still bundle Redis database version 6.2 and allow database upgrades from Redis database version 6.2 to 7.x. </p> <p> See the <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/"> Redis Enterprise Software product lifecycle </a> for more information about release numbers. </p> <h3 id="deprecations"> Deprecations </h3> <h4 id="legacy-ui-deprecation"> Legacy UI deprecation </h4> <p> The legacy UI is deprecated in favor of the new Cluster Manager UI and will be removed in a future release. </p> <h4 id="redis-60-database-deprecation"> Redis 6.0 database deprecation </h4> <p> Redis database version 6.0 is deprecated as of Redis Enterprise Software version 7.4.2 and will be removed in a future release. </p> <p> To prepare for the future removal of Redis 6.0: </p> <ul> <li> <p> For Redis Enterprise 6.2.* clusters, upgrade Redis 6.0 databases to Redis 6.2. See the <a href="https://raw.githubusercontent.com/redis/redis/6.2/00-RELEASENOTES"> Redis 6.2 release notes </a> for the list of changes. </p> </li> <li> <p> For Redis Enterprise 7.2.4 and 7.4.x clusters, upgrade Redis 6.0 databases to Redis 7.2. Before you upgrade your databases, see the list of <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52/#redis-72-breaking-changes"> Redis 7.2 breaking changes </a> and update any applications that connect to your database to handle these changes. </p> </li> </ul> <h4 id="end-of-triggers-and-functions-preview"> End of triggers and functions preview </h4> <p> The <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/"> triggers and functions </a> (RedisGears) preview has been discontinued. </p> <ul> <li> <p> Commands such as <code> TFCALL </code> , <code> TFCALLASYNC </code> , and <code> TFUNCTION </code> will be deprecated and will return error messages. </p> </li> <li> <p> Any JavaScript functions stored in Redis will be removed. </p> </li> <li> <p> JavaScript-based triggers will be blocked. </p> </li> <li> <p> Lua functions and scripts will not be affected. </p> </li> </ul> <p> If your database currently uses triggers and functions, you need to: </p> <ol> <li> <p> Adjust your applications to accommodate these changes. </p> </li> <li> <p> Delete all triggers and functions libraries from your existing database: </p> <ol> <li> <p> Run <code> TFUNCTION LIST </code> . </p> </li> <li> <p> Copy all library names. </p> </li> <li> <p> Run <code> TFUNCTION DELETE </code> for each library in the list. </p> </li> </ol> <p> If any triggers and functions libraries remain in the database, the RDB snapshot won't load on a cluster without RedisGears. </p> </li> <li> <p> Migrate your database to a new database without the RedisGears module. </p> </li> </ol> <h4 id="redisgraph-end-of-life"> RedisGraph end of life </h4> <p> Redis has announced the end of life for RedisGraph. Redis will continue to support all RedisGraph customers, including releasing patch versions until January 31, 2025. </p> <p> See the <a href="https://redis.com/blog/redisgraph-eol/"> RedisGraph end-of-life announcement </a> for more details. </p> <h3 id="upcoming-changes"> Upcoming changes </h3> <h4 id="default-image-change-for-redis-enterprise-software-containers"> Default image change for Redis Enterprise Software containers </h4> <p> Starting with the next major version, Redis Enterprise Software containers with the image tag <code> x.y.z-build </code> will be based on RHEL instead of Ubuntu. </p> <p> This change will only affect you if you use containers outside the official <a href="/docs/latest/operate/kubernetes/"> Redis Enterprise for Kubernetes </a> product and use Ubuntu-specific commands. </p> <p> To use Ubuntu-based images after this change, you can specify the operating system suffix in the image tag. For example, use the image tag <code> 7.4.2-216.focal </code> instead of <code> 7.4.2-216 </code> . </p> <h3 id="supported-platforms"> Supported platforms </h3> <p> The following table provides a snapshot of supported platforms as of this Redis Enterprise Software release. See the <a href="/docs/latest/operate/rs/references/supported-platforms/"> supported platforms reference </a> for more details about operating system compatibility. </p> <p> <span title="Check mark icon"> ✅ </span> Supported – The platform is supported for this version of Redis Enterprise Software and Redis Stack modules. </p> <p> <span class="font-serif" title="Warning icon"> ⚠️ </span> Deprecation warning – The platform is still supported for this version of Redis Enterprise Software, but support will be removed in a future release. </p> <table> <thead> <tr> <th> Redis Enterprise <br/> major versions </th> <th style="text-align:center"> 7.4 </th> <th style="text-align:center"> 7.2 </th> <th style="text-align:center"> 6.4 </th> <th style="text-align:center"> 6.2 </th> </tr> </thead> <tbody> <tr> <td> <strong> Release date </strong> </td> <td style="text-align:center"> Feb 2024 </td> <td style="text-align:center"> Aug 2023 </td> <td style="text-align:center"> Feb 2023 </td> <td style="text-align:center"> Aug 2021 </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/#endoflife-schedule"> <strong> End-of-life date </strong> </a> </td> <td style="text-align:center"> Determined after <br/> next major release </td> <td style="text-align:center"> Feb 2026 </td> <td style="text-align:center"> Aug 2025 </td> <td style="text-align:center"> Feb 2025 </td> </tr> <tr> <td> <strong> Platforms </strong> </td> <td style="text-align:center"> </td> <td style="text-align:center"> </td> <td style="text-align:center"> </td> <td style="text-align:center"> </td> </tr> <tr> <td> RHEL 9 &amp; <br/> compatible distros <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> – </td> <td style="text-align:center"> – </td> <td style="text-align:center"> – </td> </tr> <tr> <td> RHEL 8 &amp; <br/> compatible distros <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> RHEL 7 &amp; <br/> compatible distros <sup> <a href="#table-note-1"> 1 </a> </sup> </td> <td style="text-align:center"> – </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> Ubuntu 20.04 <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> – </td> </tr> <tr> <td> Ubuntu 18.04 <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> Ubuntu 16.04 <sup> <a href="#table-note-2"> 2 </a> </sup> </td> <td style="text-align:center"> – </td> <td style="text-align:center"> <span class="font-serif" title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> Amazon Linux 2 </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> – </td> </tr> <tr> <td> Amazon Linux 1 </td> <td style="text-align:center"> – </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> Kubernetes <sup> <a href="#table-note-3"> 3 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> Docker <sup> <a href="#table-note-4"> 4 </a> </sup> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> </tbody> </table> <ol> <li> <p> <a name="table-note-1" style="display: block; height: 80px; margin-top: -80px;"> </a> The RHEL-compatible distributions CentOS, CentOS Stream, Alma, and Rocky are supported if they have full RHEL compatibility. Oracle Linux running the Red Hat Compatible Kernel (RHCK) is supported, but the Unbreakable Enterprise Kernel (UEK) is not supported. </p> </li> <li> <p> <a name="table-note-2" style="display: block; height: 80px; margin-top: -80px;"> </a> The server version of Ubuntu is recommended for production installations. The desktop version is only recommended for development deployments. </p> </li> <li> <p> <a name="table-note-3" style="display: block; height: 80px; margin-top: -80px;"> </a> See the <a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/"> Redis Enterprise for Kubernetes documentation </a> for details about support per version and Kubernetes distribution. </p> </li> <li> <p> <a name="table-note-4" style="display: block; height: 80px; margin-top: -80px;"> </a> <a href="/docs/latest/operate/rs/installing-upgrading/quickstarts/docker-quickstart/"> Docker images </a> of Redis Enterprise Software are certified for development and testing only. </p> </li> </ol> <h2 id="downloads"> Downloads </h2> <p> The following table shows the SHA256 checksums for the available packages: </p> <table> <thead> <tr> <th> Package </th> <th> SHA256 checksum (7.4.6-102 October release) </th> </tr> </thead> <tbody> <tr> <td> Ubuntu 18 </td> <td> <span class="break-all"> f4e6af466b565e59d2e3fb1f5f0c70b7903564a0f1a45cc5a6816caf20059f93 </span> </td> </tr> <tr> <td> Ubuntu 20 </td> <td> <span class="break-all"> 9f10ed232a5655fdc5b46d2dd98157449484fb03290c8c71994cf29b50c4b4a7 </span> </td> </tr> <tr> <td> Red Hat Enterprise Linux (RHEL) 8 </td> <td> <span class="break-all"> 412a2244e5fd464382acccf811a221671c120fcb51d00bf6bc3089b6f9ad034e </span> </td> </tr> <tr> <td> Red Hat Enterprise Linux (RHEL) 9 </td> <td> <span class="break-all"> b4fc25f6a812fe05ab990049f7f6f8a22932c5d8c507c475455802009ed5acca </span> </td> </tr> <tr> <td> Amazon Linux 2 </td> <td> <span class="break-all"> ab3dafdc46823548a6a4a2870be1db21cd2d907533bd0fddf59a895b94c00863 </span> </td> </tr> </tbody> </table> <h2 id="known-issues"> Known issues </h2> <ul> <li> <p> RS131972: Creating an ACL that contains a line break in the Cluster Manager UI can cause shard migration to fail due to ACL errors. </p> </li> <li> <p> RS61676: Full chain certificate update fails if any certificate in the chain does not have a Common Name (CN). </p> </li> <li> <p> RS119958: The <code> debuginfo </code> script fails with the error <code> /bin/tar: Argument list too long </code> if there are too many RocksDB log files. This issue only affects clusters with Auto Tiering. </p> </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <h4 id="new-cluster-manager-ui-limitations"> New Cluster Manager UI limitations </h4> <p> The following legacy UI features are not yet available in the new Cluster Manager UI: </p> <ul> <li> <p> Remove a node. </p> <p> Use the REST API or legacy UI instead. See <a href="/docs/latest/operate/rs/clusters/remove-node/"> Remove a cluster node </a> for instructions. </p> </li> <li> <p> Purge an Active-Active instance. </p> <p> Use <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/purge-instance/"> <code> crdb-cli crdb purge-instance </code> </a> instead. </p> </li> <li> <p> Search and export the log. </p> </li> </ul> <h4 id="openssl-compatibility-issue-for-742-modules-on-amazon-linux-2"> OpenSSL compatibility issue for 7.4.2 modules on Amazon Linux 2 </h4> <p> Due to an OpenSSL 1.1 compatibility issue between modules and clusters, Redis Enterprise Software version 7.4.2-54 is not fully supported on Amazon Linux 2 clusters with databases that use the following modules: RedisGears, RediSearch, or RedisTimeSeries. </p> <p> This issue will be fixed in a future maintenance release. </p> <h4 id="redisgraph-prevents-upgrade-to-rhel-9"> RedisGraph prevents upgrade to RHEL 9 </h4> <p> You cannot upgrade from a prior RHEL version to RHEL 9 if the Redis Enterprise cluster contains a RedisGraph module, even if unused by any database. The <a href="https://redis.com/blog/redisgraph-eol/"> RedisGraph module has reached End-of-Life </a> and is completely unavailable in RHEL 9. </p> <h2 id="security"> Security </h2> <h4 id="open-source-redis-security-fixes-compatibility"> Open source Redis security fixes compatibility </h4> <p> As part of Redis's commitment to security, Redis Enterprise Software implements the latest <a href="https://github.com/redis/redis/releases"> security fixes </a> available with <a href="https://github.com/redis/redis"> open source Redis </a> . Redis Enterprise has already included the fixes for the relevant CVEs. </p> <p> Some CVEs announced for open source Redis do not affect Redis Enterprise due to different or additional functionality available in Redis Enterprise that is not available in open source Redis. </p> <p> Redis Enterprise 7.4.6-102 supports open source Redis 7.2, 6.2, and 6.0. Below is the list of open source Redis CVEs fixed by version. </p> <p> Redis 7.2.x: </p> <ul> <li> <p> (CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution. </p> </li> <li> <p> (CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as <code> KEYS </code> , <code> SCAN </code> , <code> PSUBSCRIBE </code> , <code> FUNCTION LIST </code> , <code> COMMAND LIST </code> , and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes. </p> </li> <li> <p> (CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution. </p> </li> <li> <p> (CVE-2023-41053) Redis does not correctly identify keys accessed by <code> SORT_RO </code> and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.2.1) </p> </li> </ul> <p> Redis 7.0.x: </p> <ul> <li> <p> (CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution. </p> </li> <li> <p> (CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as <code> KEYS </code> , <code> SCAN </code> , <code> PSUBSCRIBE </code> , <code> FUNCTION LIST </code> , <code> COMMAND LIST </code> , and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes. </p> </li> <li> <p> (CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution. </p> </li> <li> <p> (CVE-2023-41053) Redis does not correctly identify keys accessed by <code> SORT_RO </code> and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.0.13) </p> </li> <li> <p> (CVE-2023-36824) Extracting key names from a command and a list of arguments may, in some cases, trigger a heap overflow and result in reading random heap memory, heap corruption, and potentially remote code execution. Specifically: using <code> COMMAND GETKEYS* </code> and validation of key names in ACL rules. (Redis 7.0.12) </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 7.0.11) </p> </li> <li> <p> (CVE-2023-28425) Specially crafted <code> MSETNX </code> commands can lead to assertion and denial-of-service. (Redis 7.0.10) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 7.0.9) </p> </li> <li> <p> (CVE-2023-22458) Integer overflow in the Redis <code> HRANDFIELD </code> and <code> ZRANDMEMBER </code> commands can lead to denial-of-service. (Redis 7.0.8) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis can cause it to hang and consume 100% CPU time. (Redis 7.0.9) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 7.0.8) </p> </li> <li> <p> (CVE-2022-35951) Executing an <code> XAUTOCLAIM </code> command on a stream key in a specific state, with a specially crafted <code> COUNT </code> argument, may cause an integer overflow, a subsequent heap overflow, and potentially lead to remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.5) </p> </li> <li> <p> (CVE-2022-31144) A specially crafted <code> XAUTOCLAIM </code> command on a stream key in a specific state may result in heap overflow and potentially remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.4) </p> </li> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 7.0.12) </p> </li> <li> <p> (CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the <code> redis-server </code> process. This issue affects all versions of Redis. (Redis 7.0.0) </p> </li> <li> <p> (CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 7.0.0) </p> </li> </ul> <p> Redis 6.2.x: </p> <ul> <li> <p> (CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution. </p> </li> <li> <p> (CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as <code> KEYS </code> , <code> SCAN </code> , <code> PSUBSCRIBE </code> , <code> FUNCTION LIST </code> , <code> COMMAND LIST </code> , and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes. </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 6.2.12) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.2.11) </p> </li> <li> <p> (CVE-2023-22458) Integer overflow in the Redis <code> HRANDFIELD </code> and <code> ZRANDMEMBER </code> commands can lead to denial-of-service. (Redis 6.2.9) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis can cause it to hang and consume 100% CPU time. (Redis 6.2.11) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 6.2.9) </p> </li> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.2.13) </p> </li> <li> <p> (CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the <code> redis-server </code> process. This issue affects all versions of Redis. (Redis 6.2.7) </p> </li> <li> <p> (CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 6.2.7) </p> </li> <li> <p> (CVE-2021-41099) Integer to heap buffer overflow handling certain string commands and network payloads, when <code> proto-max-bulk-len </code> is manually configured to a non-default, very large value. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32762) Integer to heap buffer overflow issue in <code> redis-cli </code> and <code> redis-sentinel </code> parsing large multi-bulk replies on some older and less common platforms. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32761) An integer overflow bug in Redis version 2.2 or newer can be exploited using the <code> BITFIELD </code> command to corrupt the heap and potentially result with remote code execution. (Redis 6.2.5) </p> </li> <li> <p> (CVE-2021-32687) Integer to heap buffer overflow with intsets, when <code> set-max-intset-entries </code> is manually configured to a non-default, very large value. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32675) Denial Of Service when processing RESP request payloads with a large number of elements on many connections. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32672) Random heap reading issue with Lua Debugger. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32628) Integer to heap buffer overflow handling ziplist-encoded data types, when configuring a large, non-default value for <code> hash-max-ziplist-entries </code> , <code> hash-max-ziplist-value </code> , <code> zset-max-ziplist-entries </code> or <code> zset-max-ziplist-value </code> . (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32627) Integer to heap buffer overflow issue with streams, when configuring a non-default, large value for <code> proto-max-bulk-len </code> and <code> client-query-buffer-limit </code> . (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32626) Specially crafted Lua scripts may result with Heap buffer overflow. (Redis 6.2.6) </p> </li> <li> <p> (CVE-2021-32625) An integer overflow bug in Redis version 6.0 or newer can be exploited using the STRALGO LCS command to corrupt the heap and potentially result with remote code execution. This is a result of an incomplete fix by CVE-2021-29477. (Redis 6.2.4) </p> </li> <li> <p> (CVE-2021-29478) An integer overflow bug in Redis 6.2 could be exploited to corrupt the heap and potentially result with remote code execution. The vulnerability involves changing the default set-max-intset-entries configuration value, creating a large set key that consists of integer values and using the COPY command to duplicate it. The integer overflow bug exists in all versions of Redis starting with 2.6, where it could result with a corrupted RDB or DUMP payload, but not exploited through COPY (which did not exist before 6.2). (Redis 6.2.3) </p> </li> <li> <p> (CVE-2021-29477) An integer overflow bug in Redis version 6.0 or newer could be exploited using the STRALGO LCS command to corrupt the heap and potentially result in remote code execution. The integer overflow bug exists in all versions of Redis starting with 6.0. (Redis 6.2.3) </p> </li> </ul> <p> Redis 6.0.x: </p> <ul> <li> <p> (CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.0.20) </p> </li> <li> <p> (CVE-2023-28856) Authenticated users can use the <code> HINCRBYFLOAT </code> command to create an invalid hash field that will crash Redis on access. (Redis 6.0.19) </p> </li> <li> <p> (CVE-2023-25155) Specially crafted <code> SRANDMEMBER </code> , <code> ZRANDMEMBER </code> , and <code> HRANDFIELD </code> commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.0.18) </p> </li> <li> <p> (CVE-2022-36021) String matching commands (like <code> SCAN </code> or <code> KEYS </code> ) with a specially crafted pattern to trigger a denial-of-service attack on Redis can cause it to hang and consume 100% CPU time. (Redis 6.0.18) </p> </li> <li> <p> (CVE-2022-35977) Integer overflow in the Redis <code> SETRANGE </code> and <code> SORT </code> / <code> SORT_RO </code> commands can drive Redis to OOM panic. (Redis 6.0.17) </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/rs-7-4-6-102/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/reset_password/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin cluster reset_password </h1> <p class="text-lg -mt-5 mb-10"> Changes the password for a given email. </p> <p> Changes the password for the user associated with the specified email address. </p> <p> Enter a new password when prompted. Then enter the same password when prompted a second time to confirm the password change. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster reset_password &lt;user email&gt; </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> user email </td> <td> email address </td> <td> The email address of the user that needs a password reset </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Reports whether the password change succeeded or an error occurred. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster reset_password [email protected] </span></span><span class="line"><span class="cl">New password: </span></span><span class="line"><span class="cl">New password <span class="o">(</span>again<span class="o">)</span>: </span></span><span class="line"><span class="cl">Password changed. </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/reset_password/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/bitfield/.html
<section class="prose w-full py-12"> <h1 class="command-name"> BITFIELD </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">BITFIELD key [GET encoding offset | [OVERFLOW &lt;WRAP | SAT | FAIL&gt;] &lt;SET encoding offset value | INCRBY encoding offset increment&gt; [GET encoding offset | [OVERFLOW &lt;WRAP | SAT | FAIL&gt;] &lt;SET encoding offset value | INCRBY encoding offset increment&gt; ...]]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 3.2.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) for each subcommand specified </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @bitmap </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> The command treats a Redis string as an array of bits, and is capable of addressing specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset. In practical terms using this command you can set, for example, a signed 5 bits integer at bit offset 1234 to a specific value, retrieve a 31 bit unsigned integer from offset 4567. Similarly the command handles increments and decrements of the specified integers, providing guaranteed and well specified overflow and underflow behavior that the user can configure. </p> <p> <code> BITFIELD </code> is able to operate with multiple bit fields in the same command call. It takes a list of operations to perform, and returns an array of replies, where each array matches the corresponding operation in the list of arguments. </p> <p> For example the following command increments a 5 bit signed integer at bit offset 100, and gets the value of the 4 bit unsigned integer at bit offset 0: </p> <pre><code>&gt; BITFIELD mykey INCRBY i5 100 1 GET u4 0 1) (integer) 1 2) (integer) 0 </code></pre> <p> Note that: </p> <ol> <li> Addressing with <code> GET </code> bits outside the current string length (including the case the key does not exist at all), results in the operation to be performed like the missing part all consists of bits set to 0. </li> <li> Addressing with <code> SET </code> or <code> INCRBY </code> bits outside the current string length will enlarge the string, zero-padding it, as needed, for the minimal length needed, according to the most far bit touched. </li> </ol> <h2 id="supported-subcommands-and-integer-encoding"> Supported subcommands and integer encoding </h2> <p> The following is the list of supported commands. </p> <ul> <li> <strong> GET </strong> <code> &lt;encoding&gt; </code> <code> &lt;offset&gt; </code> -- Returns the specified bit field. </li> <li> <strong> SET </strong> <code> &lt;encoding&gt; </code> <code> &lt;offset&gt; </code> <code> &lt;value&gt; </code> -- Set the specified bit field and returns its old value. </li> <li> <strong> INCRBY </strong> <code> &lt;encoding&gt; </code> <code> &lt;offset&gt; </code> <code> &lt;increment&gt; </code> -- Increments or decrements (if a negative increment is given) the specified bit field and returns the new value. </li> </ul> <p> There is another subcommand that only changes the behavior of successive <code> INCRBY </code> and <code> SET </code> subcommands calls by setting the overflow behavior: </p> <ul> <li> <strong> OVERFLOW </strong> <code> [WRAP|SAT|FAIL] </code> </li> </ul> <p> Where an integer encoding is expected, it can be composed by prefixing with <code> i </code> for signed integers and <code> u </code> for unsigned integers with the number of bits of our integer encoding. So for example <code> u8 </code> is an unsigned integer of 8 bits and <code> i16 </code> is a signed integer of 16 bits. </p> <p> The supported encodings are up to 64 bits for signed integers, and up to 63 bits for unsigned integers. This limitation with unsigned integers is due to the fact that currently the Redis protocol is unable to return 64 bit unsigned integers as replies. </p> <h2 id="bits-and-positional-offsets"> Bits and positional offsets </h2> <p> There are two ways in order to specify offsets in the bitfield command. If a number without any prefix is specified, it is used just as a zero based bit offset inside the string. </p> <p> However if the offset is prefixed with a <code> # </code> character, the specified offset is multiplied by the integer encoding's width, so for example: </p> <pre><code>BITFIELD mystring SET i8 #0 100 SET i8 #1 200 </code></pre> <p> Will set the first i8 integer at offset 0 and the second at offset 8. This way you don't have to do the math yourself inside your client if what you want is a plain array of integers of a given size. </p> <h2 id="overflow-control"> Overflow control </h2> <p> Using the <code> OVERFLOW </code> command the user is able to fine-tune the behavior of the increment or decrement overflow (or underflow) by specifying one of the following behaviors: </p> <ul> <li> <strong> WRAP </strong> : wrap around, both with signed and unsigned integers. In the case of unsigned integers, wrapping is like performing the operation modulo the maximum value the integer can contain (the C standard behavior). With signed integers instead wrapping means that overflows restart towards the most negative value and underflows towards the most positive ones, so for example if an <code> i8 </code> integer is set to the value 127, incrementing it by 1 will yield <code> -128 </code> . </li> <li> <strong> SAT </strong> : uses saturation arithmetic, that is, on underflows the value is set to the minimum integer value, and on overflows to the maximum integer value. For example incrementing an <code> i8 </code> integer starting from value 120 with an increment of 10, will result into the value 127, and further increments will always keep the value at 127. The same happens on underflows, but towards the value is blocked at the most negative value. </li> <li> <strong> FAIL </strong> : in this mode no operation is performed on overflows or underflows detected. The corresponding return value is set to NULL to signal the condition to the caller. </li> </ul> <p> Note that each <code> OVERFLOW </code> statement only affects the <code> INCRBY </code> and <code> SET </code> commands that follow it in the list of subcommands, up to the next <code> OVERFLOW </code> statement. </p> <p> By default, <strong> WRAP </strong> is used if not otherwise specified. </p> <pre><code>&gt; BITFIELD mykey incrby u2 100 1 OVERFLOW SAT incrby u2 102 1 1) (integer) 1 2) (integer) 1 &gt; BITFIELD mykey incrby u2 100 1 OVERFLOW SAT incrby u2 102 1 1) (integer) 2 2) (integer) 2 &gt; BITFIELD mykey incrby u2 100 1 OVERFLOW SAT incrby u2 102 1 1) (integer) 3 2) (integer) 3 &gt; BITFIELD mykey incrby u2 100 1 OVERFLOW SAT incrby u2 102 1 1) (integer) 0 2) (integer) 3 </code></pre> <p> The following is an example of <code> OVERFLOW FAIL </code> returning NULL. </p> <pre><code>&gt; BITFIELD mykey OVERFLOW FAIL incrby u2 102 1 1) (nil) </code></pre> <h2 id="motivations"> Motivations </h2> <p> The motivation for this command is that the ability to store many small integers as a single large bitmap (or segmented over a few keys to avoid having huge keys) is extremely memory efficient, and opens new use cases for Redis to be applied, especially in the field of real time analytics. This use cases are supported by the ability to specify the overflow in a controlled way. </p> <p> Fun fact: Reddit's 2017 April fools' project <a href="https://reddit.com/r/place"> r/place </a> was <a href="https://redditblog.com/2017/04/13/how-we-built-rplace/"> built using the Redis BITFIELD command </a> in order to take an in-memory representation of the collaborative canvas. </p> <h2 id="performance-considerations"> Performance considerations </h2> <p> Usually <code> BITFIELD </code> is a fast command, however note that addressing far bits of currently short strings will trigger an allocation that may be more costly than executing the command on bits already existing. </p> <h2 id="orders-of-bits"> Orders of bits </h2> <p> The representation used by <code> BITFIELD </code> considers the bitmap as having the bit number 0 to be the most significant bit of the first byte, and so forth, so for example setting a 5 bits unsigned integer to value 23 at offset 7 into a bitmap previously set to all zeroes, will produce the following representation: </p> <pre><code>+--------+--------+ |00000001|01110000| +--------+--------+ </code></pre> <p> When offsets and integer sizes are aligned to bytes boundaries, this is the same as big endian, however when such alignment does not exist, its important to also understand how the bits inside a byte are ordered. </p> <h2 id="resp2-reply"> RESP2 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : each entry being the corresponding result of the sub-command given at the same position. </li> <li> <a href="../../develop/reference/protocol-spec#bulk-strings"> Nil reply </a> : if OVERFLOW FAIL was given and overflows or underflows are detected. </li> </ul> <h2 id="resp3-reply"> RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : each entry being the corresponding result of the sub-command given at the same position. </li> <li> <a href="../../develop/reference/protocol-spec#nulls"> Null reply </a> : if OVERFLOW FAIL was given and overflows or underflows are detected. </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/bitfield/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/databases/create-database/create-essentials-database/.html
<section class="prose w-full py-12 max-w-none"> <h1> Create an Essentials database </h1> <p class="text-lg -mt-5 mb-10"> Shows how to create an Essentials database. </p> <p> </p> <p> Before creating a Redis Cloud database, you need to <a href="/docs/latest/operate/rc/rc-quickstart/"> create an account </a> . </p> <p> To create a database in your Redis Cloud account: </p> <ol> <li> <p> Sign in to the <a href="https://cloud.redis.io"> Redis Cloud console </a> . </p> </li> <li> <p> Select the <strong> New database </strong> button. </p> <a href="/docs/latest/images/rc/button-database-new.png" sdata-lightbox="/images/rc/button-database-new.png"> <img alt="The New Database button creates a new database." src="/docs/latest/images/rc/button-database-new.png" width="120px"/> </a> <p> This displays the <strong> Create database </strong> screen. </p> </li> <li> <p> Select your Redis use case. There are four pre-defined use cases: </p> <a href="/docs/latest/images/rc/create-database-redis-use-cases.png" sdata-lightbox="/images/rc/create-database-redis-use-cases.png"> <img alt="The Redis Use case panel" src="/docs/latest/images/rc/create-database-redis-use-cases.png"/> </a> <ul> <li> <strong> Cache </strong> : Stores short-term or volatile data. Can be used for session management, semantic cache, session store, and other uses where data is short-lived. </li> <li> <strong> Database </strong> : Stores durable and consistent data. Can be used for document databases, feature storage, gaming leaderboards, durable caches, and other uses where your data needs to be highly available and persistent. </li> <li> <strong> Vector search </strong> : Manages and manipulates vector data. Can be used for Generative AI, recommendation systems, visual search, and other uses where you can search and query your data. </li> <li> <strong> Custom </strong> : If your Redis use case doesn't match any of the other use cases, you can choose this option to customize all of your settings. </li> </ul> <p> Select the use case that best matches your Redis use case. You can always change the settings later. </p> </li> </ol> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> See <a href="#use-case-settings"> Use case settings </a> to view the default settings for each use case. </div> </div> <p> </p> <ol start="4"> <li> <p> Select the type of <a href="/docs/latest/operate/rc/subscriptions/"> subscription </a> you need. For this guide, select <strong> Essentials </strong> . </p> <a href="/docs/latest/images/rc/create-database-subscription-essentials.png" sdata-lightbox="/images/rc/create-database-subscription-essentials.png"> <img alt="The Subscription selection panel with Essentials selected." src="/docs/latest/images/rc/create-database-subscription-essentials.png"/> </a> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <p> This guide shows how to create an Essentials database. </p> <ul> <li> If you'd rather create a Pro database, see <a href="/docs/latest/operate/rc/databases/create-database/create-pro-database-new/"> Create a Pro database with a new subscription </a> . </li> <li> If you already have a Pro subscription and want to add a database to it, see <a href="/docs/latest/operate/rc/databases/create-database/create-pro-database-existing/"> Create a Pro database in an existing subscription </a> . </li> </ul> </div> </div> <p> After you select <strong> Essentials </strong> , the rest of the database details will appear. </p> <a href="/docs/latest/images/rc/create-database-essentials-cloud-vendor.png" sdata-lightbox="/images/rc/create-database-essentials-cloud-vendor.png"> <img alt="The database name, cloud vendor, region, and type settings." src="/docs/latest/images/rc/create-database-essentials-cloud-vendor.png"/> </a> </li> <li> <p> Redis will generate a database name for you. If you want to change it, you can do so in the <strong> Database name </strong> field. </p> </li> <li> <p> Choose a <strong> Cloud Provider </strong> and a <strong> Region </strong> . </p> <p> A preview of Redis 7.4 is available for databases in selected regions. Select the <strong> Redis 7.4 preview </strong> toggle to view the regions where you can try Redis 7.4. </p> <a href="/docs/latest/images/rc/essentials-74-preview.png" sdata-lightbox="/images/rc/essentials-74-preview.png"> <img alt="Turn on the Redis 7.4 preview toggle." src="/docs/latest/images/rc/essentials-74-preview.png"/> </a> <p> Redis 7.4 offers hash field expiration and other feature set improvements. For more information on the changes in Redis 7.4, see the <a href="https://redis.io/blog/announcing-redis-community-edition-and-redis-stack-74"> Redis 7.4 release notes </a> . </p> </li> <li> <p> The <strong> Type </strong> of database controls the protocol and advanced capabilities. Leave this as <strong> Redis Stack </strong> unless you have a legacy application that uses <strong> Memcached </strong> . </p> <p> A Redis Stack database gives access to a set of advanced capabilities. For more information, see <a href="/docs/latest/operate/rc/databases/configuration/advanced-capabilities/#essentials"> Advanced capabilities </a> . </p> </li> <li> <p> In the <strong> Durability settings </strong> panel, choose your <strong> High availability settings </strong> and <strong> Data persistence </strong> settings from the list. </p> <a href="/docs/latest/images/rc/create-database-essentials-durability.png" sdata-lightbox="/images/rc/create-database-essentials-durability.png"> <img alt="The durability settings allow you to choose High availability and Data persistence." src="/docs/latest/images/rc/create-database-essentials-durability.png"/> </a> <p> Redis Cloud supports the following high availability settings: </p> <ul> <li> <strong> None </strong> : You will have a single copy of your database without replication. </li> <li> <strong> Single-Zone </strong> : Your database will have a primary and a replica located in the same cloud zone. If anything happens to the primary, the replica takes over and becomes the new primary. </li> <li> <strong> Multi-Zone </strong> : The primary and its replicas are stored in different zones. This means that your database can remain online even if an entire zone becomes unavailable. </li> </ul> <p> See <a href="/docs/latest/operate/rc/databases/configuration/high-availability/"> High availability </a> for more information about these settings. </p> <p> Redis Cloud supports the following Data persistence options: </p> <ul> <li> <p> An <strong> Append-Only File </strong> maintains a record (sometimes called a <em> redo log </em> or <em> journal </em> ) of write operations. This allows the data to be restored by using the record to reconstruct the database up to the point of failure. For Essentials databases, Redis updates the Append-Only file every second. </p> </li> <li> <p> A <strong> Snapshot </strong> is a copy of the in-memory database, taken at periodic intervals (one, six, or twelve hours). You can restore data to the snapshot's point in time. </p> </li> </ul> <p> See <a href="/docs/latest/operate/rc/databases/configuration/data-persistence/"> Data persistence </a> for more information about these settings. </p> <p> These settings may already be set based on the use case you selected. You can change them now if you like. </p> </li> <li> <p> Select the desired memory limit. To create a free database, select the 30 MB memory limit. You can only have one free database at a time. </p> <a href="/docs/latest/images/rc/subscription-new-fixed-tiers.png" sdata-lightbox="/images/rc/subscription-new-fixed-tiers.png"> <img alt="Available Essentials plans." src="/docs/latest/images/rc/subscription-new-fixed-tiers.png"/> </a> <p> For a comparison of available plans, see <a href="/docs/latest/operate/rc/subscriptions/view-essentials-subscription/essentials-plan-details/"> Redis Cloud Essentials plans </a> . </p> </li> <li> <p> Enter your payment details if you chose a paid plan. </p> <p> If you chose a paid plan and haven't previously entered a payment method, use the <strong> Add Credit Card </strong> button to add one. </p> <a href="/docs/latest/images/rc/icon-add-credit-card.png" sdata-lightbox="/images/rc/icon-add-credit-card.png"> <img alt="The Add credit card icon." src="/docs/latest/images/rc/icon-add-credit-card.png"/> </a> </li> <li> <p> Select <strong> Create database </strong> or <strong> Confirm &amp; pay </strong> to create your database. </p> </li> </ol> <a href="/docs/latest/images/rc/button-create-db-confirm-pay.png" sdata-lightbox="/images/rc/button-create-db-confirm-pay.png"> <img alt="Select Confirm &amp; Pay to create your new database." src="/docs/latest/images/rc/button-create-db-confirm-pay.png" width="140px"/> </a> <p> When you create your database, there's a brief pause while your request is processed and then the <strong> Database details </strong> page appears. </p> <h2 id="use-case-settings"> Use case settings </h2> <p> The following table shows the default use case settings for an Essentials database. </p> <table> <thead> <tr> <th> <strong> Type </strong> </th> <th> High Availability </th> <th> Data Persistence </th> <th> Size </th> <th> Eviction Policy </th> </tr> </thead> <tbody> <tr> <td> <strong> Cache </strong> </td> <td> None </td> <td> None </td> <td> 30 MB - 12 GB </td> <td> <code> volatile-lru </code> </td> </tr> <tr> <td> <strong> Database </strong> </td> <td> Multi-zone </td> <td> Append-only file every 1 sec </td> <td> 250 MB - 12 GB </td> <td> None </td> </tr> <tr> <td> <strong> Vector Search </strong> </td> <td> Multi-zone </td> <td> Append-only file every 1 sec </td> <td> 250 MB - 12 GB </td> <td> None </td> </tr> <tr> <td> <strong> Custom </strong> </td> <td> Single-zone </td> <td> Append-only file every 1 sec </td> <td> 250 MB - 12 GB </td> <td> None </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/databases/create-database/create-essentials-database/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/release-notes/7-4-6-releases/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise for Kubernetes 7.4.6-2 release notes </h1> <p class="text-lg -mt-5 mb-10"> Releases with support for Redis Enterprise Software 7.4.6. </p> <h2 id="detailed-release-notes"> Detailed release notes </h2> <table> <thead> <tr> <th style="text-align:left"> Version (Release date) </th> <th style="text-align:left"> Major changes </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/kubernetes/release-notes/7-4-6-releases/7-4-6-2-october24/"> 7.4.6-2 (October 2024) </a> </td> <td style="text-align:left"> This is a maintenance release with a new version of Redis Enterprise Software 7.4.6. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/kubernetes/release-notes/7-4-6-releases/7-4-6-2-oct24/"> 7.4.6-2 (October 2024) </a> </td> <td style="text-align:left"> This is a maintenance release with a new version of Redis Enterprise Software 7.4.6. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/kubernetes/release-notes/7-4-6-releases/7-4-6-2/"> 7.4.6-2 (July 2024) </a> </td> <td style="text-align:left"> This is a feature release with a new version of Redis Enterprise Software 7.4.6. </td> </tr> </tbody> </table> <h2 id="breaking-changes"> Breaking changes </h2> <p> The following changes included in this release affect the upgrade process. Please read carefully before upgrading. </p> <h3 id="validatingwebhookconfiguration"> ValidatingWebhookConfiguration </h3> <p> Versions 6.4.2-4 and later include a new <code> ValidatingWebhookConfiguration </code> resource to replace the <code> redb-admission </code> webhook resource. To use releases 6.4.2-4 or later, delete the old webhook resource and apply the new file. See <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#reapply-webhook"> upgrade Redis cluster </a> for instructions. </p> <h3 id="openshift-scc"> OpenShift SCC </h3> <p> Versions 6.4.2-6 and later include a new SCC ( <code> redis-enterprise-scc-v2 </code> ) that you need to bind to your service account before upgrading. If you skip this step, OpenShift clusters running version 6.2.12 or earlier might get stuck when upgrading to version 6.2.18 or later. See <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#before-upgrading"> upgrade a Redis Enterprise cluster (REC) </a> for instructions. </p> <h3 id="upcoming-changes"> Upcoming Changes </h3> <ul> <li> Future Redis Enterprise images will be UBI9-based only, without support for Ubuntu-based images. </li> </ul> <h2 id="security"> Security </h2> <p> For a list of fixes related to CVEs, see the <a href="/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/"> Redis Enterprise 7.2.4-109 release notes </a> . </p> <h2 id="supported-distributions"> Supported distributions </h2> <p> The following table shows supported distributions at the time of this release. You can also find this list in <a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/"> Supported Kubernetes distributions </a> . </p> <p> <span title="Check mark icon"> ✅ </span> Supported – This distribution is supported for this version of Redis Enterprise Software for Kubernetes. </p> <p> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> Deprecated – This distribution is still supported for this version of Redis Enterprise Software for Kubernetes, but support will be removed in a future release. </p> <p> <span title="X icon"> ❌ </span> End of life – Support for this distribution ended. </p> <p> Any distribution not listed below is not supported for production workloads. </p> <table> <thead> <tr> <th> <strong> Kubernetes version </strong> </th> <th> <strong> 1.25 </strong> </th> <th> <strong> 1.26 </strong> </th> <th> <strong> 1.27 </strong> </th> <th> <strong> 1.28 </strong> </th> <th> <strong> 1.29 </strong> </th> <th> <strong> 1.30 </strong> </th> </tr> </thead> <tbody> <tr> <td> <strong> Community Kubernetes </strong> </td> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> <strong> Amazon EKS </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> </tr> <tr> <td> <strong> Azure AKS </strong> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> <strong> Google GKE </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> <strong> Rancher RKE2 </strong> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.2 </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.3 </strong> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.4 </strong> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> OpenShift version </strong> </td> <td> <strong> 4.12 </strong> </td> <td> <strong> 4.13 </strong> </td> <td> <strong> 4.14 </strong> </td> <td> <strong> 4.15 </strong> </td> <td> <strong> 4.16 </strong> </td> <td> </td> </tr> <tr> <td> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKGI version </strong> </td> <td> <strong> 1.16 </strong> </td> <td> <strong> 1.17 </strong> </td> <td> <strong> 1.18 </strong> </td> <td> <strong> 1.19 </strong> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> </tr> </tbody> </table> <h2 id="known-limitations"> Known limitations </h2> <ul> <li> <p> <strong> Missing endpoint for admission endpoint (rare) (RED-119469) </strong> Restart the operator pod. </p> </li> <li> <p> <strong> The REDB “redisVersion” field can’t be used for memcached databases(RED-119152) </strong> </p> </li> <li> <p> <strong> When modifying the database suffix for an Active-Active database, while the service-rigger is in a terminating state, the services-rigger will delete and create the ingress or route resources in a loop (RED-107687) </strong> Wait until the services rigger pod has finished to terminate it. </p> </li> <li> <p> <strong> REAADB changes might fail with "gateway timeout" errors, mostly on OpenShift (RED-103048) </strong> Retry the operation. </p> </li> <li> <p> <strong> Creating two databases with the same name directly on Redis Enterprise software will cause the service to be deleted and the database will not be available (RED-99997) </strong> Avoid duplicating database names. Database creation via K8s has validation in place to prevent this. </p> </li> <li> <p> <strong> Installing the operator bundle produces warning: <code> Warning: would violate PodSecurity "restricted: v1.24" </code> (RED-97381) </strong> Ignore the warning. This issue is documented as benign on official Red Hat documentation. </p> </li> <li> <p> <strong> RERC resources must have a unique name (RED-96302) </strong> The string "rec-name"/"rec-namespace" must be different from all other participating clusters in the Active-Active database. </p> </li> <li> <p> <strong> Admission is not blocking REAADB with <code> shardCount </code> which exceeds license quota (RED-96301) </strong> Fix the problems with the REAADB and reapply. </p> </li> <li> <p> <strong> Active-Active controller only supports global database options. Configuration specific to location is not supported (RED-86490) </strong> </p> </li> <li> <p> <strong> Active-Active setup removal might keep services or routes undeleted (RED-77752) </strong> Delete services or routes manually if you encounter this problem. </p> </li> <li> <p> <strong> <code> autoUpgrade </code> set to <code> true </code> can cause unexpected bdb upgrades when <code> redisUpgradePolicy </code> is set to <code> true </code> (RED-72351) </strong> Contact support if your deployment is impacted. </p> </li> <li> <p> <strong> Following the previous quick start guide version causes issues with creating an REDB due to unrecognized memory field name (RED-69515) </strong> The workaround is to use the newer (current) revision of Deploy Redis Enterprise Software for Kubernetes. </p> </li> <li> <p> <strong> PVC size issues when using decimal value in spec (RED-62132) </strong> Make sure you use integer values for the PVC size. </p> </li> <li> <p> <strong> REC might report error states on initial startup (RED-61707) </strong> There is no workaround at this time except to ignore the errors. </p> </li> <li> <p> <strong> Hashicorp Vault integration - no support for Gesher (RED-55080) </strong> There is no workaround for this issue. Gesher support has been deprecated. </p> </li> <li> <p> <strong> REC clusters fail to start on Kubernetes clusters with unsynchronized clocks (RED-47254) </strong> When REC clusters are deployed on Kubernetes clusters without synchronized clocks, the REC cluster does not start correctly. The fix is to use NTP to synchronize the underlying K8s nodes. </p> </li> <li> <p> <strong> Deleting an OpenShift project with an REC deployed may hang (RED-47192) </strong> When an REC cluster is deployed in a project (namespace) and has REDB resources, the REDB resources must be deleted first before the REC can be deleted. Therefore, until the REDB resources are deleted, the project deletion will hang. The fix is to delete the REDB resources first and the REC second. Then, you can delete the project. </p> </li> <li> <p> <strong> Clusters must be named 'rec' in OLM-based deployments (RED-39825) </strong> In OLM-deployed operators, the deployment of the cluster will fail if the name is not "rec". When the operator is deployed via the OLM, the security context constraints (scc) are bound to a specific service account name (namely, "rec"). The workaround is to name the cluster "rec". </p> </li> <li> <p> <strong> Readiness probe incorrect on failures (RED-39300) </strong> STS Readiness probe does not mark a node as "not ready" when running <code> rladmin status </code> on node failure. </p> </li> <li> <p> <strong> Internal DNS and Kubernetes DNS may have conflicts (RED-37462) </strong> DNS conflicts are possible between the cluster <code> mdns_server </code> and the K8s DNS. This only impacts DNS resolution from within cluster nodes for Kubernetes DNS names. </p> </li> <li> <p> <strong> K8s-based 5.4.10 clusters seem to negatively affect existing 5.4.6 clusters (RED-37233) </strong> Upgrade clusters to latest version. </p> </li> <li> <p> <strong> Node CPU usage is reported instead of pod CPU usage (RED-36884) </strong> In Kubernetes, the reported node CPU usage is the usage of the Kubernetes worker node hosting the REC pod. </p> </li> <li> <p> <strong> An unreachable cluster has status running (RED-32805) </strong> When a cluster is in an unreachable state, the state remains <code> running </code> instead of triggering an error. </p> </li> <li> <p> <strong> Long cluster names cause routes to be rejected (RED-25871) </strong> A cluster name longer than 20 characters will result in a rejected route configuration because the host part of the domain name exceeds 63 characters. The workaround is to limit the cluster name to 20 characters or fewer. </p> </li> <li> <p> <strong> Cluster CR (REC) errors are not reported after invalid updates (RED-25542) </strong> A cluster CR specification error is not reported if two or more invalid CR resources are updated in sequence. </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/release-notes/7-4-6-releases/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/reference/redis_enterprise_active_active_database_api/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisEnterpriseActiveActiveDatabase API Reference </h1> <p> apiVersion: </p> <ul> <li> <a href="#appredislabscomv1alpha1"> app.redislabs.com/v1alpha1 </a> </li> </ul> <h1 id="appredislabscomv1alpha1"> app.redislabs.com/v1alpha1 </h1> <p> RedisEnterpriseActiveActiveDatabase is the Schema for the redisenterpriseactiveactivedatabase API </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> apiVersion </td> <td> string </td> <td> app.redislabs.com/v1alpha1 </td> <td> true </td> </tr> <tr> <td> kind </td> <td> string </td> <td> RedisEnterpriseActiveActiveDatabase </td> <td> true </td> </tr> <tr> <td> <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta"> metadata </a> </td> <td> object </td> <td> Refer to the Kubernetes API documentation for the fields of the `metadata` field. </td> <td> true </td> </tr> <tr> <td> <a href="#spec"> spec </a> </td> <td> object </td> <td> RedisEnterpriseActiveActiveDatabaseSpec defines the desired state of RedisEnterpriseActiveActiveDatabase <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#status"> status </a> </td> <td> object </td> <td> RedisEnterpriseActiveActiveDatabaseStatus defines the observed state of RedisEnterpriseActiveActiveDatabase <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="spec"> spec </h3> <p> <sup> <sup> <a href="#"> ↩ Parent </a> </sup> </sup> </p> <p> RedisEnterpriseActiveActiveDatabaseSpec defines the desired state of RedisEnterpriseActiveActiveDatabase </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specparticipatingclusters"> participatingClusters </a> </td> <td> []object </td> <td> The list of instances/ clusters specifications and configurations. <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specglobalconfigurations"> globalConfigurations </a> </td> <td> object </td> <td> The Active-Active database global configurations, contains the global properties for each of the participating clusters/ instances databases within the Active-Active database. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterprisecluster"> redisEnterpriseCluster </a> </td> <td> object </td> <td> Connection to Redis Enterprise Cluster <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specparticipatingclusters"> spec.participatingClusters[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> The name of the remote cluster CR to link. <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurations"> spec.globalConfigurations </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> The Active-Active database global configurations, contains the global properties for each of the participating clusters/ instances databases within the Active-Active database. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specglobalconfigurationsactiveactive"> activeActive </a> </td> <td> object </td> <td> Connection/ association to the Active-Active database. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettings"> alertSettings </a> </td> <td> object </td> <td> Settings for database alerts <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsbackup"> backup </a> </td> <td> object </td> <td> Target for automatic database backups. <br/> </td> <td> false </td> </tr> <tr> <td> clientAuthenticationCertificates </td> <td> []string </td> <td> The Secrets containing TLS Client Certificate to use for Authentication <br/> </td> <td> false </td> </tr> <tr> <td> dataInternodeEncryption </td> <td> boolean </td> <td> Internode encryption (INE) setting. An optional boolean setting, overriding a similar cluster-wide policy. If set to False, INE is guaranteed to be turned off for this DB (regardless of cluster-wide policy). If set to True, INE will be turned on, unless the capability is not supported by the DB ( in such a case we will get an error and database creation will fail). If left unspecified, will be disabled if internode encryption is not supported by the DB (regardless of cluster default). Deleting this property after explicitly setting its value shall have no effect. <br/> </td> <td> false </td> </tr> <tr> <td> databasePort </td> <td> integer </td> <td> Database port number. TCP port on which the database is available. Will be generated automatically if omitted. can not be changed after creation <br/> </td> <td> false </td> </tr> <tr> <td> databaseSecretName </td> <td> string </td> <td> The name of the secret that holds the password to the database (redis databases only). If secret does not exist, it will be created. To define the password, create an opaque secret and set the name in the spec. The password will be taken from the value of the 'password' key. Use an empty string as value within the secret to disable authentication for the database. Notes - For Active-Active databases this secret will not be automatically created, and also, memcached databases must not be set with a value, and a secret/password will not be automatically created for them. Use the memcachedSaslSecretName field to set authentication parameters for memcached databases. <br/> </td> <td> false </td> </tr> <tr> <td> defaultUser </td> <td> boolean </td> <td> Is connecting with a default user allowed? If disabled, the DatabaseSecret will not be created or updated <br/> </td> <td> false </td> </tr> <tr> <td> evictionPolicy </td> <td> string </td> <td> Database eviction policy. see more https://docs.redislabs.com/latest/rs/administering/database-operations/eviction-policy/ <br/> </td> <td> false </td> </tr> <tr> <td> isRof </td> <td> boolean </td> <td> Whether it is an RoF database or not. Applicable only for databases of type "REDIS". Assumed to be false if left blank. <br/> </td> <td> false </td> </tr> <tr> <td> memcachedSaslSecretName </td> <td> string </td> <td> Credentials used for binary authentication in memcached databases. The credentials should be saved as an opaque secret and the name of that secret should be configured using this field. For username, use 'username' as the key and the actual username as the value. For password, use 'password' as the key and the actual password as the value. Note that connections are not encrypted. <br/> </td> <td> false </td> </tr> <tr> <td> memorySize </td> <td> string </td> <td> memory size of database. use formats like 100MB, 0.1GB. minimum value in 100MB. When redis on flash (RoF) is enabled, this value refers to RAM+Flash memory, and it must not be below 1GB. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsmoduleslist"> modulesList </a> </td> <td> []object </td> <td> List of modules associated with database. Note - For Active-Active databases this feature is currently in preview. For this feature to take effect for Active-Active databases, set a boolean environment variable with the name "ENABLE_ALPHA_FEATURES" to True. This variable can be set via the redis-enterprise-operator pod spec, or through the operator-environment-config Config Map. <br/> </td> <td> false </td> </tr> <tr> <td> ossCluster </td> <td> boolean </td> <td> OSS Cluster mode option. Note that not all client libraries support OSS cluster mode. <br/> </td> <td> false </td> </tr> <tr> <td> persistence </td> <td> enum </td> <td> Database on-disk persistence policy <br/> <br/> <i> Enum </i> : disabled, aofEverySecond, aofAlways, snapshotEvery1Hour, snapshotEvery6Hour, snapshotEvery12Hour <br/> </td> <td> false </td> </tr> <tr> <td> proxyPolicy </td> <td> string </td> <td> The policy used for proxy binding to the endpoint. Supported proxy policies are: single/all-master-shards/all-nodes When left blank, the default value will be chosen according to the value of ossCluster - single if disabled, all-master-shards when enabled <br/> </td> <td> false </td> </tr> <tr> <td> rackAware </td> <td> boolean </td> <td> Whether database should be rack aware. This improves availability - more information: https://docs.redislabs.com/latest/rs/concepts/high-availability/rack-zone-awareness/ <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsredisenterprisecluster"> redisEnterpriseCluster </a> </td> <td> object </td> <td> Connection to Redis Enterprise Cluster <br/> </td> <td> false </td> </tr> <tr> <td> redisVersion </td> <td> string </td> <td> Redis OSS version. Version can be specified via <major.minor> prefix, or via channels - for existing databases - Upgrade Redis OSS version. For new databases - the version which the database will be created with. If set to 'major' - will always upgrade to the most recent major Redis version. If set to 'latest' - will always upgrade to the most recent Redis version. Depends on 'redisUpgradePolicy' - if you want to set the value to 'latest' for some databases, you must set redisUpgradePolicy on the cluster before. Possible values are 'major' or 'latest' When using upgrade - make sure to backup the database before. This value is used only for database type 'redis' <br/> </major.minor> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsreplicasources"> replicaSources </a> </td> <td> []object </td> <td> What databases to replicate from <br/> </td> <td> false </td> </tr> <tr> <td> replication </td> <td> boolean </td> <td> In-memory database replication. When enabled, database will have replica shard for every master - leading to higher availability. Defaults to false. <br/> </td> <td> false </td> </tr> <tr> <td> resp3 </td> <td> boolean </td> <td> Whether this database supports RESP3 protocol. Note - Deleting this property after explicitly setting its value shall have no effect. Please view the corresponding field in RS doc for more info. <br/> </td> <td> false </td> </tr> <tr> <td> rofRamSize </td> <td> string </td> <td> The size of the RAM portion of an RoF database. Similarly to "memorySize" use formats like 100MB, 0.1GB It must be at least 10% of combined memory size (RAM+Flash), as specified by "memorySize". <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsrolespermissions"> rolesPermissions </a> </td> <td> []object </td> <td> List of Redis Enteprise ACL and Role bindings to apply <br/> </td> <td> false </td> </tr> <tr> <td> shardCount </td> <td> integer </td> <td> Number of database server-side shards <br/> </td> <td> false </td> </tr> <tr> <td> shardingEnabled </td> <td> boolean </td> <td> Toggles database sharding for REAADBs (Active Active databases) and enabled by default. This field is blocked for REDB (non-Active Active databases) and sharding is toggled via the shardCount field - when shardCount is 1 this is disabled otherwise enabled. <br/> </td> <td> false </td> </tr> <tr> <td> shardsPlacement </td> <td> string </td> <td> Control the density of shards - should they reside on as few or as many nodes as possible. Available options are "dense" or "sparse". If left unset, defaults to "dense". <br/> </td> <td> false </td> </tr> <tr> <td> tlsMode </td> <td> enum </td> <td> Require SSL authenticated and encrypted connections to the database. enabled - all incoming connections to the Database must use SSL. disabled - no incoming connection to the Database should use SSL. replica_ssl - databases that replicate from this one need to use SSL. <br/> <br/> <i> Enum </i> : disabled, enabled, replica_ssl <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> enum </td> <td> The type of the database. <br/> <br/> <i> Enum </i> : redis, memcached <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsupgradespec"> upgradeSpec </a> </td> <td> object </td> <td> Specifications for DB upgrade. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsactiveactive"> spec.globalConfigurations.activeActive </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <p> Connection/ association to the Active-Active database. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> The the corresponding Active-Active database name, Redis Enterprise Active Active Database custom resource name, this Resource is associated with. In case this resource is created manually at the active active database creation this field must be filled via the user, otherwise, the operator will assign this field automatically. Note: this feature is currently unsupported. <br/> </td> <td> true </td> </tr> <tr> <td> participatingClusterName </td> <td> string </td> <td> The corresponding participating cluster name, Redis Enterprise Remote Cluster custom resource name, in the Active-Active database, In case this resource is created manually at the active active database creation this field must be filled via the user, otherwise, the operator will assign this field automatically. Note: this feature is currently unsupported. <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettings"> spec.globalConfigurations.alertSettings </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <p> Settings for database alerts </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_backup_delayed"> bdb_backup_delayed </a> </td> <td> object </td> <td> Periodic backup has been delayed for longer than specified threshold value [minutes] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_crdt_src_high_syncer_lag"> bdb_crdt_src_high_syncer_lag </a> </td> <td> object </td> <td> Active-active source - sync lag is higher than specified threshold value [seconds] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_crdt_src_syncer_connection_error"> bdb_crdt_src_syncer_connection_error </a> </td> <td> object </td> <td> Active-active source - sync has connection error while trying to connect replica source <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_crdt_src_syncer_general_error"> bdb_crdt_src_syncer_general_error </a> </td> <td> object </td> <td> Active-active source - sync encountered in general error <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_high_latency"> bdb_high_latency </a> </td> <td> object </td> <td> Latency is higher than specified threshold value [micro-sec] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_high_throughput"> bdb_high_throughput </a> </td> <td> object </td> <td> Throughput is higher than specified threshold value [requests / sec.] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_long_running_action"> bdb_long_running_action </a> </td> <td> object </td> <td> An alert for state-machines that are running for too long <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_low_throughput"> bdb_low_throughput </a> </td> <td> object </td> <td> Throughput is lower than specified threshold value [requests / sec.] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_ram_dataset_overhead"> bdb_ram_dataset_overhead </a> </td> <td> object </td> <td> Dataset RAM overhead of a shard has reached the threshold value [% of its RAM limit] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_ram_values"> bdb_ram_values </a> </td> <td> object </td> <td> Percent of values kept in a shard's RAM is lower than [% of its key count] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_replica_src_high_syncer_lag"> bdb_replica_src_high_syncer_lag </a> </td> <td> object </td> <td> Replica-of source - sync lag is higher than specified threshold value [seconds] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_replica_src_syncer_connection_error"> bdb_replica_src_syncer_connection_error </a> </td> <td> object </td> <td> Replica-of source - sync has connection error while trying to connect replica source <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_shard_num_ram_values"> bdb_shard_num_ram_values </a> </td> <td> object </td> <td> Number of values kept in a shard's RAM is lower than [values] <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsalertsettingsbdb_size"> bdb_size </a> </td> <td> object </td> <td> Dataset size has reached the threshold value [% of the memory limit] <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_backup_delayed"> spec.globalConfigurations.alertSettings.bdb_backup_delayed </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Periodic backup has been delayed for longer than specified threshold value [minutes] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_crdt_src_high_syncer_lag"> spec.globalConfigurations.alertSettings.bdb_crdt_src_high_syncer_lag </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Active-active source - sync lag is higher than specified threshold value [seconds] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_crdt_src_syncer_connection_error"> spec.globalConfigurations.alertSettings.bdb_crdt_src_syncer_connection_error </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Active-active source - sync has connection error while trying to connect replica source </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_crdt_src_syncer_general_error"> spec.globalConfigurations.alertSettings.bdb_crdt_src_syncer_general_error </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Active-active source - sync encountered in general error </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_high_latency"> spec.globalConfigurations.alertSettings.bdb_high_latency </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Latency is higher than specified threshold value [micro-sec] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_high_throughput"> spec.globalConfigurations.alertSettings.bdb_high_throughput </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Throughput is higher than specified threshold value [requests / sec.] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_long_running_action"> spec.globalConfigurations.alertSettings.bdb_long_running_action </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> An alert for state-machines that are running for too long </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_low_throughput"> spec.globalConfigurations.alertSettings.bdb_low_throughput </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Throughput is lower than specified threshold value [requests / sec.] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_ram_dataset_overhead"> spec.globalConfigurations.alertSettings.bdb_ram_dataset_overhead </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Dataset RAM overhead of a shard has reached the threshold value [% of its RAM limit] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_ram_values"> spec.globalConfigurations.alertSettings.bdb_ram_values </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Percent of values kept in a shard's RAM is lower than [% of its key count] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_replica_src_high_syncer_lag"> spec.globalConfigurations.alertSettings.bdb_replica_src_high_syncer_lag </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Replica-of source - sync lag is higher than specified threshold value [seconds] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_replica_src_syncer_connection_error"> spec.globalConfigurations.alertSettings.bdb_replica_src_syncer_connection_error </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Replica-of source - sync has connection error while trying to connect replica source </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_shard_num_ram_values"> spec.globalConfigurations.alertSettings.bdb_shard_num_ram_values </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Number of values kept in a shard's RAM is lower than [values] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsalertsettingsbdb_size"> spec.globalConfigurations.alertSettings.bdb_size </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Dataset size has reached the threshold value [% of the memory limit] </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Alert enabled or disabled <br/> </td> <td> true </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackup"> spec.globalConfigurations.backup </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <p> Target for automatic database backups. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specglobalconfigurationsbackupabs"> abs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsbackupftp"> ftp </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsbackupgcs"> gcs </a> </td> <td> object </td> <td> GoogleStorage <br/> </td> <td> false </td> </tr> <tr> <td> interval </td> <td> integer </td> <td> Backup Interval in seconds <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsbackupmount"> mount </a> </td> <td> object </td> <td> MountPointStorage <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsbackups3"> s3 </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsbackupsftp"> sftp </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specglobalconfigurationsbackupswift"> swift </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackupabs"> spec.globalConfigurations.backup.abs </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsbackup"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> absSecretName </td> <td> string </td> <td> The name of the secret that holds ABS credentials. The secret must contain the keys "AccountName" and "AccountKey", and these must hold the corresponding credentials <br/> </td> <td> true </td> </tr> <tr> <td> container </td> <td> string </td> <td> Azure Blob Storage container name. <br/> </td> <td> true </td> </tr> <tr> <td> subdir </td> <td> string </td> <td> Optional. Azure Blob Storage subdir under container. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackupftp"> spec.globalConfigurations.backup.ftp </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsbackup"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> url </td> <td> string </td> <td> a URI of the "ftps://[USER[:PASSWORD]@]HOST[:PORT]/PATH[/]" format <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackupgcs"> spec.globalConfigurations.backup.gcs </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsbackup"> ↩ Parent </a> </sup> </sup> </p> <p> GoogleStorage </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> bucketName </td> <td> string </td> <td> Google Storage bucket name. <br/> </td> <td> true </td> </tr> <tr> <td> gcsSecretName </td> <td> string </td> <td> The name of the secret that holds the Google Cloud Storage credentials. The secret must contain the keys "CLIENT_ID", "PRIVATE_KEY", "PRIVATE_KEY_ID", "CLIENT_EMAIL" and these must hold the corresponding credentials. The keys should correspond to the values in the key JSON. <br/> </td> <td> true </td> </tr> <tr> <td> subdir </td> <td> string </td> <td> Optional. Google Storage subdir under bucket. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackupmount"> spec.globalConfigurations.backup.mount </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsbackup"> ↩ Parent </a> </sup> </sup> </p> <p> MountPointStorage </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> Path to the local mount point. You must create the mount point on all nodes, and the redislabs:redislabs user must have read and write permissions on the local mount point. <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackups3"> spec.globalConfigurations.backup.s3 </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsbackup"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> awsSecretName </td> <td> string </td> <td> The name of the secret that holds the AWS credentials. The secret must contain the keys "AWS_ACCESS_KEY_ID" and "AWS_SECRET_ACCESS_KEY", and these must hold the corresponding credentials. <br/> </td> <td> true </td> </tr> <tr> <td> bucketName </td> <td> string </td> <td> Amazon S3 bucket name. <br/> </td> <td> true </td> </tr> <tr> <td> subdir </td> <td> string </td> <td> Optional. Amazon S3 subdir under bucket. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackupsftp"> spec.globalConfigurations.backup.sftp </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsbackup"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> sftpSecretName </td> <td> string </td> <td> The name of the secret that holds SFTP credentials. The secret must contain the "Key" key, which is the SSH private key for connecting to the sftp server. <br/> </td> <td> true </td> </tr> <tr> <td> sftp_url </td> <td> string </td> <td> SFTP url <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsbackupswift"> spec.globalConfigurations.backup.swift </h3> <p> <sup> <sup> <a href="#specglobalconfigurationsbackup"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> auth_url </td> <td> string </td> <td> Swift service authentication URL. <br/> </td> <td> true </td> </tr> <tr> <td> container </td> <td> string </td> <td> Swift object store container for storing the backup files. <br/> </td> <td> true </td> </tr> <tr> <td> swiftSecretName </td> <td> string </td> <td> The name of the secret that holds Swift credentials. The secret must contain the keys "Key" and "User", and these must hold the corresponding credentials: service access key and service user name (pattern for the latter does not allow special characters &amp;,&lt;,&gt;,") <br/> </td> <td> true </td> </tr> <tr> <td> prefix </td> <td> string </td> <td> Optional. Prefix (path) of backup files in the swift container. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsmoduleslist"> spec.globalConfigurations.modulesList[] </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <p> Redis Enterprise Module: <a href="https://redislabs.com/redis-enterprise/modules/"> https://redislabs.com/redis-enterprise/modules/ </a> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> The module's name e.g "ft" for redissearch <br/> </td> <td> true </td> </tr> <tr> <td> config </td> <td> string </td> <td> Module command line arguments e.g. VKEY_MAX_ENTITY_COUNT 30 <br/> </td> <td> false </td> </tr> <tr> <td> uid </td> <td> string </td> <td> Module's uid - do not set, for system use only nolint:staticcheck // custom json tag unknown to the linter <br/> </td> <td> false </td> </tr> <tr> <td> version </td> <td> string </td> <td> Module's semantic version e.g "1.6.12" - optional only in REDB, must be set in REAADB <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsredisenterprisecluster"> spec.globalConfigurations.redisEnterpriseCluster </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <p> Connection to Redis Enterprise Cluster </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> The name of the Redis Enterprise Cluster where the database should be stored. <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsreplicasources"> spec.globalConfigurations.replicaSources[] </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> replicaSourceName </td> <td> string </td> <td> The name of the resource from which the source database URI is derived. The type of resource must match the type specified in the ReplicaSourceType field. <br/> </td> <td> true </td> </tr> <tr> <td> replicaSourceType </td> <td> string </td> <td> The type of resource from which the source database URI is derived. If set to 'SECRET', the source database URI is derived from the secret named in the ReplicaSourceName field. The secret must have a key named 'uri' that defines the URI of the source database in the form of 'redis://...'. The type of secret (kubernetes, vault, ...) is determined by the secret mechanism used by the underlying REC object. If set to 'REDB', the source database URI is derived from the RedisEnterpriseDatabase resource named in the ReplicaSourceName field. <br/> </td> <td> true </td> </tr> <tr> <td> clientKeySecret </td> <td> string </td> <td> Secret that defines the client certificate and key used by the syncer in the target database cluster. The secret must have 2 keys in its map: "cert" which is the PEM encoded certificate, and "key" which is the PEM encoded private key. <br/> </td> <td> false </td> </tr> <tr> <td> compression </td> <td> integer </td> <td> GZIP compression level (0-6) to use for replication. <br/> </td> <td> false </td> </tr> <tr> <td> serverCertSecret </td> <td> string </td> <td> Secret that defines the server certificate used by the proxy in the source database cluster. The secret must have 1 key in its map: "cert" which is the PEM encoded certificate. <br/> </td> <td> false </td> </tr> <tr> <td> tlsSniName </td> <td> string </td> <td> TLS SNI name to use for the replication link. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsrolespermissions"> spec.globalConfigurations.rolesPermissions[] </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <p> Redis Enterprise Role and ACL Binding </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> acl </td> <td> string </td> <td> Acl Name of RolePermissionType (note: use exact name of the ACL from the Redis Enterprise ACL list, case sensitive) <br/> </td> <td> true </td> </tr> <tr> <td> role </td> <td> string </td> <td> Role Name of RolePermissionType (note: use exact name of the role from the Redis Enterprise role list, case sensitive) <br/> </td> <td> true </td> </tr> <tr> <td> type </td> <td> string </td> <td> Type of Redis Enterprise Database Role Permission <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specglobalconfigurationsupgradespec"> spec.globalConfigurations.upgradeSpec </h3> <p> <sup> <sup> <a href="#specglobalconfigurations"> ↩ Parent </a> </sup> </sup> </p> <p> Specifications for DB upgrade. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> upgradeModulesToLatest </td> <td> boolean </td> <td> Upgrades the modules to the latest version that supportes the DB version during a DB upgrade action, to upgrade the DB version view the 'redisVersion' field. Note - This field is currently not supported for Active-Active databases. <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterprisecluster"> spec.redisEnterpriseCluster </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Connection to Redis Enterprise Cluster </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> The name of the Redis Enterprise Cluster where the database should be stored. <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="status"> status </h3> <p> <sup> <sup> <a href="#"> ↩ Parent </a> </sup> </sup> </p> <p> RedisEnterpriseActiveActiveDatabaseStatus defines the observed state of RedisEnterpriseActiveActiveDatabase </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> guid </td> <td> string </td> <td> The active-active database corresponding GUID. <br/> </td> <td> false </td> </tr> <tr> <td> lastTaskUid </td> <td> string </td> <td> The last active-active database task UID. <br/> </td> <td> false </td> </tr> <tr> <td> linkedRedbs </td> <td> []string </td> <td> The linked REDBs. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statusparticipatingclusters"> participatingClusters </a> </td> <td> []object </td> <td> The list of instances/ clusters statuses. <br/> </td> <td> false </td> </tr> <tr> <td> redisEnterpriseCluster </td> <td> string </td> <td> The Redis Enterprise Cluster Object this Resource is associated with <br/> </td> <td> false </td> </tr> <tr> <td> replicationStatus </td> <td> enum </td> <td> The overall replication status <br/> <br/> <i> Enum </i> : up, down <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statussecretsstatus"> secretsStatus </a> </td> <td> []object </td> <td> The status of the secrets <br/> </td> <td> false </td> </tr> <tr> <td> specStatus </td> <td> string </td> <td> Whether the desired specification is valid <br/> </td> <td> false </td> </tr> <tr> <td> status </td> <td> string </td> <td> The status of the active active database. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusparticipatingclusters"> status.participatingClusters[] </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <p> Status of participating cluster. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> The name of the remote cluster CR that is linked. <br/> </td> <td> true </td> </tr> <tr> <td> id </td> <td> integer </td> <td> The corresponding ID of the instance in the active-active database. <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> replicationStatus </td> <td> enum </td> <td> The replication status of the participating cluster <br/> <br/> <i> Enum </i> : up, down <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statussecretsstatus"> status.secretsStatus[] </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <p> Status of secrets. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> The name of the secret. <br/> </td> <td> true </td> </tr> <tr> <td> status </td> <td> enum </td> <td> The status of the secret. <br/> <br/> <i> Enum </i> : Valid, Invalid <br/> </td> <td> false </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/reference/redis_enterprise_active_active_database_api/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/sinterstore/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SINTERSTORE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SINTERSTORE destination key [key ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @set </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This command is equal to <a href="/docs/latest/commands/sinter/"> <code> SINTER </code> </a> , but instead of returning the resulting set, it is stored in <code> destination </code> . </p> <p> If <code> destination </code> already exists, it is overwritten. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; SADD key1 "a" (integer) 1 redis&gt; SADD key1 "b" (integer) 1 redis&gt; SADD key1 "c" (integer) 1 redis&gt; SADD key2 "c" (integer) 1 redis&gt; SADD key2 "d" (integer) 1 redis&gt; SADD key2 "e" (integer) 1 redis&gt; SINTERSTORE key key1 key2 (integer) 1 redis&gt; SMEMBERS key 1) "c" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2-reply"> RESP2 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the number of elements in the resulting set. <h2 id="resp3-reply"> RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the number of elements in the result set. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/sinterstore/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/stream_triggers/.html
<section class="prose w-full py-12 max-w-none"> <h1> Stream triggers </h1> <p class="text-lg -mt-5 mb-10"> Execute a JavaScript function when an item is added to a stream </p> <div class="banner-article rounded-md"> <p> The Redis Stack triggers and functions feature preview has ended and it will not be promoted to GA. </p> </div> <p> Redis Stack's triggers and functions feature comes with a full stream API to process data from <a href="/docs/latest/develop/data-types/streams/"> Redis streams </a> . Unlike RedisGears v1 that provided a micro batching API, the new triggers and functions feature provides a <strong> real streaming </strong> API, which means that the data will be processed as soon as it enters the stream. </p> <h2 id="register-a-stream-consumer"> Register a stream consumer </h2> <p> Triggers and functions provide an API that allows to register a stream trigger. Do not get confused with <a href="/docs/latest/develop/data-types/streams#consumer-groups"> Redis streams consumer groups </a> , triggers and functions uses the Redis Module API to efficiently read the stream and manage its consumers. This approach gives a much better performance as there is no need to invoke any Redis commands in order to read from the stream. Lets see a simple example: </p> <div class="highlight"> <pre class="chroma"><code class="language-js" data-lang="js"><span class="line"><span class="cl"><span class="err">#</span><span class="o">!</span><span class="nx">js</span> <span class="nx">api_version</span><span class="o">=</span><span class="mf">1.0</span> <span class="nx">name</span><span class="o">=</span><span class="nx">myFirstLibrary</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">redis</span><span class="p">.</span><span class="nx">registerStreamTrigger</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"consumer"</span><span class="p">,</span> <span class="c1">// consumer name </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="s2">"stream"</span><span class="p">,</span> <span class="c1">// streams prefix </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="kd">function</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">data</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="c1">// callback to run on each element added to the stream </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">redis</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="p">(</span><span class="nx">key</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> <span class="p">=&gt;</span> </span></span><span class="line"><span class="cl"> <span class="k">typeof</span> <span class="nx">value</span> <span class="o">===</span> <span class="s1">'bigint'</span> </span></span><span class="line"><span class="cl"> <span class="o">?</span> <span class="nx">value</span><span class="p">.</span><span class="nx">toString</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="o">:</span> <span class="nx">value</span> <span class="c1">// return everything else unchanged </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">));</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">);</span> </span></span></code></pre> </div> <p> Argument Description: </p> <ul> <li> consumer - the consumer name. </li> <li> stream - streams name prefix on which to trigger the callback. </li> <li> callback - the callback to invoke on each element in the stream. Following the same rules of <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/sync_async/"> sync and async invocation </a> . The callback will be invoke only on primary shard. </li> </ul> <p> If we register this library (see the <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/quick_start_cli/"> quick start </a> section to learn how to Register a RedisGears function) and run the following command on our Redis: </p> <pre tabindex="0"><code>XADD stream:1 * foo1 bar1 XADD stream:1 * foo2 bar2 XADD stream:2 * foo1 bar1 XADD stream:2 * foo2 bar2 </code></pre> <p> We will see the following line on the Redis log file: </p> <pre tabindex="0"><code>2630021:M 05 Jul 2022 17:13:22.506 * &lt;redisgears_2&gt; {"id":["1657030402506","0"],"stream_name":"stream:1","record":[["foo1","bar1"]]} 2630021:M 05 Jul 2022 17:13:25.323 * &lt;redisgears_2&gt; {"id":["1657030405323","0"],"stream_name":"stream:1","record":[["foo2","bar2"]]} 2630021:M 05 Jul 2022 17:13:29.475 * &lt;redisgears_2&gt; {"id":["1657030409475","0"],"stream_name":"stream:2","record":[["foo1","bar1"]]} 2630021:M 05 Jul 2022 17:13:32.715 * &lt;redisgears_2&gt; {"id":["1657030412715","0"],"stream_name":"stream:2","record":[["foo2","bar2"]]} </code></pre> <p> The <code> data </code> argument which pass to the stream consumer callback are in the following format: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"id"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"&lt;ms&gt;"</span><span class="p">,</span> <span class="s2">"&lt;seq&gt;"</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stream_name"</span><span class="p">:</span> <span class="s2">"&lt;stream name&gt;"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stream_name_raw"</span><span class="p">:</span> <span class="s2">"&lt;stream name as ArrayBuffer&gt;"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"record"</span><span class="p">:[</span> </span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="s2">"&lt;key&gt;"</span><span class="p">,</span> <span class="s2">"&lt;value&gt;"</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="err">.</span> </span></span><span class="line"><span class="cl"> <span class="err">.</span> </span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="s2">"&lt;key&gt;"</span><span class="p">,</span> <span class="s2">"&lt;value&gt;"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"record_raw"</span><span class="p">:[</span> </span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="s2">"&lt;key_raw&gt;"</span><span class="p">,</span> <span class="s2">"&lt;value_raw&gt;"</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="err">.</span> </span></span><span class="line"><span class="cl"> <span class="err">.</span> </span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="s2">"&lt;key_raw&gt;"</span><span class="p">,</span> <span class="s2">"&lt;value_raw&gt;"</span><span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">],</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> The reason why the record is a list of touples and not an object is because the Redis Stream specifications allows duplicate keys. </p> <p> Notice that <code> stream_name </code> and <code> record </code> fields might contains <code> null </code> 's if the data can not be decoded as string. the <code> *_raw </code> fields will always be provided and will contains the data as <code> JS </code> <code> ArrayBuffer </code> . </p> <p> We can observe the streams which are tracked by our registered consumer using <code> TFUNCTION LIST </code> command: </p> <pre tabindex="0"><code>127.0.0.1:6379&gt; TFUNCTION LIST LIBRARY lib vvv 1) 1) "engine" 1) "js" 2) "api_version" 3) "1.0" 4) "name" 5) "lib" 6) "pending_jobs" 7) (integer) 0 8) "user" 9) "default" 10) "functions" 1) (empty array) 2) "stream_triggers" 3) 1) 1) "name" 1) "consumer" 2) "prefix" 3) "stream" 4) "window" 5) (integer) 1 6) "trim" 7) "disabled" 8) "num_streams" 1) (integer) 2 2) "streams" 3) 1) 1) "name" 1) "stream:2" 2) "last_processed_time" 3) (integer) 0 4) "avg_processed_time" 5) "0" 6) "last_lag" 7) (integer) 0 8) "avg_lag" 1) "0" 2) "total_record_processed" 3) (integer) 2 4) "id_to_read_from" 5) "1657030412715-0" 6) "last_error" 7) "None" 17) "pending_ids" 18) (empty array) 1) 1) "name" 1) "stream:1" 2) "last_processed_time" 3) (integer) 1 4) "avg_processed_time" 5) "0.5" 6) "last_lag" 7) (integer) 1 8) "avg_lag" 1) "0.5" 2) "total_record_processed" 3) (integer) 2 4) "id_to_read_from" 5) "1657030405323-0" 6) "last_error" 7) "None" 8) "pending_ids" 9) (empty array) 4) "keyspace_triggers" 5) (empty array) </code></pre> <h2 id="enable-trimming-and-set-window"> Enable trimming and set window </h2> <p> We can enable stream trimming by adding <code> isStreamTrimmed </code> optional argument after the trigger callback, we can also set the <code> window </code> argument that controls how many elements can be processed simultaneously. example: </p> <div class="highlight"> <pre class="chroma"><code class="language-js" data-lang="js"><span class="line"><span class="cl"><span class="err">#</span><span class="o">!</span><span class="nx">js</span> <span class="nx">api_version</span><span class="o">=</span><span class="mf">1.0</span> <span class="nx">name</span><span class="o">=</span><span class="nx">myFirstLibrary</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">redis</span><span class="p">.</span><span class="nx">registerStreamTrigger</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s2">"consumer"</span><span class="p">,</span> <span class="c1">// consumer name </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="s2">"stream"</span><span class="p">,</span> <span class="c1">// streams prefix </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="kd">function</span><span class="p">(</span><span class="nx">c</span><span class="p">,</span> <span class="nx">data</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="c1">// callback to run on each element added to the stream </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">redis</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="p">(</span><span class="nx">key</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> <span class="p">=&gt;</span> </span></span><span class="line"><span class="cl"> <span class="k">typeof</span> <span class="nx">value</span> <span class="o">===</span> <span class="s1">'bigint'</span> </span></span><span class="line"><span class="cl"> <span class="o">?</span> <span class="nx">value</span><span class="p">.</span><span class="nx">toString</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="o">:</span> <span class="nx">value</span> <span class="c1">// return everything else unchanged </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">));</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">isStreamTrimmed</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nb">window</span><span class="o">:</span> <span class="mi">3</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">);</span> </span></span></code></pre> </div> <p> The default values are: </p> <ul> <li> <code> isStreamTrimmed </code> - <code> false </code> </li> <li> <code> window </code> - 1 </li> </ul> <p> It is enough that a single consumer will enable trimming so that the stream will be trimmed. The stream will be trim according to the slowest consumer that consume the stream at a given time (even if this is not the consumer that enabled the trimming). Raising exception during the callback invocation will <strong> not prevent the trimming </strong> . The callback should decide how to handle failures by invoke a retry or write some error log. The error will be added to the <code> last_error </code> field on <code> TFUNCTION LIST </code> command. </p> <h2 id="data-processing-guarantees"> Data processing guarantees </h2> <p> As long as the primary shard is up and running we guarantee exactly once property (the callback will be triggered exactly one time on each element in the stream). In case of failure such as shard crashing, we guarantee at least once property (the callback will be triggered at least one time on each element in the stream) </p> <h2 id="upgrades"> Upgrades </h2> <p> When upgrading the consumer code (using the <code> REPLACE </code> option of <code> TFUNCTION LOAD </code> command) the following consumer parameters can be updated: </p> <ul> <li> Window </li> <li> Trimming </li> </ul> <p> Any attempt to update any other parameter will result in an error when loading the library. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/stream_triggers/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/limits/.html
<section class="prose w-full py-12 max-w-none"> <h1> Limits object </h1> <p class="text-lg -mt-5 mb-10"> Documents the limits object used with Redis Enterprise Software REST API calls. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> max_listeners </td> <td> integer (default: 100) </td> <td> Max allowed listeners on node </td> </tr> <tr> <td> max_redis_servers </td> <td> integer (default: 100) </td> <td> Max allowed Redis servers on node </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/limits/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/json.arrindex/.html
<section class="prose w-full py-12"> <h1 class="command-name"> JSON.ARRINDEX </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">JSON.ARRINDEX key path value [start [stop]]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/json"> JSON 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key </dd> </dl> <p> Search for the first occurrence of a JSON value in an array </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key to parse. </p> </details> <details open=""> <summary> <code> path </code> </summary> <p> is JSONPath to specify. </p> </details> <details open=""> <summary> <code> value </code> </summary> <p> is value to find its index in one or more arrays. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> About using strings with JSON commands: </div> To specify a string as an array value to index, wrap the quoted string with an additional set of single quotes. Example: <code> '"silver"' </code> . For more detailed use, see <a href="#examples"> Examples </a> . </div> </div> </details> <h2 id="optional-arguments"> Optional arguments </h2> <details open=""> <summary> <code> start </code> </summary> <p> is inclusive start value to specify in a slice of the array to search. Default is <code> 0 </code> . </p> </details> <details open=""> <summary> <code> stop </code> </summary> <p> is exclusive stop value to specify in a slice of the array to search, including the last element. Default is <code> 0 </code> . Negative values are interpreted as starting from the end. </p> </details> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> About out-of-range indexes: </div> Out-of-range indexes round to the array's start and end. An inverse index range (such as the range from 1 to 0) returns unfound or <code> -1 </code> . </div> </div> <h2 id="return-value"> Return value </h2> <p> <code> JSON.ARRINDEX </code> returns an <a href="/docs/latest/develop/reference/protocol-spec#resp-arrays"> array </a> of integer replies for each path, the first position in the array of each JSON value that matches the path, <code> -1 </code> if unfound in the array, or <code> nil </code> , if the matching JSON value is not an array. For more information about replies, see <a href="/docs/latest/develop/reference/protocol-spec/"> Redis serialization protocol specification </a> . </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Find the specific place of a color in a list of product colors </b> </summary> <p> Create a document for noise-cancelling headphones in black and silver colors. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.SET item:1 $ <span class="s1">'{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"]}'</span> </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> Add color <code> blue </code> to the end of the <code> colors </code> array. <code> JSON.ARRAPEND </code> returns the array's new size. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.ARRAPPEND item:1 $.colors <span class="s1">'"blue"'</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3</span></span></span></code></pre> </div> <p> Return the new length of the <code> colors </code> array. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.GET item:1 </span></span><span class="line"><span class="cl"><span class="s2">"{\"name\":\"Noise-cancelling Bluetooth headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\",\"blue\"]}"</span></span></span></code></pre> </div> <p> Get the list of colors for the product. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.GET item:1 <span class="s1">'$.colors[*]'</span> </span></span><span class="line"><span class="cl"><span class="s2">"[\"black\",\"silver\",\"blue\"]"</span></span></span></code></pre> </div> <p> Insert two more colors after the second color. You now have five colors. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.ARRINSERT item:1 $.colors <span class="m">2</span> <span class="s1">'"yellow"'</span> <span class="s1">'"gold"'</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">5</span></span></span></code></pre> </div> <p> Get the updated list of colors. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.GET item:1 $.colors </span></span><span class="line"><span class="cl"><span class="s2">"[[\"black\",\"silver\",\"yellow\",\"gold\",\"blue\"]]"</span></span></span></code></pre> </div> <p> Find the place where color <code> silver </code> is located. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.ARRINDEX item:1 $..colors <span class="s1">'"silver"'</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/json.arrappend/"> <code> JSON.ARRAPPEND </code> </a> | <a href="/docs/latest/commands/json.arrinsert/"> <code> JSON.ARRINSERT </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <ul> <li> <a href="/docs/latest/develop/data-types/json/"> RedisJSON </a> </li> <li> <a href="/docs/latest/develop/interact/search-and-query/indexing/"> Index and search JSON documents </a> </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/json.arrindex/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/prometheus-with-redis-enterprise/prometheus-metrics-v1-to-v2/.html
<section class="prose w-full py-12 max-w-none"> <h1> Transition from Prometheus v1 to Prometheus v2 </h1> <p class="text-lg -mt-5 mb-10"> Transition from v1 metrics to v2 PromQL equivalents. </p> <p> You can <a href="/docs/latest/integrate/prometheus-with-redis-enterprise/"> integrate Redis Enterprise Software with Prometheus and Grafana </a> to create dashboards for important metrics. </p> <p> As of Redis Enterprise Software version 7.8.2, <a href="https://prometheus.io/docs/prometheus/latest/querying/basics/"> PromQL (Prometheus Query Language) </a> metrics are available, and v1 metrics are deprecated. You can use the following tables to transition from v1 metrics to equivalent v2 PromQL. For a list of all available v2 PromQL metrics, see <a href="/docs/latest/integrate/prometheus-with-redis-enterprise/prometheus-metrics-definitions/"> Prometheus metrics v2 </a> . </p> <h2 id="database-metrics"> Database metrics </h2> <table> <thead> <tr> <th> V1 metric </th> <th style="text-align:left"> Equivalent V2 PromQL </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td> <span class="break-all"> bdb_avg_latency </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_acc_latency[1m])) / sum by (bdb) (irate(endpoint_total_started_res[1m])) / 1000000 </code> </span> </td> <td style="text-align:left"> Average latency of operations on the database (seconds); returned only when there is traffic </td> </tr> <tr> <td> <span class="break-all"> bdb_avg_latency_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_acc_latency[1m])) / sum by (bdb) (irate(endpoint_total_started_res[1m])) / 1000000 </code> </span> </td> <td style="text-align:left"> Highest value of average latency of operations on the database (seconds); returned only when there is traffic </td> </tr> <tr> <td> <span class="break-all"> bdb_avg_read_latency </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_acc_read_latency[1m])) / sum by (bdb) (irate(endpoint_total_started_res[1m])) / 1000000 </code> </span> </td> <td style="text-align:left"> Average latency of read operations (seconds); returned only when there is traffic </td> </tr> <tr> <td> <span class="break-all"> bdb_avg_read_latency_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_acc_read_latency[1m])) / sum by (bdb) (irate(endpoint_total_started_res[1m])) / 1000000 </code> </span> </td> <td style="text-align:left"> Highest value of average latency of read operations (seconds); returned only when there is traffic </td> </tr> <tr> <td> <span class="break-all"> bdb_avg_write_latency </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_acc_write_latency[1m])) / sum by (bdb) (irate(endpoint_total_started_res[1m])) / 1000000 </code> </span> </td> <td style="text-align:left"> Average latency of write operations (seconds); returned only when there is traffic </td> </tr> <tr> <td> <span class="break-all"> bdb_avg_write_latency_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_acc_write_latency[1m])) / sum by (bdb) (irate(endpoint_total_started_res[1m])) / 1000000 </code> </span> </td> <td style="text-align:left"> Highest value of average latency of write operations (seconds); returned only when there is traffic </td> </tr> <tr> <td> <span class="break-all"> bdb_bigstore_shard_count </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum((sum(label_replace(label_replace(namedprocess_namegroup_thread_count{groupname=~"redis-\d+", threadname=~"(speedb|rocksdb).*"}, "redis", "$1", "groupname", "redis-(\d+)"), "driver", "$1", "threadname", "(speedb|rocksdb).*")) by (redis, driver) &gt; bool 0) * on (redis) group_left(bdb) redis_server_up) by (bdb, driver) </code> </span> </td> <td style="text-align:left"> Shard count by database and by storage engine (driver - rocksdb / speedb); Only for databases with Auto Tiering enabled </td> </tr> <tr> <td> <span class="break-all"> bdb_conns </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (endpoint_conns) </code> </span> </td> <td style="text-align:left"> Number of client connections to database </td> </tr> <tr> <td> <span class="break-all"> bdb_egress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_egress_bytes[1m])) </code> </span> </td> <td style="text-align:left"> Rate of outgoing network traffic from the database (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_egress_bytes_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_egress_bytes[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of outgoing network traffic from the database (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_evicted_objects </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_evicted_keys{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Rate of key evictions from database (evictions/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_evicted_objects_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_evicted_keys{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of key evictions from database (evictions/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_expired_objects </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_expired_keys{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Rate keys expired in database (expirations/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_expired_objects_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_expired_keys{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate keys expired in database (expirations/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_fork_cpu_system </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="system"}[1m])) </code> </span> </td> <td style="text-align:left"> % cores utilization in system mode for all Redis shard fork child processes of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_fork_cpu_system_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="system"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of % cores utilization in system mode for all Redis shard fork child processes of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_fork_cpu_user </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="user"}[1m])) </code> </span> </td> <td style="text-align:left"> % cores utilization in user mode for all Redis shard fork child processes of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_fork_cpu_user_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="user"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of % cores utilization in user mode for all Redis shard fork child processes of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_ingress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_ingress_bytes[1m])) </code> </span> </td> <td style="text-align:left"> Rate of incoming network traffic to database (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_ingress_bytes_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_ingress_bytes[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of incoming network traffic to database (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_instantaneous_ops_per_sec </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_instantaneous_ops_per_sec) </code> </span> </td> <td style="text-align:left"> Request rate handled by all shards of database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_main_thread_cpu_system </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="system", threadname=~"redis-server.*"}[1m])) </code> </span> </td> <td style="text-align:left"> % cores utilization in system mode for all Redis shard main threads of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_main_thread_cpu_system_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="system", threadname=~"redis-server.*"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of % cores utilization in system mode for all Redis shard main threads of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_main_thread_cpu_user </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="user", threadname=~"redis-server.*"}[1m])) </code> </span> </td> <td style="text-align:left"> % cores utilization in user mode for all Redis shard main threads of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_main_thread_cpu_user_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="user", threadname=~"redis-server.*"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of % cores utilization in user mode for all Redis shard main threads of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_mem_frag_ratio </span> </td> <td style="text-align:left"> <span class="break-all"> <code> avg(redis_server_mem_fragmentation_ratio) </code> </span> </td> <td style="text-align:left"> RAM fragmentation ratio (RSS / allocated RAM) </td> </tr> <tr> <td> <span class="break-all"> bdb_mem_size_lua </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_used_memory_lua) </code> </span> </td> <td style="text-align:left"> Redis lua scripting heap size (bytes) </td> </tr> <tr> <td> <span class="break-all"> bdb_memory_limit </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_maxmemory) </code> </span> </td> <td style="text-align:left"> Configured RAM limit for the database </td> </tr> <tr> <td> <span class="break-all"> bdb_monitor_sessions_count </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (endpoint_monitor_sessions_count) </code> </span> </td> <td style="text-align:left"> Number of clients connected in monitor mode to the database </td> </tr> <tr> <td> <span class="break-all"> bdb_no_of_keys </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (redis_server_db_keys{role="master"}) </code> </span> </td> <td style="text-align:left"> Number of keys in database </td> </tr> <tr> <td> <span class="break-all"> bdb_other_req </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_other_req[1m])) </code> </span> </td> <td style="text-align:left"> Rate of other (non read/write) requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_other_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_other_req[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of other (non read/write) requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_other_res </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_other_res[1m])) </code> </span> </td> <td style="text-align:left"> Rate of other (non read/write) responses on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_other_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_other_res[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of other (non read/write) responses on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_pubsub_channels </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_pubsub_channels) </code> </span> </td> <td style="text-align:left"> Count the pub/sub channels with subscribed clients </td> </tr> <tr> <td> <span class="break-all"> bdb_pubsub_channels_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_pubsub_channels) </code> </span> </td> <td style="text-align:left"> Highest value of count the pub/sub channels with subscribed clients </td> </tr> <tr> <td> <span class="break-all"> bdb_pubsub_patterns </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_pubsub_patterns) </code> </span> </td> <td style="text-align:left"> Count the pub/sub patterns with subscribed clients </td> </tr> <tr> <td> <span class="break-all"> bdb_pubsub_patterns_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_pubsub_patterns) </code> </span> </td> <td style="text-align:left"> Highest value of count the pub/sub patterns with subscribed clients </td> </tr> <tr> <td> <span class="break-all"> bdb_read_hits </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_read_hits{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Rate of read operations accessing an existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_read_hits_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_read_hits{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of read operations accessing an existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_read_misses </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_read_misses{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Rate of read operations accessing a non-existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_read_misses_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_read_misses{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of read operations accessing a non-existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_read_req </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_read_req[1m])) </code> </span> </td> <td style="text-align:left"> Rate of read requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_read_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_read_req[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of read requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_read_res </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_read_res[1m])) </code> </span> </td> <td style="text-align:left"> Rate of read responses on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_read_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_read_res[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of read responses on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_shard_cpu_system </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="system", role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> % cores utilization in system mode for all Redis shard processes of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_shard_cpu_system_max <span> </span> </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="system", role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of % cores utilization in system mode for all Redis shard processes of this database </td> </tr> <tr> <td> <span class="break-all"> bdb_shard_cpu_user </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="user", role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> % cores utilization in user mode for the Redis shard process </td> </tr> <tr> <td> <span class="break-all"> bdb_shard_cpu_user_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(namedprocess_namegroup_thread_cpu_seconds_total{mode="user", role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of % cores utilization in user mode for the Redis shard process </td> </tr> <tr> <td> <span class="break-all"> bdb_shards_used </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum((sum(label_replace(label_replace(label_replace(namedprocess_namegroup_thread_count{groupname=~"redis-\d+"}, "redis", "$1", "groupname", "redis-(\d+)"), "shard_type", "flash", "threadname", "(bigstore).*"), "shard_type", "ram", "shard_type", "")) by (redis, shard_type) &gt; bool 0) * on (redis) group_left(bdb) redis_server_up) by (bdb, shard_type) </code> </span> </td> <td style="text-align:left"> Used shard count by database and by shard type (ram / flash) </td> </tr> <tr> <td> <span class="break-all"> bdb_total_connections_received </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_total_connections_received[1m])) </code> </span> </td> <td style="text-align:left"> Rate of new client connections to database (connections/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_total_connections_received_max <span> </span> </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_total_connections_received[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of new client connections to database (connections/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_total_req </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_total_req[1m])) </code> </span> </td> <td style="text-align:left"> Rate of all requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_total_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_total_req[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of all requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_total_res </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_total_res[1m])) </code> </span> </td> <td style="text-align:left"> Rate of all responses on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_total_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_total_res[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of all responses on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_up </span> </td> <td style="text-align:left"> <span class="break-all"> <code> min by(bdb) (redis_up) </code> </span> </td> <td style="text-align:left"> Database is up and running </td> </tr> <tr> <td> <span class="break-all"> bdb_used_memory </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (redis_server_used_memory) </code> </span> </td> <td style="text-align:left"> Memory used by database (in BigRedis this includes flash) (bytes) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_hits </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_write_hits{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Rate of write operations accessing an existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_hits_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_write_hits{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of write operations accessing an existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_misses </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_write_misses{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Rate of write operations accessing a non-existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_misses_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(redis_server_keyspace_write_misses{role="master"}[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of write operations accessing a non-existing key (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_req </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_write_req[1m])) </code> </span> </td> <td style="text-align:left"> Rate of write requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (bdb) (irate(endpoint_write_req[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of write requests on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_res </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_write_responses[1m])) </code> </span> </td> <td style="text-align:left"> Rate of write responses on the database (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_write_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (irate(endpoint_write_responses[1m])) </code> </span> </td> <td style="text-align:left"> Highest value of the rate of write responses on the database (ops/sec) </td> </tr> <tr> <td> no_of_expires </td> <td style="text-align:left"> <span class="break-all"> <code> sum by(bdb) (redis_server_db_expires{role="master"}) </code> </span> </td> <td style="text-align:left"> Current number of volatile keys in the database </td> </tr> </tbody> </table> <h2 id="node-metrics"> Node metrics </h2> <table> <thead> <tr> <th> V1 metric </th> <th style="text-align:left"> Equivalent V2 PromQL </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td> <span class="break-all"> node_available_flash </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_available_flash_bytes </code> </span> </td> <td style="text-align:left"> Available flash in the node (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_available_flash_no_overbooking </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_available_flash_no_overbooking_bytes </code> </span> </td> <td style="text-align:left"> Available flash in the node (bytes), without taking into account overbooking </td> </tr> <tr> <td> <span class="break-all"> node_available_memory </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_available_memory_bytes </code> </span> </td> <td style="text-align:left"> Amount of free memory in the node (bytes) that is available for database provisioning </td> </tr> <tr> <td> <span class="break-all"> node_available_memory_no_overbooking </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_available_memory_no_overbooking_bytes </code> </span> </td> <td style="text-align:left"> Available RAM in the node (bytes) without taking into account overbooking </td> </tr> <tr> <td> <span class="break-all"> node_avg_latency </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (proxy) (irate(endpoint_acc_latency[1m])) / sum by (proxy) (irate(endpoint_total_started_res[1m])) </code> </span> </td> <td style="text-align:left"> Average latency of requests handled by endpoints on the node in milliseconds; returned only when there is traffic </td> </tr> <tr> <td> <span class="break-all"> node_bigstore_free </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_bigstore_free_bytes </code> </span> </td> <td style="text-align:left"> Sum of free space of back-end flash (used by flash database's [BigRedis]) on all cluster nodes (bytes); returned only when BigRedis is enabled </td> </tr> <tr> <td> <span class="break-all"> node_bigstore_iops </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_flash_reads_total + node_flash_writes_total </code> </span> </td> <td style="text-align:left"> Rate of I/O operations against back-end flash for all shards which are part of a flash-based database (BigRedis) in the cluster (ops/sec); returned only when BigRedis is enabled </td> </tr> <tr> <td> <span class="break-all"> node_bigstore_kv_ops </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (node) (irate(redis_server_big_io_dels[1m]) + irate(redis_server_big_io_reads[1m]) + irate(redis_server_big_io_writes[1m])) </code> </span> </td> <td style="text-align:left"> Rate of value read/write operations against back-end flash for all shards which are part of a flash-based database (BigRedis) in the cluster (ops/sec); returned only when BigRedis is enabled </td> </tr> <tr> <td> <span class="break-all"> node_bigstore_throughput </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (node) (irate(redis_server_big_io_read_bytes[1m]) + irate(redis_server_big_io_write_bytes[1m])) </code> </span> </td> <td style="text-align:left"> Throughput I/O operations against back-end flash for all shards which are part of a flash-based database (BigRedis) in the cluster (bytes/sec); returned only when BigRedis is enabled </td> </tr> <tr> <td> <span class="break-all"> node_cert_expiration_seconds </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_cert_expires_in_seconds </code> </span> </td> <td style="text-align:left"> Certificate expiration (in seconds) per given node; read more about <a href="/docs/latest/operate/rs/security/certificates/"> certificates in Redis Enterprise </a> and <a href="/docs/latest/operate/rs/security/certificates/monitor-certificates/"> monitoring certificates </a> </td> </tr> <tr> <td> <span class="break-all"> node_conns </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (node) (endpoint_conns) </code> </span> </td> <td style="text-align:left"> Number of clients connected to endpoints on node </td> </tr> <tr> <td> <span class="break-all"> node_cpu_idle </span> </td> <td style="text-align:left"> <span class="break-all"> <code> avg by (node) (irate(node_cpu_seconds_total{mode="idle"}[1m])) </code> </span> </td> <td style="text-align:left"> CPU idle time portion (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_idle_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of CPU idle time portion (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_idle_median </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Average value of CPU idle time portion (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_idle_min </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Lowest value of CPU idle time portion (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_system </span> </td> <td style="text-align:left"> <span class="break-all"> <code> avg by (node) (irate(node_cpu_seconds_total{mode="system"}[1m])) </code> </span> </td> <td style="text-align:left"> CPU time portion spent in the kernel (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_system_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of CPU time portion spent in the kernel (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_system_median </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Average value of CPU time portion spent in the kernel (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_system_min </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Lowest value of CPU time portion spent in the kernel (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_user </span> </td> <td style="text-align:left"> <span class="break-all"> <code> avg by (node) (irate(node_cpu_seconds_total{mode="user"}[1m])) </code> </span> </td> <td style="text-align:left"> CPU time portion spent by user-space processes (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_user_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of CPU time portion spent by user-space processes (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_user_median </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Average value of CPU time portion spent by user-space processes (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cpu_user_min </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Lowest value of CPU time portion spent by user-space processes (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> <span class="break-all"> node_cur_aof_rewrites </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (cluster, node) (redis_server_aof_rewrite_in_progress) </code> </span> </td> <td style="text-align:left"> Number of AOF rewrites that are currently performed by shards on this node </td> </tr> <tr> <td> <span class="break-all"> node_egress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(node_network_transmit_bytes_total{device="&lt;interface&gt;"}[1m]) </code> </span> </td> <td style="text-align:left"> Rate of outgoing network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_egress_bytes_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of outgoing network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_egress_bytes_median </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Average value of the rate of outgoing network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_egress_bytes_min </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Lowest value of the rate of outgoing network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_ephemeral_storage_avail </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_ephemeral_storage_avail_bytes </code> </span> </td> <td style="text-align:left"> Disk space available to RLEC processes on configured ephemeral disk (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_ephemeral_storage_free </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_ephemeral_storage_free_bytes </code> </span> </td> <td style="text-align:left"> Free disk space on configured ephemeral disk (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_free_memory </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_memory_MemFree_bytes </code> </span> </td> <td style="text-align:left"> Free memory in the node (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_ingress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(node_network_receive_bytes_total{device="&lt;interface&gt;"}[1m]) </code> </span> </td> <td style="text-align:left"> Rate of incoming network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_ingress_bytes_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of incoming network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_ingress_bytes_median </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Average value of the rate of incoming network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_ingress_bytes_min </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Lowest value of the rate of incoming network traffic to node (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> node_persistent_storage_avail </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_persistent_storage_avail_bytes </code> </span> </td> <td style="text-align:left"> Disk space available to RLEC processes on configured persistent disk (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_persistent_storage_free </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_persistent_storage_free_bytes </code> </span> </td> <td style="text-align:left"> Free disk space on configured persistent disk (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_provisional_flash </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_provisional_flash_bytes </code> </span> </td> <td style="text-align:left"> Amount of flash available for new shards on this node, taking into account overbooking, max Redis servers, reserved flash, and provision and migration thresholds (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_provisional_flash_no_overbooking </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_provisional_flash_no_overbooking_bytes </code> </span> </td> <td style="text-align:left"> Amount of flash available for new shards on this node, without taking into account overbooking, max Redis servers, reserved flash, and provision and migration thresholds (bytes) </td> </tr> <tr> <td> <span class="break-all"> node_provisional_memory </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_provisional_memory_bytes </code> </span> </td> <td style="text-align:left"> Amount of RAM that is available for provisioning to databases out of the total RAM allocated for databases </td> </tr> <tr> <td> <span class="break-all"> node_provisional_memory_no_overbooking </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_provisional_memory_no_overbooking_bytes </code> </span> </td> <td style="text-align:left"> Amount of RAM that is available for provisioning to databases out of the total RAM allocated for databases, without taking into account overbooking </td> </tr> <tr> <td> <span class="break-all"> node_total_req </span> </td> <td style="text-align:left"> <span class="break-all"> <code> sum by (cluster, node) (irate(endpoint_total_req[1m])) </code> </span> </td> <td style="text-align:left"> Request rate handled by endpoints on node (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> node_up </span> </td> <td style="text-align:left"> <span class="break-all"> <code> node_metrics_up </code> </span> </td> <td style="text-align:left"> Node is part of the cluster and is connected </td> </tr> </tbody> </table> <h2 id="cluster-metrics"> Cluster metrics </h2> <table> <thead> <tr> <th> V1 metric </th> <th style="text-align:left"> Equivalent V2 PromQL </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td> cluster_shards_limit </td> <td style="text-align:left"> <code> license_shards_limit </code> </td> <td style="text-align:left"> Total shard limit by the license by shard type (ram / flash) </td> </tr> </tbody> </table> <h2 id="proxy-metrics"> Proxy metrics </h2> <table> <thead> <tr> <th> V1 metric </th> <th style="text-align:left"> Equivalent V2 PromQL </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td> <span class="break-all"> listener_acc_latency </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Accumulative latency (sum of the latencies) of all types of commands on the database. For the average latency, divide this value by listener_total_res </td> </tr> <tr> <td> <span class="break-all"> listener_acc_latency_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of accumulative latency of all types of commands on the database </td> </tr> <tr> <td> <span class="break-all"> listener_acc_other_latency </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Accumulative latency (sum of the latencies) of commands that are a type "other" on the database. For the average latency, divide this value by listener_other_res </td> </tr> <tr> <td> <span class="break-all"> listener_acc_other_latency_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of accumulative latency of commands that are a type "other" on the database </td> </tr> <tr> <td> <span class="break-all"> listener_acc_read_latency </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Accumulative latency (sum of the latencies) of commands that are a type "read" on the database. For the average latency, divide this value by listener_read_res </td> </tr> <tr> <td> <span class="break-all"> listener_acc_read_latency_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of accumulative latency of commands that are a type "read" on the database </td> </tr> <tr> <td> <span class="break-all"> listener_acc_write_latency </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Accumulative latency (sum of the latencies) of commands that are a type "write" on the database. For the average latency, divide this value by listener_write_res </td> </tr> <tr> <td> <span class="break-all"> listener_acc_write_latency_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of accumulative latency of commands that are a type "write" on the database </td> </tr> <tr> <td> <span class="break-all"> listener_auth_cmds </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of memcached AUTH commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_auth_cmds_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of memcached AUTH commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_auth_errors </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of error responses to memcached AUTH commands </td> </tr> <tr> <td> <span class="break-all"> listener_auth_errors_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of error responses to memcached AUTH commands </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_flush </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of memcached FLUSH_ALL commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_flush_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of memcached FLUSH_ALL commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_get </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of memcached GET commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_get_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of memcached GET commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_set </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of memcached SET commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_set_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of memcached SET commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_touch </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of memcached TOUCH commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_cmd_touch_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of memcached TOUCH commands sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_conns </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of clients connected to the endpoint </td> </tr> <tr> <td> <span class="break-all"> listener_egress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Rate of outgoing network traffic to the endpoint (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_egress_bytes_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of outgoing network traffic to the endpoint (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_ingress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Rate of incoming network traffic to the endpoint (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_ingress_bytes_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of incoming network traffic to the endpoint (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_last_req_time </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Time of last command sent to the database </td> </tr> <tr> <td> <span class="break-all"> listener_last_res_time </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Time of last response sent from the database </td> </tr> <tr> <td> <span class="break-all"> listener_max_connections_exceeded </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(endpoint_maximal_connections_exceeded[1m]) </code> </span> </td> <td style="text-align:left"> Number of times the number of clients connected to the database at the same time has exceeded the max limit </td> </tr> <tr> <td> <span class="break-all"> listener_max_connections_exceeded_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of times the number of clients connected to the database at the same time has exceeded the max limit </td> </tr> <tr> <td> <span class="break-all"> listener_monitor_sessions_count </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of clients connected in monitor mode to the endpoint </td> </tr> <tr> <td> <span class="break-all"> listener_other_req </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Rate of other (non-read/write) requests on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_other_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of other (non-read/write) requests on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_other_res </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Rate of other (non-read/write) responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_other_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of other (non-read/write) responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_other_started_res </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of responses sent from the database of type "other" </td> </tr> <tr> <td> <span class="break-all"> listener_other_started_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of responses sent from the database of type "other" </td> </tr> <tr> <td> <span class="break-all"> listener_read_req </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(endpoint_read_requests[1m]) </code> </span> </td> <td style="text-align:left"> Rate of read requests on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_read_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of read requests on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_read_res </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(endpoint_read_responses[1m]) </code> </span> </td> <td style="text-align:left"> Rate of read responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_read_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of read responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_read_started_res </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of responses sent from the database of type "read" </td> </tr> <tr> <td> <span class="break-all"> listener_read_started_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of responses sent from the database of type "read" </td> </tr> <tr> <td> <span class="break-all"> listener_total_connections_received </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(endpoint_total_connections_received[1m]) </code> </span> </td> <td style="text-align:left"> Rate of new client connections to the endpoint (connections/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_total_connections_received_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of new client connections to the endpoint (connections/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_total_req </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Request rate handled by the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_total_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of all requests on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_total_res </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Rate of all responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_total_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of all responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_total_started_res </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of responses sent from the database of all types </td> </tr> <tr> <td> <span class="break-all"> listener_total_started_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of responses sent from the database of all types </td> </tr> <tr> <td> <span class="break-all"> listener_write_req </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(endpoint_write_requests[1m]) </code> </span> </td> <td style="text-align:left"> Rate of write requests on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_write_req_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of write requests on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_write_res </span> </td> <td style="text-align:left"> <span class="break-all"> <code> irate(endpoint_write_responses[1m]) </code> </span> </td> <td style="text-align:left"> Rate of write responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_write_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the rate of write responses on the endpoint (ops/sec) </td> </tr> <tr> <td> <span class="break-all"> listener_write_started_res </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Number of responses sent from the database of type "write" </td> </tr> <tr> <td> <span class="break-all"> listener_write_started_res_max </span> </td> <td style="text-align:left"> <span class="break-all"> N/A </span> </td> <td style="text-align:left"> Highest value of the number of responses sent from the database of type "write" </td> </tr> </tbody> </table> <h2 id="replication-metrics"> Replication metrics </h2> <table> <thead> <tr> <th> V1 metric </th> <th style="text-align:left"> Equivalent V2 PromQL </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td> <span class="break-all"> bdb_replicaof_syncer_ingress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> rate(replica_src_ingress_bytes[1m]) </code> </span> </td> <td style="text-align:left"> Rate of compressed incoming network traffic to a Replica Of database (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_replicaof_syncer_ingress_bytes_decompressed </span> </td> <td style="text-align:left"> <span class="break-all"> <code> rate(replica_src_ingress_bytes_decompressed[1m]) </code> </span> </td> <td style="text-align:left"> Rate of decompressed incoming network traffic to a Replica Of database (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_replicaof_syncer_local_ingress_lag_time </span> </td> <td style="text-align:left"> <span class="break-all"> <code> database_syncer_lag_ms{syncer_type="replicaof"} </code> </span> </td> <td style="text-align:left"> Lag time between the source and the destination for Replica Of traffic (ms) </td> </tr> <tr> <td> <span class="break-all"> bdb_replicaof_syncer_status </span> </td> <td style="text-align:left"> <span class="break-all"> <code> database_syncer_current_status{syncer_type="replicaof"} </code> </span> </td> <td style="text-align:left"> Syncer status for Replica Of traffic; 0 = in-sync, 1 = syncing, 2 = out of sync </td> </tr> <tr> <td> <span class="break-all"> bdb_crdt_syncer_ingress_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> rate(crdt_src_ingress_bytes[1m]) </code> </span> </td> <td style="text-align:left"> Rate of compressed incoming network traffic to CRDB (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_crdt_syncer_ingress_bytes_decompressed </span> </td> <td style="text-align:left"> <span class="break-all"> <code> rate(crdt_src_ingress_bytes_decompressed[1m]) </code> </span> </td> <td style="text-align:left"> Rate of decompressed incoming network traffic to CRDB (bytes/sec) </td> </tr> <tr> <td> <span class="break-all"> bdb_crdt_syncer_local_ingress_lag_time </span> </td> <td style="text-align:left"> <span class="break-all"> <code> database_syncer_lag_ms{syncer_type="crdt"} </code> </span> </td> <td style="text-align:left"> Lag time between the source and the destination (ms) for CRDB traffic </td> </tr> <tr> <td> <span class="break-all"> bdb_crdt_syncer_status </span> </td> <td style="text-align:left"> <span class="break-all"> <code> database_syncer_current_status{syncer_type="crdt"} </code> </span> </td> <td style="text-align:left"> Syncer status for CRDB traffic; 0 = in-sync, 1 = syncing, 2 = out of sync </td> </tr> </tbody> </table> <h2 id="shard-metrics"> Shard metrics </h2> <table> <thead> <tr> <th> V1 metric </th> <th style="text-align:left"> Equivalent V2 PromQL </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td> <span class="break-all"> redis_active_defrag_running </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_active_defrag_running </code> </span> </td> <td style="text-align:left"> Automatic memory defragmentation current aggressiveness (% cpu) </td> </tr> <tr> <td> <span class="break-all"> redis_allocator_active </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_allocator_active </code> </span> </td> <td style="text-align:left"> Total used memory, including external fragmentation </td> </tr> <tr> <td> <span class="break-all"> redis_allocator_allocated </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_allocator_allocated </code> </span> </td> <td style="text-align:left"> Total allocated memory </td> </tr> <tr> <td> <span class="break-all"> redis_allocator_resident </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_allocator_resident </code> </span> </td> <td style="text-align:left"> Total resident memory (RSS) </td> </tr> <tr> <td> <span class="break-all"> redis_aof_last_cow_size </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_aof_last_cow_size </code> </span> </td> <td style="text-align:left"> Last AOFR, CopyOnWrite memory </td> </tr> <tr> <td> <span class="break-all"> redis_aof_rewrite_in_progress </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_aof_rewrite_in_progress </code> </span> </td> <td style="text-align:left"> The number of simultaneous AOF rewrites that are in progress </td> </tr> <tr> <td> <span class="break-all"> redis_aof_rewrites </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_aof_rewrites </code> </span> </td> <td style="text-align:left"> Number of AOF rewrites this process executed </td> </tr> <tr> <td> <span class="break-all"> redis_aof_delayed_fsync </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_aof_delayed_fsync </code> </span> </td> <td style="text-align:left"> Number of times an AOF fsync caused delays in the main Redis thread (inducing latency); this can indicate that the disk is slow or overloaded </td> </tr> <tr> <td> <span class="break-all"> redis_blocked_clients </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_blocked_clients </code> </span> </td> <td style="text-align:left"> Count the clients waiting on a blocking call </td> </tr> <tr> <td> <span class="break-all"> redis_connected_clients </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_connected_clients </code> </span> </td> <td style="text-align:left"> Number of client connections to the specific shard </td> </tr> <tr> <td> <span class="break-all"> redis_connected_slaves </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_connected_slaves </code> </span> </td> <td style="text-align:left"> Number of connected replicas </td> </tr> <tr> <td> <span class="break-all"> redis_db0_avg_ttl </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_db0_avg_ttl </code> </span> </td> <td style="text-align:left"> Average TTL of all volatile keys </td> </tr> <tr> <td> <span class="break-all"> redis_db0_expires </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_expired_keys </code> </span> </td> <td style="text-align:left"> Total count of volatile keys </td> </tr> <tr> <td> <span class="break-all"> redis_db0_keys </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_db0_keys </code> </span> </td> <td style="text-align:left"> Total key count </td> </tr> <tr> <td> <span class="break-all"> redis_evicted_keys </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_evicted_keys </code> </span> </td> <td style="text-align:left"> Keys evicted so far (since restart) </td> </tr> <tr> <td> <span class="break-all"> redis_expire_cycle_cpu_milliseconds </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_expire_cycle_cpu_milliseconds </code> </span> </td> <td style="text-align:left"> The cumulative amount of time spent on active expiry cycles </td> </tr> <tr> <td> <span class="break-all"> redis_expired_keys </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_expired_keys </code> </span> </td> <td style="text-align:left"> Keys expired so far (since restart) </td> </tr> <tr> <td> <span class="break-all"> redis_forwarding_state </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_forwarding_state </code> </span> </td> <td style="text-align:left"> Shard forwarding state (on or off) </td> </tr> <tr> <td> <span class="break-all"> redis_keys_trimmed </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_keys_trimmed </code> </span> </td> <td style="text-align:left"> The number of keys that were trimmed in the current or last resharding process </td> </tr> <tr> <td> <span class="break-all"> redis_keyspace_read_hits </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_keyspace_read_hits </code> </span> </td> <td style="text-align:left"> Number of read operations accessing an existing keyspace </td> </tr> <tr> <td> <span class="break-all"> redis_keyspace_read_misses </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_keyspace_read_misses </code> </span> </td> <td style="text-align:left"> Number of read operations accessing a non-existing keyspace </td> </tr> <tr> <td> <span class="break-all"> redis_keyspace_write_hits </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_keyspace_write_hits </code> </span> </td> <td style="text-align:left"> Number of write operations accessing an existing keyspace </td> </tr> <tr> <td> <span class="break-all"> redis_keyspace_write_misses </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_keyspace_write_misses </code> </span> </td> <td style="text-align:left"> Number of write operations accessing a non-existing keyspace </td> </tr> <tr> <td> <span class="break-all"> redis_master_link_status </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_master_link_status </code> </span> </td> <td style="text-align:left"> Indicates if the replica is connected to its master </td> </tr> <tr> <td> <span class="break-all"> redis_master_repl_offset </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_master_repl_offset </code> </span> </td> <td style="text-align:left"> Number of bytes sent to replicas by the shard; calculate the throughput for a time period by comparing the value at different times </td> </tr> <tr> <td> <span class="break-all"> redis_master_sync_in_progress </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_master_sync_in_progress </code> </span> </td> <td style="text-align:left"> The master shard is synchronizing (1 true </td> </tr> <tr> <td> <span class="break-all"> redis_max_process_mem </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_max_process_mem </code> </span> </td> <td style="text-align:left"> Current memory limit configured by redis_mgr according to node free memory </td> </tr> <tr> <td> <span class="break-all"> redis_maxmemory </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_maxmemory </code> </span> </td> <td style="text-align:left"> Current memory limit configured by redis_mgr according to database memory limits </td> </tr> <tr> <td> <span class="break-all"> redis_mem_aof_buffer </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_mem_aof_buffer </code> </span> </td> <td style="text-align:left"> Current size of AOF buffer </td> </tr> <tr> <td> <span class="break-all"> redis_mem_clients_normal </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_mem_clients_normal </code> </span> </td> <td style="text-align:left"> Current memory used for input and output buffers of non-replica clients </td> </tr> <tr> <td> <span class="break-all"> redis_mem_clients_slaves </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_mem_clients_slaves </code> </span> </td> <td style="text-align:left"> Current memory used for input and output buffers of replica clients </td> </tr> <tr> <td> <span class="break-all"> redis_mem_fragmentation_ratio </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_mem_fragmentation_ratio </code> </span> </td> <td style="text-align:left"> Memory fragmentation ratio (1.3 means 30% overhead) </td> </tr> <tr> <td> <span class="break-all"> redis_mem_not_counted_for_evict </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_mem_not_counted_for_evict </code> </span> </td> <td style="text-align:left"> Portion of used_memory (in bytes) that's not counted for eviction and OOM error </td> </tr> <tr> <td> <span class="break-all"> redis_mem_replication_backlog </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_mem_replication_backlog </code> </span> </td> <td style="text-align:left"> Size of replication backlog </td> </tr> <tr> <td> <span class="break-all"> redis_module_fork_in_progress </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_module_fork_in_progress </code> </span> </td> <td style="text-align:left"> A binary value that indicates if there is an active fork spawned by a module (1) or not (0) </td> </tr> <tr> <td> <span class="break-all"> redis_process_cpu_system_seconds_total </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_cpu_seconds_total{mode="system"} </code> </span> </td> <td style="text-align:left"> Shard process system CPU time spent in seconds </td> </tr> <tr> <td> <span class="break-all"> redis_process_cpu_usage_percent </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_cpu_seconds_total{mode=~"system|user"} </code> </span> </td> <td style="text-align:left"> Shard process CPU usage percentage </td> </tr> <tr> <td> <span class="break-all"> redis_process_cpu_user_seconds_total </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_cpu_seconds_total{mode="user"} </code> </span> </td> <td style="text-align:left"> Shard user CPU time spent in seconds </td> </tr> <tr> <td> <span class="break-all"> redis_process_main_thread_cpu_system_seconds_total </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_thread_cpu_seconds_total{mode="system",threadname="redis-server"} </code> </span> </td> <td style="text-align:left"> Shard main thread system CPU time spent in seconds </td> </tr> <tr> <td> <span class="break-all"> redis_process_main_thread_cpu_user_seconds_total </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_thread_cpu_seconds_total{mode="user",threadname="redis-server"} </code> </span> </td> <td style="text-align:left"> Shard main thread user CPU time spent in seconds </td> </tr> <tr> <td> <span class="break-all"> redis_process_max_fds </span> </td> <td style="text-align:left"> <span class="break-all"> <code> max(namedprocess_namegroup_open_filedesc) </code> </span> </td> <td style="text-align:left"> Shard maximum number of open file descriptors </td> </tr> <tr> <td> <span class="break-all"> redis_process_open_fds </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_open_filedesc </code> </span> </td> <td style="text-align:left"> Shard number of open file descriptors </td> </tr> <tr> <td> <span class="break-all"> redis_process_resident_memory_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_memory_bytes{memtype="resident"} </code> </span> </td> <td style="text-align:left"> Shard resident memory size in bytes </td> </tr> <tr> <td> <span class="break-all"> redis_process_start_time_seconds </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_oldest_start_time_seconds </code> </span> </td> <td style="text-align:left"> Shard start time of the process since unix epoch in seconds </td> </tr> <tr> <td> <span class="break-all"> redis_process_virtual_memory_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> namedprocess_namegroup_memory_bytes{memtype="virtual"} </code> </span> </td> <td style="text-align:left"> Shard virtual memory in bytes </td> </tr> <tr> <td> <span class="break-all"> redis_rdb_bgsave_in_progress </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_rdb_bgsave_in_progress </code> </span> </td> <td style="text-align:left"> Indication if bgsave is currently in progress </td> </tr> <tr> <td> <span class="break-all"> redis_rdb_last_cow_size </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_rdb_last_cow_size </code> </span> </td> <td style="text-align:left"> Last bgsave (or SYNC fork) used CopyOnWrite memory </td> </tr> <tr> <td> <span class="break-all"> redis_rdb_saves </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_rdb_saves </code> </span> </td> <td style="text-align:left"> Total count of bgsaves since the process was restarted (including replica fullsync and persistence) </td> </tr> <tr> <td> <span class="break-all"> redis_repl_touch_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_repl_touch_bytes </code> </span> </td> <td style="text-align:left"> Number of bytes sent to replicas as TOUCH commands by the shard as a result of a READ command that was processed; calculate the throughput for a time period by comparing the value at different times </td> </tr> <tr> <td> <span class="break-all"> redis_total_commands_processed </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_total_commands_processed </code> </span> </td> <td style="text-align:left"> Number of commands processed by the shard; calculate the number of commands for a time period by comparing the value at different times </td> </tr> <tr> <td> <span class="break-all"> redis_total_connections_received </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_total_connections_received </code> </span> </td> <td style="text-align:left"> Number of connections received by the shard; calculate the number of connections for a time period by comparing the value at different times </td> </tr> <tr> <td> <span class="break-all"> redis_total_net_input_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_total_net_input_bytes </code> </span> </td> <td style="text-align:left"> Number of bytes received by the shard; calculate the throughput for a time period by comparing the value at different times </td> </tr> <tr> <td> <span class="break-all"> redis_total_net_output_bytes </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_total_net_output_bytes </code> </span> </td> <td style="text-align:left"> Number of bytes sent by the shard; calculate the throughput for a time period by comparing the value at different times </td> </tr> <tr> <td> <span class="break-all"> redis_up </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_up </code> </span> </td> <td style="text-align:left"> Shard is up and running </td> </tr> <tr> <td> <span class="break-all"> redis_used_memory </span> </td> <td style="text-align:left"> <span class="break-all"> <code> redis_server_used_memory </code> </span> </td> <td style="text-align:left"> Memory used by shard (in BigRedis this includes flash) (bytes) </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/prometheus-with-redis-enterprise/prometheus-metrics-v1-to-v2/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-install-directories/.html
<section class="prose w-full py-12 max-w-none"> <h1> Customize installation directories </h1> <p class="text-lg -mt-5 mb-10"> Customize Redis Enterprise Software installation directories. </p> <p> When you install Redis Enterprise Software on Red Hat Enterprise Linux, you can customize the installation directories. </p> <p> The files are installed in the <code> redislabs </code> directory located in the path that you specify. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <ul> <li> When you install with custom directories, the installation does not run as an RPM file. </li> <li> If a <code> redislabs </code> directory already exists in the path that you specify, the installation fails. </li> <li> All nodes in a cluster must be installed with the same file locations. </li> <li> Custom installation directories are not supported for databases using Auto Tiering. </li> </ul> </div> </div> <p> You can specify these file locations: </p> <table> <thead> <tr> <th> Files </th> <th> Installer flag </th> <th> Example parameter </th> <th> Example file location </th> </tr> </thead> <tbody> <tr> <td> Binaries files </td> <td> --install-dir </td> <td> /opt </td> <td> /opt/redislabs </td> </tr> <tr> <td> Configuration files </td> <td> --config-dir </td> <td> /etc/opt </td> <td> /etc/opt/redislabs </td> </tr> <tr> <td> Data and log files </td> <td> --var-dir </td> <td> /var/opt </td> <td> /var/opt/redislabs </td> </tr> </tbody> </table> <p> These files are not in the custom directories: </p> <ul> <li> <p> OS files </p> <ul> <li> /etc/cron.d/redislabs </li> <li> /etc/firewalld/services </li> <li> /etc/firewalld/services/redislabs-clients.xml </li> <li> /etc/firewalld/services/redislabs.xml </li> <li> /etc/ld.so.conf.d/redislabs_ldconfig.conf.tmpl </li> <li> /etc/logrotate.d/redislabs </li> <li> /etc/profile.d/redislabs_env.sh </li> <li> /usr/lib/systemd/system/rlec_supervisor.service.tmpl </li> <li> /usr/share/selinux/mls/redislabs.pp </li> <li> /usr/share/selinux/targeted/redislabs.pp </li> </ul> </li> <li> <p> Installation reference files </p> <ul> <li> /etc/opt/redislabs/redislabs_custom_install_version </li> <li> /etc/opt/redislabs/redislabs_env_config.sh </li> </ul> </li> </ul> <p> To specify directories during <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/install-on-linux/"> installation </a> , include installer flags as <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/install-script/"> command-line options </a> when you run the <code> install.sh </code> script. For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo ./install.sh --install-dir &lt;path&gt; --config-dir &lt;path&gt; --var-dir &lt;path&gt; </span></span></code></pre> </div> <h2 id="limitations"> Limitations </h2> <p> Several Redis Enterprise Software installation reference files are installed to the directory <code> /etc/opt/redislabs/ </code> even if you use custom installation directories. </p> <p> As a workaround to install Redis Enterprise Software without using any root directories, do the following before installing Redis Enterprise Software: </p> <ol> <li> <p> Create all custom, non-root directories you want to use with Redis Enterprise Software. </p> </li> <li> <p> Mount <code> /etc/opt/redislabs </code> to one of the custom, non-root directories. </p> </li> </ol> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-install-directories/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/reference/redis_enterprise_cluster_api/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisEnterpriseCluster API Reference </h1> <p> apiVersion: </p> <ul> <li> <a href="#appredislabscomv1"> app.redislabs.com/v1 </a> </li> </ul> <h1 id="appredislabscomv1"> app.redislabs.com/v1 </h1> <p> RedisEnterpriseCluster is the Schema for the redisenterpriseclusters API </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> apiVersion </td> <td> string </td> <td> app.redislabs.com/v1 </td> <td> true </td> </tr> <tr> <td> kind </td> <td> string </td> <td> RedisEnterpriseCluster </td> <td> true </td> </tr> <tr> <td> <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta"> metadata </a> </td> <td> object </td> <td> Refer to the Kubernetes API documentation for the fields of the `metadata` field. </td> <td> true </td> </tr> <tr> <td> <a href="#spec"> spec </a> </td> <td> object </td> <td> RedisEnterpriseClusterSpec defines the desired state of RedisEnterpriseCluster <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#status"> status </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="spec"> spec </h3> <p> <sup> <sup> <a href="#"> ↩ Parent </a> </sup> </sup> </p> <p> RedisEnterpriseClusterSpec defines the desired state of RedisEnterpriseCluster </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specactiveactive"> activeActive </a> </td> <td> object </td> <td> Specification for ActiveActive setup. At most one of ingressOrRouteSpec or activeActive fields can be set at the same time. <br/> </td> <td> false </td> </tr> <tr> <td> antiAffinityAdditionalTopologyKeys </td> <td> []string </td> <td> Additional antiAffinity terms in order to support installation on different zones/vcenters <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbackup"> backup </a> </td> <td> object </td> <td> Cluster-wide backup configurations <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbootstrapperimagespec"> bootstrapperImageSpec </a> </td> <td> object </td> <td> Specification for Bootstrapper container image <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbootstrapperresources"> bootstrapperResources </a> </td> <td> object </td> <td> Compute resource requirements for bootstrapper containers <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#speccertificates"> certificates </a> </td> <td> object </td> <td> RS Cluster Certificates. Used to modify the certificates used by the cluster. See the "RSClusterCertificates" struct described above to see the supported certificates. <br/> </td> <td> false </td> </tr> <tr> <td> clusterCredentialSecretName </td> <td> string </td> <td> Secret Name/Path to use for Cluster Credentials. To be used only if ClusterCredentialSecretType is vault. If left blank, will use cluster name. <br/> </td> <td> false </td> </tr> <tr> <td> clusterCredentialSecretRole </td> <td> string </td> <td> Used only if ClusterCredentialSecretType is vault, to define vault role to be used. If blank, defaults to "redis-enterprise-operator" <br/> </td> <td> false </td> </tr> <tr> <td> clusterCredentialSecretType </td> <td> enum </td> <td> Type of Secret to use for ClusterCredential, Vault, Kuberetes,... If left blank, will default ot kubernetes secrets <br/> <br/> <i> Enum </i> : vault, kubernetes <br/> </td> <td> false </td> </tr> <tr> <td> clusterRecovery </td> <td> boolean </td> <td> ClusterRecovery initiates cluster recovery when set to true. Note that this field is cleared automatically after the cluster is recovered <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#speccontainertimezone"> containerTimezone </a> </td> <td> object </td> <td> Container timezone configuration. While the default timezone on all containers is UTC, this setting can be used to set the timezone on services rigger/bootstrapper/RS containers. You can either propagate the hosts timezone to RS pods or set it manually via timezoneName. <br/> </td> <td> false </td> </tr> <tr> <td> createServiceAccount </td> <td> boolean </td> <td> Whether to create service account <br/> </td> <td> false </td> </tr> <tr> <td> dataInternodeEncryption </td> <td> boolean </td> <td> Internode encryption (INE) cluster wide policy. An optional boolean setting. Specifies if INE should be on/off for new created REDBs. May be overridden for specific REDB via similar setting, please view the similar setting for REDB for more info. <br/> </td> <td> false </td> </tr> <tr> <td> encryptPkeys </td> <td> boolean </td> <td> Private key encryption Possible values: true/false <br/> </td> <td> false </td> </tr> <tr> <td> enforceIPv4 </td> <td> boolean </td> <td> Sets ENFORCE_IPV4 environment variable <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specextraenvvars"> extraEnvVars </a> </td> <td> []object </td> <td> ADVANCED USAGE: use carefully. Add environment variables to RS StatefulSet's containers. <br/> </td> <td> false </td> </tr> <tr> <td> extraLabels </td> <td> map[string]string </td> <td> Labels that the user defines for their convenience <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#spechostaliases"> hostAliases </a> </td> <td> []object </td> <td> Adds hostAliases entries to the Redis Enterprise pods <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specingressorroutespec"> ingressOrRouteSpec </a> </td> <td> object </td> <td> Access configurations for the Redis Enterprise Cluster and Databases. At most one of ingressOrRouteSpec or activeActive fields can be set at the same time. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specldap"> ldap </a> </td> <td> object </td> <td> Cluster-level LDAP configuration, such as server addresses, protocol, authentication and query settings. <br/> </td> <td> false </td> </tr> <tr> <td> license </td> <td> string </td> <td> Redis Enterprise License <br/> </td> <td> false </td> </tr> <tr> <td> licenseSecretName </td> <td> string </td> <td> K8s secret or Vault Secret Name/Path to use for Cluster License. When left blank, the license is read from the "license" field. Note that you can't specify non-empty values in both "license" and "licenseSecretName", only one of these fields can be used to pass the license string. The license needs to be stored under the key "license". <br/> </td> <td> false </td> </tr> <tr> <td> nodeSelector </td> <td> map[string]string </td> <td> Selector for nodes that could fit Redis Enterprise pod <br/> </td> <td> false </td> </tr> <tr> <td> nodes </td> <td> integer </td> <td> Number of Redis Enterprise nodes (pods) <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specocspconfiguration"> ocspConfiguration </a> </td> <td> object </td> <td> An API object that represents the cluster's OCSP configuration. To enable OCSP, the cluster's proxy certificate should contain the OCSP responder URL. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpersistentspec"> persistentSpec </a> </td> <td> object </td> <td> Specification for Redis Enterprise Cluster persistence <br/> </td> <td> false </td> </tr> <tr> <td> podAnnotations </td> <td> map[string]string </td> <td> annotations for the service rigger and redis enterprise pods <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpodantiaffinity"> podAntiAffinity </a> </td> <td> object </td> <td> Override for the default anti-affinity rules of the Redis Enterprise pods. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#an-example-of-a-pod-that-uses-pod-affinity <br/> </td> <td> false </td> </tr> <tr> <td> podSecurityPolicyName </td> <td> string </td> <td> DEPRECATED PodSecurityPolicy support is removed in Kubernetes v1.25 and the use of this field is invalid for use when running on Kubernetes v1.25+. Future versions of the RedisEnterpriseCluster API will remove support for this field altogether. For migration instructions, see https://kubernetes.io/docs/tasks/configure-pod-container/migrate-from-psp/ Name of pod security policy to use on pods <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpodstartingpolicy"> podStartingPolicy </a> </td> <td> object </td> <td> Mitigation setting for STS pods stuck in "ContainerCreating" <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpodtolerations"> podTolerations </a> </td> <td> []object </td> <td> Tolerations that are added to all managed pods. More information: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ <br/> </td> <td> false </td> </tr> <tr> <td> priorityClassName </td> <td> string </td> <td> Adds the priority class to pods managed by the operator <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpullsecrets"> pullSecrets </a> </td> <td> []object </td> <td> PullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ <br/> </td> <td> false </td> </tr> <tr> <td> rackAwarenessNodeLabel </td> <td> string </td> <td> Node label that specifies rack ID - if specified, will create rack aware cluster. Rack awareness requires node label must exist on all nodes. Additionally, operator needs a special cluster role with permission to list nodes. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributes"> redisEnterpriseAdditionalPodSpecAttributes </a> </td> <td> object </td> <td> ADVANCED USAGE USE AT YOUR OWN RISK - specify pod attributes that are required for the statefulset - Redis Enterprise pods. Pod attributes managed by the operator might override these settings. Also make sure the attributes are supported by the K8s version running on the cluster - the operator does not validate that. <br/> </td> <td> false </td> </tr> <tr> <td> redisEnterpriseIPFamily </td> <td> enum </td> <td> Reserved, future use, only for use if instructed by Redis. IPFamily dictates what IP family to choose for pods' internal and external communication. <br/> <br/> <i> Enum </i> : IPv4, IPv6 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseimagespec"> redisEnterpriseImageSpec </a> </td> <td> object </td> <td> Specification for Redis Enterprise container image <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterprisenoderesources"> redisEnterpriseNodeResources </a> </td> <td> object </td> <td> Compute resource requirements for Redis Enterprise containers <br/> </td> <td> false </td> </tr> <tr> <td> redisEnterprisePodAnnotations </td> <td> map[string]string </td> <td> annotations for redis enterprise pod <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesconfiguration"> redisEnterpriseServicesConfiguration </a> </td> <td> object </td> <td> RS Cluster optional services settings <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesriggerimagespec"> redisEnterpriseServicesRiggerImageSpec </a> </td> <td> object </td> <td> Specification for Services Rigger container image <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesriggerresources"> redisEnterpriseServicesRiggerResources </a> </td> <td> object </td> <td> Compute resource requirements for Services Rigger pod <br/> </td> <td> false </td> </tr> <tr> <td> redisEnterpriseTerminationGracePeriodSeconds </td> <td> integer </td> <td> The TerminationGracePeriodSeconds value for the (STS created) REC pods <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterprisevolumemounts"> redisEnterpriseVolumeMounts </a> </td> <td> []object </td> <td> additional volume mounts within the redis enterprise containers. More info: https://kubernetes.io/docs/concepts/storage/volumes/ <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisonflashspec"> redisOnFlashSpec </a> </td> <td> object </td> <td> Stores configurations specific to redis on flash. If provided, the cluster will be capable of creating redis on flash databases. <br/> </td> <td> false </td> </tr> <tr> <td> redisUpgradePolicy </td> <td> enum </td> <td> Redis upgrade policy to be set on the Redis Enterprise Cluster. Possible values: major/latest This value is used by the cluster to choose the Redis version of the database when an upgrade is performed. The Redis Enterprise Cluster includes multiple versions of OSS Redis that can be used for databases. <br/> <br/> <i> Enum </i> : major, latest <br/> </td> <td> false </td> </tr> <tr> <td> resp3Default </td> <td> boolean </td> <td> Whether databases will turn on RESP3 compatibility upon database upgrade. Note - Deleting this property after explicitly setting its value shall have no effect. Please view the corresponding field in RS doc for more info. <br/> </td> <td> false </td> </tr> <tr> <td> serviceAccountName </td> <td> string </td> <td> Name of the service account to use <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservices"> services </a> </td> <td> object </td> <td> Customization options for operator-managed service resources created for Redis Enterprise clusters and databases <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspec"> servicesRiggerSpec </a> </td> <td> object </td> <td> Specification for service rigger <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspec"> sideContainersSpec </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specslaveha"> slaveHA </a> </td> <td> object </td> <td> Slave high availability mechanism configuration. <br/> </td> <td> false </td> </tr> <tr> <td> uiAnnotations </td> <td> map[string]string </td> <td> Annotations for Redis Enterprise UI service. This annotations will override the overlapping global annotations set under spec.services.servicesAnnotations The specified annotations will not override annotations that already exist and didn't originate from the operator, except for the 'redis.io/last-keys' annotation which is reserved. <br/> </td> <td> false </td> </tr> <tr> <td> uiServiceType </td> <td> enum </td> <td> Type of service used to expose Redis Enterprise UI (https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) <br/> <br/> <i> Enum </i> : ClusterIP, NodePort, LoadBalancer, ExternalName <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specupgradespec"> upgradeSpec </a> </td> <td> object </td> <td> Specification for upgrades of Redis Enterprise <br/> </td> <td> false </td> </tr> <tr> <td> username </td> <td> string </td> <td> Username for the admin user of Redis Enterprise <br/> </td> <td> false </td> </tr> <tr> <td> vaultCASecret </td> <td> string </td> <td> K8s secret name containing Vault's CA cert - defaults to "vault-ca-cert" <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumes"> volumes </a> </td> <td> []object </td> <td> additional volumes <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specactiveactive"> spec.activeActive </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Specification for ActiveActive setup. At most one of ingressOrRouteSpec or activeActive fields can be set at the same time. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> apiIngressUrl </td> <td> string </td> <td> RS API URL <br/> </td> <td> true </td> </tr> <tr> <td> dbIngressSuffix </td> <td> string </td> <td> DB ENDPOINT SUFFIX - will be used to set the db host. ingress <db name=""> <db ingress="" suffix=""> Creates a host name so it should be unique if more than one db is created on the cluster with the same name <br/> </db> </db> </td> <td> true </td> </tr> <tr> <td> method </td> <td> enum </td> <td> Used to distinguish between different platforms implementation <br/> <br/> <i> Enum </i> : openShiftRoute, ingress <br/> </td> <td> true </td> </tr> <tr> <td> ingressAnnotations </td> <td> map[string]string </td> <td> Used for ingress controllers such as ha-proxy or nginx in GKE <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specbackup"> spec.backup </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Cluster-wide backup configurations </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specbackups3"> s3 </a> </td> <td> object </td> <td> Configurations for backups to s3 and s3-compatible storage <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specbackups3"> spec.backup.s3 </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ Parent </a> </sup> </sup> </p> <p> Configurations for backups to s3 and s3-compatible storage </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> caCertificateSecretName </td> <td> string </td> <td> Secret name that holds the S3 CA certificate, which contains the TLS certificate mapped to the key in the secret 'cert' <br/> </td> <td> false </td> </tr> <tr> <td> url </td> <td> string </td> <td> Specifies the URL for S3 export and import <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specbootstrapperimagespec"> spec.bootstrapperImageSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Specification for Bootstrapper container image </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> digestHash </td> <td> string </td> <td> The digest hash of the container image to pull. When specified, the container image is pulled according to the digest hash instead of the image tag. The versionTag field must also be specified with the image tag matching this digest hash. Note: This field is only supported for OLM deployments. <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> The image pull policy to be applied to the container image. One of Always, Never, IfNotPresent. <br/> </td> <td> false </td> </tr> <tr> <td> repository </td> <td> string </td> <td> The repository (name) of the container image to be deployed. <br/> </td> <td> false </td> </tr> <tr> <td> versionTag </td> <td> string </td> <td> The tag of the container image to be deployed. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specbootstrapperresources"> spec.bootstrapperResources </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Compute resource requirements for bootstrapper containers </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specbootstrapperresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specbootstrapperresourcesclaims"> spec.bootstrapperResources.claims[] </h3> <p> <sup> <sup> <a href="#specbootstrapperresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="speccertificates"> spec.certificates </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> RS Cluster Certificates. Used to modify the certificates used by the cluster. See the "RSClusterCertificates" struct described above to see the supported certificates. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> apiCertificateSecretName </td> <td> string </td> <td> Secret name to use for cluster's API certificate. If left blank, a cluster-provided certificate will be used. <br/> </td> <td> false </td> </tr> <tr> <td> cmCertificateSecretName </td> <td> string </td> <td> Secret name to use for cluster's CM (Cluster Manager) certificate. If left blank, a cluster-provided certificate will be used. <br/> </td> <td> false </td> </tr> <tr> <td> ldapClientCertificateSecretName </td> <td> string </td> <td> Secret name to use for cluster's LDAP client certificate. If left blank, LDAP client certificate authentication will be disabled. <br/> </td> <td> false </td> </tr> <tr> <td> metricsExporterCertificateSecretName </td> <td> string </td> <td> Secret name to use for cluster's Metrics Exporter certificate. If left blank, a cluster-provided certificate will be used. <br/> </td> <td> false </td> </tr> <tr> <td> proxyCertificateSecretName </td> <td> string </td> <td> Secret name to use for cluster's Proxy certificate. If left blank, a cluster-provided certificate will be used. <br/> </td> <td> false </td> </tr> <tr> <td> syncerCertificateSecretName </td> <td> string </td> <td> Secret name to use for cluster's Syncer certificate. If left blank, a cluster-provided certificate will be used. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="speccontainertimezone"> spec.containerTimezone </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Container timezone configuration. While the default timezone on all containers is UTC, this setting can be used to set the timezone on services rigger/bootstrapper/RS containers. You can either propagate the hosts timezone to RS pods or set it manually via timezoneName. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> propagateHost </td> <td> object </td> <td> Identifies that container timezone should be in sync with the host, this option mounts a hostPath volume onto RS pods that could be restricted in some systems. <br/> </td> <td> false </td> </tr> <tr> <td> timezoneName </td> <td> string </td> <td> POSIX-style timezone name as a string to be passed as EnvVar to RE pods, e.g. "Europe/London". <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specextraenvvars"> spec.extraEnvVars[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specextraenvvarsvaluefrom"> valueFrom </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specextraenvvarsvaluefrom"> spec.extraEnvVars[].valueFrom </h3> <p> <sup> <sup> <a href="#specextraenvvars"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specextraenvvarsvaluefromconfigmapkeyref"> configMapKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specextraenvvarsvaluefromfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specextraenvvarsvaluefromresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specextraenvvarsvaluefromsecretkeyref"> secretKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specextraenvvarsvaluefromconfigmapkeyref"> spec.extraEnvVars[].valueFrom.configMapKeyRef </h3> <p> <sup> <sup> <a href="#specextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specextraenvvarsvaluefromfieldref"> spec.extraEnvVars[].valueFrom.fieldRef </h3> <p> <sup> <sup> <a href="#specextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specextraenvvarsvaluefromresourcefieldref"> spec.extraEnvVars[].valueFrom.resourceFieldRef </h3> <p> <sup> <sup> <a href="#specextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specextraenvvarsvaluefromsecretkeyref"> spec.extraEnvVars[].valueFrom.secretKeyRef </h3> <p> <sup> <sup> <a href="#specextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="spechostaliases"> spec.hostAliases[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> hostnames </td> <td> []string </td> <td> Hostnames for the above IP address. <br/> </td> <td> false </td> </tr> <tr> <td> ip </td> <td> string </td> <td> IP address of the host file entry. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specingressorroutespec"> spec.ingressOrRouteSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Access configurations for the Redis Enterprise Cluster and Databases. At most one of ingressOrRouteSpec or activeActive fields can be set at the same time. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> apiFqdnUrl </td> <td> string </td> <td> RS API URL <br/> </td> <td> true </td> </tr> <tr> <td> dbFqdnSuffix </td> <td> string </td> <td> DB ENDPOINT SUFFIX - will be used to set the db host ingress <db name=""> <db fqdn="" suffix=""> . Creates a host name so it should be unique if more than one db is created on the cluster with the same name <br/> </db> </db> </td> <td> true </td> </tr> <tr> <td> method </td> <td> enum </td> <td> Used to distinguish between different platforms implementation. <br/> <br/> <i> Enum </i> : openShiftRoute, ingress, istio <br/> </td> <td> true </td> </tr> <tr> <td> ingressAnnotations </td> <td> map[string]string </td> <td> Additional annotations to set on ingress resources created by the operator <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specldap"> spec.ldap </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Cluster-level LDAP configuration, such as server addresses, protocol, authentication and query settings. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specldapauthenticationquery"> authenticationQuery </a> </td> <td> object </td> <td> Configuration of authentication queries, mapping between the username, provided to the cluster for authentication, and the LDAP Distinguished Name. <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specldapauthorizationquery"> authorizationQuery </a> </td> <td> object </td> <td> Configuration of authorization queries, mapping between a user's Distinguished Name and its group memberships. <br/> </td> <td> true </td> </tr> <tr> <td> protocol </td> <td> enum </td> <td> Specifies the LDAP protocol to use. One of: LDAP, LDAPS, STARTTLS. <br/> <br/> <i> Enum </i> : LDAP, LDAPS, STARTTLS <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specldapservers"> servers </a> </td> <td> []object </td> <td> One or more LDAP servers. If multiple servers are specified, they must all share an identical organization tree structure. <br/> </td> <td> true </td> </tr> <tr> <td> bindCredentialsSecretName </td> <td> string </td> <td> Name of a secret within the same namespace, holding the credentials used to communicate with the LDAP server for authentication queries. The secret must have a key named 'dn' with the Distinguished Name of the user to execute the query, and 'password' with its password. If left blank, credentials-based authentication is disabled. <br/> </td> <td> false </td> </tr> <tr> <td> caCertificateSecretName </td> <td> string </td> <td> Name of a secret within the same namespace, holding a PEM-encoded CA certificate for validating the TLS connection to the LDAP server. The secret must have a key named 'cert' with the certificate data. This field is applicable only when the protocol is LDAPS or STARTTLS. <br/> </td> <td> false </td> </tr> <tr> <td> cacheTTLSeconds </td> <td> integer </td> <td> The maximum TTL of cached entries. <br/> </td> <td> false </td> </tr> <tr> <td> enabledForControlPlane </td> <td> boolean </td> <td> Whether to enable LDAP for control plane access. Disabled by default. <br/> </td> <td> false </td> </tr> <tr> <td> enabledForDataPlane </td> <td> boolean </td> <td> Whether to enable LDAP for data plane access. Disabled by default. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specldapauthenticationquery"> spec.ldap.authenticationQuery </h3> <p> <sup> <sup> <a href="#specldap"> ↩ Parent </a> </sup> </sup> </p> <p> Configuration of authentication queries, mapping between the username, provided to the cluster for authentication, and the LDAP Distinguished Name. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specldapauthenticationqueryquery"> query </a> </td> <td> object </td> <td> Configuration for a search query. Mutually exclusive with the 'template' field. The substring '%u' in the query filter will be replaced with the username. <br/> </td> <td> false </td> </tr> <tr> <td> template </td> <td> string </td> <td> Configuration for a template query. Mutually exclusive with the 'query' field. The substring '%u' will be replaced with the username, e.g., 'cn=%u,ou=dev,dc=example,dc=com'. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specldapauthenticationqueryquery"> spec.ldap.authenticationQuery.query </h3> <p> <sup> <sup> <a href="#specldapauthenticationquery"> ↩ Parent </a> </sup> </sup> </p> <p> Configuration for a search query. Mutually exclusive with the 'template' field. The substring '%u' in the query filter will be replaced with the username. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> base </td> <td> string </td> <td> The Distinguished Name of the entry at which to start the search, e.g., 'ou=dev,dc=example,dc=com'. <br/> </td> <td> true </td> </tr> <tr> <td> filter </td> <td> string </td> <td> An RFC-4515 string representation of the filter to apply in the search. For an authentication query, the substring '%u' will be replaced with the username, e.g., '(cn=%u)'. For an authorization query, the substring '%D' will be replaced with the user's Distinguished Name, e.g., '(members=%D)'. <br/> </td> <td> true </td> </tr> <tr> <td> scope </td> <td> enum </td> <td> The search scope for an LDAP query. One of: BaseObject, SingleLevel, WholeSubtree <br/> <br/> <i> Enum </i> : BaseObject, SingleLevel, WholeSubtree <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specldapauthorizationquery"> spec.ldap.authorizationQuery </h3> <p> <sup> <sup> <a href="#specldap"> ↩ Parent </a> </sup> </sup> </p> <p> Configuration of authorization queries, mapping between a user's Distinguished Name and its group memberships. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> attribute </td> <td> string </td> <td> Configuration for an attribute query. Mutually exclusive with the 'query' field. Holds the name of an attribute of the LDAP user entity that contains a list of the groups that the user belongs to, e.g., 'memberOf'. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specldapauthorizationqueryquery"> query </a> </td> <td> object </td> <td> Configuration for a search query. Mutually exclusive with the 'attribute' field. The substring '%D' in the query filter will be replaced with the user's Distinguished Name. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specldapauthorizationqueryquery"> spec.ldap.authorizationQuery.query </h3> <p> <sup> <sup> <a href="#specldapauthorizationquery"> ↩ Parent </a> </sup> </sup> </p> <p> Configuration for a search query. Mutually exclusive with the 'attribute' field. The substring '%D' in the query filter will be replaced with the user's Distinguished Name. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> base </td> <td> string </td> <td> The Distinguished Name of the entry at which to start the search, e.g., 'ou=dev,dc=example,dc=com'. <br/> </td> <td> true </td> </tr> <tr> <td> filter </td> <td> string </td> <td> An RFC-4515 string representation of the filter to apply in the search. For an authentication query, the substring '%u' will be replaced with the username, e.g., '(cn=%u)'. For an authorization query, the substring '%D' will be replaced with the user's Distinguished Name, e.g., '(members=%D)'. <br/> </td> <td> true </td> </tr> <tr> <td> scope </td> <td> enum </td> <td> The search scope for an LDAP query. One of: BaseObject, SingleLevel, WholeSubtree <br/> <br/> <i> Enum </i> : BaseObject, SingleLevel, WholeSubtree <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specldapservers"> spec.ldap.servers[] </h3> <p> <sup> <sup> <a href="#specldap"> ↩ Parent </a> </sup> </sup> </p> <p> Address of an LDAP server. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> host </td> <td> string </td> <td> Host name of the LDAP server <br/> </td> <td> true </td> </tr> <tr> <td> port </td> <td> integer </td> <td> Port number of the LDAP server. If unspecified, defaults to 389 for LDAP and STARTTLS protocols, and 636 for LDAPS protocol. <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specocspconfiguration"> spec.ocspConfiguration </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> An API object that represents the cluster's OCSP configuration. To enable OCSP, the cluster's proxy certificate should contain the OCSP responder URL. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> ocspFunctionality </td> <td> boolean </td> <td> Whether to enable/disable OCSP mechanism for the cluster. <br/> </td> <td> false </td> </tr> <tr> <td> queryFrequency </td> <td> integer </td> <td> Determines the interval (in seconds) in which the control plane will poll the OCSP responder for a new status for the server certificate. Minimum value is 60. Maximum value is 86400. <br/> </td> <td> false </td> </tr> <tr> <td> recoveryFrequency </td> <td> integer </td> <td> Determines the interval (in seconds) in which the control plane will poll the OCSP responder for a new status for the server certificate when the current staple is invalid. Minimum value is 60. Maximum value is 86400. <br/> </td> <td> false </td> </tr> <tr> <td> recoveryMaxTries </td> <td> integer </td> <td> Determines the maximum number for the OCSP recovery attempts. After max number of tries passed, the control plane will revert back to the regular frequency. Minimum value is 1. Maximum value is 100. <br/> </td> <td> false </td> </tr> <tr> <td> responseTimeout </td> <td> integer </td> <td> Determines the time interval (in seconds) for which the request waits for a response from the OCSP responder. Minimum value is 1. Maximum value is 60. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpersistentspec"> spec.persistentSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Specification for Redis Enterprise Cluster persistence </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enablePersistentVolumeResize </td> <td> boolean </td> <td> Whether to enable PersistentVolumes resize. Disabled by default. Read the instruction in pvc_expansion readme carefully before using this feature. <br/> </td> <td> false </td> </tr> <tr> <td> enabled </td> <td> boolean </td> <td> Whether to add persistent volume to Redis Enterprise pods <br/> </td> <td> false </td> </tr> <tr> <td> storageClassName </td> <td> string </td> <td> Storage class for persistent volume in Redis Enterprise pods. Leave empty to use the default. If using the default this way, make sure the Kubernetes Cluster has a default Storage Class configured. This can be done by running a `kubectl get storageclass` and see if one of the Storage Classes' names contains a `(default)` mark. <br/> </td> <td> false </td> </tr> <tr> <td> volumeSize </td> <td> int or string </td> <td> To enable resizing after creating the cluster - please follow the instructions in the pvc_expansion readme <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinity"> spec.podAntiAffinity </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Override for the default anti-affinity rules of the Redis Enterprise pods. More info: <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#an-example-of-a-pod-that-uses-pod-affinity"> https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#an-example-of-a-pod-that-uses-pod-affinity </a> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecution"> preferredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecution"> requiredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinitypreferredduringschedulingignoredduringexecution"> spec.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specpodantiaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> podAffinityTerm </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> weight </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> spec.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm </h3> <p> <sup> <sup> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> spec.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector </h3> <p> <sup> <sup> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> spec.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> spec.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector </h3> <p> <sup> <sup> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> spec.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specpodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinityrequiredduringschedulingignoredduringexecution"> spec.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specpodantiaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> spec.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector </h3> <p> <sup> <sup> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> spec.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> spec.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector </h3> <p> <sup> <sup> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> spec.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specpodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpodstartingpolicy"> spec.podStartingPolicy </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Mitigation setting for STS pods stuck in "ContainerCreating" </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> Whether to detect and attempt to mitigate pod startup issues <br/> </td> <td> true </td> </tr> <tr> <td> startingThresholdSeconds </td> <td> integer </td> <td> Time in seconds to wait for a pod to be stuck while starting up before action is taken. If set to 0, will be treated as if disabled. <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specpodtolerations"> spec.podTolerations[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> effect </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tolerationSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specpullsecrets"> spec.pullSecrets[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> Secret name <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributes"> spec.redisEnterpriseAdditionalPodSpecAttributes </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> ADVANCED USAGE USE AT YOUR OWN RISK - specify pod attributes that are required for the statefulset - Redis Enterprise pods. Pod attributes managed by the operator might override these settings. Also make sure the attributes are supported by the K8s version running on the cluster - the operator does not validate that. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> activeDeadlineSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinity"> affinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> automountServiceAccountToken </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesdnsconfig"> dnsConfig </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> dnsPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> enableServiceLinks </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ephemeralContainers </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributeshostaliases"> hostAliases </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostIPC </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostNetwork </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostPID </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostUsers </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostname </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesimagepullsecrets"> imagePullSecrets </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> initContainers </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> nodeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> nodeSelector </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesos"> os </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> overhead </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> preemptionPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> priority </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> priorityClassName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesreadinessgates"> readinessGates </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesresourceclaims"> resourceClaims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> restartPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runtimeClassName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> schedulerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesschedulinggates"> schedulingGates </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontext"> securityContext </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> serviceAccount </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> serviceAccountName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> setHostnameAsFQDN </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> shareProcessNamespace </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subdomain </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributestolerations"> tolerations </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributestopologyspreadconstraints"> topologySpreadConstraints </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> volumes </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinity"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinity"> nodeAffinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinity"> podAffinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinity"> podAntiAffinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinity"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecution"> preferredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecution"> requiredDuringSchedulingIgnoredDuringExecution </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecution"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> preference </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> weight </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[].preference </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchfields"> matchFields </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[].preference.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchfields"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[].preference.matchFields[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecution"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> nodeSelectorTerms </a> </td> <td> []object </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchfields"> matchFields </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[].matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchfields"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[].matchFields[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinity"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecution"> preferredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> requiredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecution"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> podAffinityTerm </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> weight </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinity"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecution"> preferredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> requiredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecution"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> podAffinityTerm </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> weight </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesdnsconfig"> spec.redisEnterpriseAdditionalPodSpecAttributes.dnsConfig </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> nameservers </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesdnsconfigoptions"> options </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> searches </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesdnsconfigoptions"> spec.redisEnterpriseAdditionalPodSpecAttributes.dnsConfig.options[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesdnsconfig"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainers"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> args </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenv"> env </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfrom"> envFrom </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycle"> lifecycle </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobe"> livenessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersports"> ports </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobe"> readinessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersresources"> resources </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontext"> securityContext </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobe"> startupProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdin </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdinOnce </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> targetContainerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tty </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersvolumedevices"> volumeDevices </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersvolumemounts"> volumeMounts </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> workingDir </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenv"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].env[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefrom"> valueFrom </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefrom"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenv"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromconfigmapkeyref"> configMapKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromsecretkeyref"> secretKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromconfigmapkeyref"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.configMapKeyRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromfieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.fieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromresourcefieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.resourceFieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefromsecretkeyref"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.secretKeyRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfrom"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].envFrom[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfromconfigmapref"> configMapRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> prefix </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfromsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfromconfigmapref"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].envFrom[].configMapRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfromsecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].envFrom[].secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycle"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststart"> postStart </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestop"> preStop </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststart"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststartexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststarttcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststartexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststarttcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestop"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestopexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestophttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestoptcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestopexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestophttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestophttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestophttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestophttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestoptcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobe"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobeexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobegrpc"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.grpc </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobehttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobehttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobetcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersports"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].ports[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> containerPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> hostIP </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protocol </td> <td> string </td> <td> <br/> <br/> <i> Default </i> : TCP <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobe"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobeexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobegrpc"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.grpc </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobehttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobehttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobetcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersresources"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].resources </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersresourcesclaims"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].resources.claims[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontext"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].securityContext </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> allowPrivilegeEscalation </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextcapabilities"> capabilities </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> privileged </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> procMount </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnlyRootFilesystem </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> runAsNonRoot </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUser </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextselinuxoptions"> seLinuxOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextseccompprofile"> seccompProfile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextwindowsoptions"> windowsOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextcapabilities"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.capabilities </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> add </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> drop </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextselinuxoptions"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.seLinuxOptions </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> level </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> role </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextseccompprofile"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.seccompProfile </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> localhostProfile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontextwindowsoptions"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.windowsOptions </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gmsaCredentialSpec </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> gmsaCredentialSpecName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostProcess </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUserName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobe"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobeexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobegrpc"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.grpc </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobehttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobehttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobetcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersvolumedevices"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].volumeDevices[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> devicePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesephemeralcontainersvolumemounts"> spec.redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers[].volumeMounts[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> mountPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mountPropagation </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPathExpr </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributeshostaliases"> spec.redisEnterpriseAdditionalPodSpecAttributes.hostAliases[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> hostnames </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> ip </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesimagepullsecrets"> spec.redisEnterpriseAdditionalPodSpecAttributes.imagePullSecrets[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainers"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> args </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenv"> env </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvfrom"> envFrom </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycle"> lifecycle </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobe"> livenessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersports"> ports </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobe"> readinessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersresources"> resources </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontext"> securityContext </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobe"> startupProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdin </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdinOnce </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tty </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersvolumedevices"> volumeDevices </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersvolumemounts"> volumeMounts </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> workingDir </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenv"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].env[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefrom"> valueFrom </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefrom"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].env[].valueFrom </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenv"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromconfigmapkeyref"> configMapKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromsecretkeyref"> secretKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromconfigmapkeyref"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.configMapKeyRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromfieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.fieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromresourcefieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.resourceFieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefromsecretkeyref"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.secretKeyRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvfrom"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].envFrom[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvfromconfigmapref"> configMapRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> prefix </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvfromsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvfromconfigmapref"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].envFrom[].configMapRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersenvfromsecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].envFrom[].secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecycle"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststart"> postStart </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestop"> preStop </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststart"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststartexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststarthttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststarttcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststartexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststarthttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststarthttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststarthttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststarthttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststarttcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestop"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestopexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestophttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestoptcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestopexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestophttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestophttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestophttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestophttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestoptcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobe"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].livenessProbe </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobeexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].livenessProbe.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobegrpc"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].livenessProbe.grpc </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobehttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].livenessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobehttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].livenessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobetcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].livenessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersports"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].ports[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> containerPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> hostIP </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protocol </td> <td> string </td> <td> <br/> <br/> <i> Default </i> : TCP <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobe"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].readinessProbe </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobeexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].readinessProbe.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobegrpc"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].readinessProbe.grpc </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobehttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].readinessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobehttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].readinessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobetcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].readinessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersresources"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].resources </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersresourcesclaims"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].resources.claims[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontext"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].securityContext </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> allowPrivilegeEscalation </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextcapabilities"> capabilities </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> privileged </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> procMount </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnlyRootFilesystem </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> runAsNonRoot </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUser </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextselinuxoptions"> seLinuxOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextseccompprofile"> seccompProfile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextwindowsoptions"> windowsOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextcapabilities"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].securityContext.capabilities </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> add </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> drop </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextselinuxoptions"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].securityContext.seLinuxOptions </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> level </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> role </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextseccompprofile"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].securityContext.seccompProfile </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> localhostProfile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontextwindowsoptions"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].securityContext.windowsOptions </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gmsaCredentialSpec </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> gmsaCredentialSpecName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostProcess </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUserName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobe"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].startupProbe </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobeexec"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].startupProbe.exec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobegrpc"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].startupProbe.grpc </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobehttpget"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].startupProbe.httpGet </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobehttpgethttpheaders"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].startupProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobetcpsocket"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].startupProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersvolumedevices"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].volumeDevices[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> devicePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesinitcontainersvolumemounts"> spec.redisEnterpriseAdditionalPodSpecAttributes.initContainers[].volumeMounts[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> mountPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mountPropagation </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPathExpr </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesos"> spec.redisEnterpriseAdditionalPodSpecAttributes.os </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesreadinessgates"> spec.redisEnterpriseAdditionalPodSpecAttributes.readinessGates[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> conditionType </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesresourceclaims"> spec.redisEnterpriseAdditionalPodSpecAttributes.resourceClaims[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesresourceclaimssource"> source </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesresourceclaimssource"> spec.redisEnterpriseAdditionalPodSpecAttributes.resourceClaims[].source </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesresourceclaims"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resourceClaimName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> resourceClaimTemplateName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesschedulinggates"> spec.redisEnterpriseAdditionalPodSpecAttributes.schedulingGates[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributessecuritycontext"> spec.redisEnterpriseAdditionalPodSpecAttributes.securityContext </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> fsGroupChangePolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> runAsNonRoot </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUser </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontextselinuxoptions"> seLinuxOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontextseccompprofile"> seccompProfile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> supplementalGroups </td> <td> []integer </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontextsysctls"> sysctls </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontextwindowsoptions"> windowsOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributessecuritycontextselinuxoptions"> spec.redisEnterpriseAdditionalPodSpecAttributes.securityContext.seLinuxOptions </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> level </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> role </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributessecuritycontextseccompprofile"> spec.redisEnterpriseAdditionalPodSpecAttributes.securityContext.seccompProfile </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> localhostProfile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributessecuritycontextsysctls"> spec.redisEnterpriseAdditionalPodSpecAttributes.securityContext.sysctls[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributessecuritycontextwindowsoptions"> spec.redisEnterpriseAdditionalPodSpecAttributes.securityContext.windowsOptions </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gmsaCredentialSpec </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> gmsaCredentialSpecName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostProcess </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUserName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributestolerations"> spec.redisEnterpriseAdditionalPodSpecAttributes.tolerations[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> effect </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tolerationSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributestopologyspreadconstraints"> spec.redisEnterpriseAdditionalPodSpecAttributes.topologySpreadConstraints[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> maxSkew </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> whenUnsatisfiable </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributestopologyspreadconstraintslabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabelKeys </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> minDomains </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> nodeAffinityPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> nodeTaintsPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributestopologyspreadconstraintslabelselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.topologySpreadConstraints[].labelSelector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributestopologyspreadconstraints"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributestopologyspreadconstraintslabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributestopologyspreadconstraintslabelselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.topologySpreadConstraints[].labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributestopologyspreadconstraintslabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumes"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesawselasticblockstore"> awsElasticBlockStore </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesazuredisk"> azureDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesazurefile"> azureFile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumescephfs"> cephfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumescinder"> cinder </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesconfigmap"> configMap </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumescsi"> csi </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesdownwardapi"> downwardAPI </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesemptydir"> emptyDir </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeral"> ephemeral </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesfc"> fc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesflexvolume"> flexVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesflocker"> flocker </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesgcepersistentdisk"> gcePersistentDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesgitrepo"> gitRepo </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesglusterfs"> glusterfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumeshostpath"> hostPath </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesiscsi"> iscsi </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesnfs"> nfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumespersistentvolumeclaim"> persistentVolumeClaim </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesphotonpersistentdisk"> photonPersistentDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesportworxvolume"> portworxVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojected"> projected </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesquobyte"> quobyte </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesrbd"> rbd </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesscaleio"> scaleIO </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumessecret"> secret </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesstorageos"> storageos </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesvspherevolume"> vsphereVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesawselasticblockstore"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].awsElasticBlockStore </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> partition </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesazuredisk"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].azureDisk </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> diskName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> diskURI </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> cachingMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> kind </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesazurefile"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].azureFile </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> secretName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> shareName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumescephfs"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].cephfs </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> monitors </td> <td> []string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> secretFile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumescephfssecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumescephfssecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].cephfs.secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumescephfs"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumescinder"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].cinder </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumescindersecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumescindersecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].cinder.secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumescinder"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesconfigmap"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].configMap </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesconfigmapitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesconfigmapitems"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].configMap.items[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesconfigmap"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumescsi"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].csi </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> driver </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumescsinodepublishsecretref"> nodePublishSecretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeAttributes </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumescsinodepublishsecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].csi.nodePublishSecretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumescsi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesdownwardapi"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].downwardAPI </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitems"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].downwardAPI.items[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesdownwardapi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitemsfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitemsresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitemsfieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].downwardAPI.items[].fieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitemsresourcefieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].downwardAPI.items[].resourceFieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesemptydir"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].emptyDir </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> medium </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> sizeLimit </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeral"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplate"> volumeClaimTemplate </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplate"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeral"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> spec </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> metadata </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplate"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> accessModes </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasource"> dataSource </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasourceref"> dataSourceRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresources"> resources </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselector"> selector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storageClassName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasource"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.dataSource </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> kind </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiGroup </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasourceref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.dataSourceRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> kind </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiGroup </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespace </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresources"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.resources </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresourcesclaims"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.resources.claims[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselector"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.selector </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselectormatchexpressions"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesfc"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].fc </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> lun </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> targetWWNs </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> wwids </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesflexvolume"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].flexVolume </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> driver </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> options </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesflexvolumesecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesflexvolumesecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].flexVolume.secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesflexvolume"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesflocker"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].flocker </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> datasetName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> datasetUUID </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesgcepersistentdisk"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].gcePersistentDisk </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> pdName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> partition </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesgitrepo"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].gitRepo </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> repository </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> directory </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> revision </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesglusterfs"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].glusterfs </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> endpoints </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumeshostpath"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].hostPath </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesiscsi"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].iscsi </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> iqn </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> lun </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> targetPortal </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> chapAuthDiscovery </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> chapAuthSession </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initiatorName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> iscsiInterface </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> portals </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesiscsisecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesiscsisecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].iscsi.secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesiscsi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesnfs"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].nfs </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> server </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumespersistentvolumeclaim"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].persistentVolumeClaim </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> claimName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesphotonpersistentdisk"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].photonPersistentDisk </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> pdID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesportworxvolume"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].portworxVolume </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojected"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsources"> sources </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsources"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojected"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesconfigmap"> configMap </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapi"> downwardAPI </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcessecret"> secret </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesserviceaccounttoken"> serviceAccountToken </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesconfigmap"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].configMap </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesconfigmapitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesconfigmapitems"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].configMap.items[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesconfigmap"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapi"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI.items[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsfieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI.items[].fieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsresourcefieldref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI.items[].resourceFieldRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcessecret"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].secret </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcessecretitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcessecretitems"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].secret.items[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcessecret"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesprojectedsourcesserviceaccounttoken"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].projected.sources[].serviceAccountToken </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> audience </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> expirationSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesquobyte"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].quobyte </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> registry </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> volume </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> group </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tenant </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesrbd"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].rbd </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> monitors </td> <td> []string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> keyring </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> pool </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesrbdsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesrbdsecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].rbd.secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesrbd"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesscaleio"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].scaleIO </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gateway </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesscaleiosecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> system </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protectionDomain </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> sslEnabled </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storageMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePool </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesscaleiosecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].scaleIO.secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesscaleio"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumessecret"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].secret </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumessecretitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> secretName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumessecretitems"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].secret.items[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumessecret"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesstorageos"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].storageos </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseadditionalpodspecattributesvolumesstorageossecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeNamespace </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesstorageossecretref"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].storageos.secretRef </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumesstorageos"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseadditionalpodspecattributesvolumesvspherevolume"> spec.redisEnterpriseAdditionalPodSpecAttributes.volumes[].vsphereVolume </h3> <p> <sup> <sup> <a href="#specredisenterpriseadditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePolicyID </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePolicyName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseimagespec"> spec.redisEnterpriseImageSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Specification for Redis Enterprise container image </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> digestHash </td> <td> string </td> <td> The digest hash of the container image to pull. When specified, the container image is pulled according to the digest hash instead of the image tag. The versionTag field must also be specified with the image tag matching this digest hash. Note: This field is only supported for OLM deployments. <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> The image pull policy to be applied to the container image. One of Always, Never, IfNotPresent. <br/> </td> <td> false </td> </tr> <tr> <td> repository </td> <td> string </td> <td> The repository (name) of the container image to be deployed. <br/> </td> <td> false </td> </tr> <tr> <td> versionTag </td> <td> string </td> <td> The tag of the container image to be deployed. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterprisenoderesources"> spec.redisEnterpriseNodeResources </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Compute resource requirements for Redis Enterprise containers </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterprisenoderesourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterprisenoderesourcesclaims"> spec.redisEnterpriseNodeResources.claims[] </h3> <p> <sup> <sup> <a href="#specredisenterprisenoderesources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfiguration"> spec.redisEnterpriseServicesConfiguration </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> RS Cluster optional services settings </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseservicesconfigurationcmserver"> cmServer </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesconfigurationcrdbcoordinator"> crdbCoordinator </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesconfigurationcrdbworker"> crdbWorker </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesconfigurationmdnsserver"> mdnsServer </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesconfigurationpdnsserver"> pdnsServer </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesconfigurationsaslauthd"> saslauthd </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specredisenterpriseservicesconfigurationstatsarchiver"> statsArchiver </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfigurationcmserver"> spec.redisEnterpriseServicesConfiguration.cmServer </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesconfiguration"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> operatingMode </td> <td> enum </td> <td> Whether to enable/disable the CM server <br/> <br/> <i> Enum </i> : enabled, disabled <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfigurationcrdbcoordinator"> spec.redisEnterpriseServicesConfiguration.crdbCoordinator </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesconfiguration"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> operatingMode </td> <td> enum </td> <td> Whether to enable/disable the crdb coordinator process <br/> <br/> <i> Enum </i> : enabled, disabled <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfigurationcrdbworker"> spec.redisEnterpriseServicesConfiguration.crdbWorker </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesconfiguration"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> operatingMode </td> <td> enum </td> <td> Whether to enable/disable the crdb worker processes <br/> <br/> <i> Enum </i> : enabled, disabled <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfigurationmdnsserver"> spec.redisEnterpriseServicesConfiguration.mdnsServer </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesconfiguration"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> operatingMode </td> <td> enum </td> <td> Whether to enable/disable the Multicast DNS server <br/> <br/> <i> Enum </i> : enabled, disabled <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfigurationpdnsserver"> spec.redisEnterpriseServicesConfiguration.pdnsServer </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesconfiguration"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> operatingMode </td> <td> enum </td> <td> Whether to enable/disable the pdns server <br/> <br/> <i> Enum </i> : enabled, disabled <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfigurationsaslauthd"> spec.redisEnterpriseServicesConfiguration.saslauthd </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesconfiguration"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> operatingMode </td> <td> enum </td> <td> Whether to enable/disable the saslauthd service <br/> <br/> <i> Enum </i> : enabled, disabled <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesconfigurationstatsarchiver"> spec.redisEnterpriseServicesConfiguration.statsArchiver </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesconfiguration"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> operatingMode </td> <td> enum </td> <td> Whether to enable/disable the stats archiver service <br/> <br/> <i> Enum </i> : enabled, disabled <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesriggerimagespec"> spec.redisEnterpriseServicesRiggerImageSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Specification for Services Rigger container image </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> digestHash </td> <td> string </td> <td> The digest hash of the container image to pull. When specified, the container image is pulled according to the digest hash instead of the image tag. The versionTag field must also be specified with the image tag matching this digest hash. Note: This field is only supported for OLM deployments. <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> The image pull policy to be applied to the container image. One of Always, Never, IfNotPresent. <br/> </td> <td> false </td> </tr> <tr> <td> repository </td> <td> string </td> <td> The repository (name) of the container image to be deployed. <br/> </td> <td> false </td> </tr> <tr> <td> versionTag </td> <td> string </td> <td> The tag of the container image to be deployed. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesriggerresources"> spec.redisEnterpriseServicesRiggerResources </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Compute resource requirements for Services Rigger pod </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specredisenterpriseservicesriggerresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisenterpriseservicesriggerresourcesclaims"> spec.redisEnterpriseServicesRiggerResources.claims[] </h3> <p> <sup> <sup> <a href="#specredisenterpriseservicesriggerresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specredisenterprisevolumemounts"> spec.redisEnterpriseVolumeMounts[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> mountPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mountPropagation </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPathExpr </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specredisonflashspec"> spec.redisOnFlashSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Stores configurations specific to redis on flash. If provided, the cluster will be capable of creating redis on flash databases. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> enabled </td> <td> boolean </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> storageClassName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> bigStoreDriver </td> <td> enum </td> <td> <br/> <br/> <i> Enum </i> : rocksdb, speedb <br/> </td> <td> false </td> </tr> <tr> <td> flashDiskSize </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> flashStorageEngine </td> <td> enum </td> <td> <br/> <br/> <i> Enum </i> : rocksdb <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservices"> spec.services </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Customization options for operator-managed service resources created for Redis Enterprise clusters and databases </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesapiservice"> apiService </a> </td> <td> object </td> <td> Customization options for the REC API service. <br/> </td> <td> false </td> </tr> <tr> <td> servicesAnnotations </td> <td> map[string]string </td> <td> Global additional annotations to set on service resources created by the operator. The specified annotations will not override annotations that already exist and didn't originate from the operator. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesapiservice"> spec.services.apiService </h3> <p> <sup> <sup> <a href="#specservices"> ↩ Parent </a> </sup> </sup> </p> <p> Customization options for the REC API service. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> enum </td> <td> Type of service to create for the REC API service. Defaults to ClusterIP service, if not specified otherwise. <br/> <br/> <i> Enum </i> : ClusterIP, NodePort, LoadBalancer <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspec"> spec.servicesRiggerSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Specification for service rigger </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> databaseServiceType </td> <td> string </td> <td> Service types for access to databases. should be a comma separated list. The possible values are cluster_ip, headless and load_balancer. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecextraenvvars"> extraEnvVars </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> podAnnotations </td> <td> map[string]string </td> <td> annotations for the service rigger pod <br/> </td> <td> false </td> </tr> <tr> <td> serviceNaming </td> <td> enum </td> <td> Used to determine how to name the services created automatically when a database is created. When bdb_name is used, the database name will be also used for the service name. When redis-port is used, the service will be named redis- <port> . <br/> <br/> <i> Enum </i> : bdb_name, redis-port <br/> </port> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> servicesRiggerAdditionalPodSpecAttributes </a> </td> <td> object </td> <td> ADVANCED USAGE USE AT YOUR OWN RISK - specify pod attributes that are required for the rigger deployment pod. Pod attributes managed by the operator might override these settings (Containers, serviceAccountName, podTolerations, ImagePullSecrets, nodeSelector, PriorityClassName, PodSecurityContext). Also make sure the attributes are supported by the K8s version running on the cluster - the operator does not validate that. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecextraenvvars"> spec.servicesRiggerSpec.extraEnvVars[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspec"> ↩ Parent </a> </sup> </sup> </p> <p> EnvVar represents an environment variable present in a Container. More info: <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/"> https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/ </a> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> Name of the environment variable. <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecextraenvvarsvaluefrom"> valueFrom </a> </td> <td> object </td> <td> Source for the environment variable's value. Cannot be used if value is not empty. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecextraenvvarsvaluefrom"> spec.servicesRiggerSpec.extraEnvVars[].valueFrom </h3> <p> <sup> <sup> <a href="#specservicesriggerspecextraenvvars"> ↩ Parent </a> </sup> </sup> </p> <p> Source for the environment variable's value. Cannot be used if value is not empty. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecextraenvvarsvaluefromconfigmapkeyref"> configMapKeyRef </a> </td> <td> object </td> <td> Selects a key of a ConfigMap. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecextraenvvarsvaluefromfieldref"> fieldRef </a> </td> <td> object </td> <td> Selects a field of the pod <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecextraenvvarsvaluefromresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> Selects a resource of the container: only resources limits and requests are currently supported. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecextraenvvarsvaluefromsecretkeyref"> secretKeyRef </a> </td> <td> object </td> <td> Selects a key of a secret in the pod's namespace <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecextraenvvarsvaluefromconfigmapkeyref"> spec.servicesRiggerSpec.extraEnvVars[].valueFrom.configMapKeyRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <p> Selects a key of a ConfigMap. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> The key to select. <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> Name of the referent <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> Specify whether the ConfigMap or its key must be defined <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecextraenvvarsvaluefromfieldref"> spec.servicesRiggerSpec.extraEnvVars[].valueFrom.fieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <p> Selects a field of the pod </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> Path of the field to select in the specified API version. <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> Version of the schema the FieldPath is written in terms of, defaults to "v1". <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecextraenvvarsvaluefromresourcefieldref"> spec.servicesRiggerSpec.extraEnvVars[].valueFrom.resourceFieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <p> Selects a resource of the container: only resources limits and requests are currently supported. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> Required: resource to select <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> Container name: required for volumes, optional for env vars <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> Specifies the output format of the exposed resources, defaults to "1" <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecextraenvvarsvaluefromsecretkeyref"> spec.servicesRiggerSpec.extraEnvVars[].valueFrom.secretKeyRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecextraenvvarsvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <p> Selects a key of a secret in the pod's namespace </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> The key of the secret to select from. Must be a valid secret key. <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> Name of the referent <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> Specify whether the Secret or its key must be defined <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributes"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes </h3> <p> <sup> <sup> <a href="#specservicesriggerspec"> ↩ Parent </a> </sup> </sup> </p> <p> ADVANCED USAGE USE AT YOUR OWN RISK - specify pod attributes that are required for the rigger deployment pod. Pod attributes managed by the operator might override these settings (Containers, serviceAccountName, podTolerations, ImagePullSecrets, nodeSelector, PriorityClassName, PodSecurityContext). Also make sure the attributes are supported by the K8s version running on the cluster - the operator does not validate that. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> activeDeadlineSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinity"> affinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> automountServiceAccountToken </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesdnsconfig"> dnsConfig </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> dnsPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> enableServiceLinks </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ephemeralContainers </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributeshostaliases"> hostAliases </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostIPC </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostNetwork </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostPID </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostUsers </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostname </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesimagepullsecrets"> imagePullSecrets </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> initContainers </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> nodeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> nodeSelector </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesos"> os </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> overhead </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> preemptionPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> priority </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> priorityClassName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesreadinessgates"> readinessGates </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesresourceclaims"> resourceClaims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> restartPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runtimeClassName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> schedulerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesschedulinggates"> schedulingGates </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontext"> securityContext </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> serviceAccount </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> serviceAccountName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> setHostnameAsFQDN </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> shareProcessNamespace </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subdomain </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributestolerations"> tolerations </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraints"> topologySpreadConstraints </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> volumes </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinity"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinity"> nodeAffinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinity"> podAffinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinity"> podAntiAffinity </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinity"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecution"> preferredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecution"> requiredDuringSchedulingIgnoredDuringExecution </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecution"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> preference </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> weight </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[].preference </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchfields"> matchFields </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[].preference.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreferencematchfields"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[].preference.matchFields[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinitypreferredduringschedulingignoredduringexecutionpreference"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecution"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> nodeSelectorTerms </a> </td> <td> []object </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchfields"> matchFields </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[].matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectortermsmatchfields"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[].matchFields[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitynodeaffinityrequiredduringschedulingignoredduringexecutionnodeselectorterms"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinity"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecution"> preferredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> requiredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecution"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> podAffinityTerm </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> weight </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinity"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecution"> preferredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> requiredDuringSchedulingIgnoredDuringExecution </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecution"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> podAffinityTerm </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> weight </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinityterm"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[].podAffinityTerm.namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinitypreferredduringschedulingignoredduringexecutionpodaffinitytermnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinity"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> namespaceSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespaces </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionlabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecution"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[].namespaceSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesaffinitypodantiaffinityrequiredduringschedulingignoredduringexecutionnamespaceselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesdnsconfig"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.dnsConfig </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> nameservers </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesdnsconfigoptions"> options </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> searches </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesdnsconfigoptions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.dnsConfig.options[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesdnsconfig"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> args </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenv"> env </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfrom"> envFrom </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycle"> lifecycle </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobe"> livenessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersports"> ports </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobe"> readinessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersresources"> resources </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontext"> securityContext </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobe"> startupProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdin </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdinOnce </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> targetContainerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tty </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersvolumedevices"> volumeDevices </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersvolumemounts"> volumeMounts </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> workingDir </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenv"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].env[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefrom"> valueFrom </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefrom"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenv"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromconfigmapkeyref"> configMapKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromsecretkeyref"> secretKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromconfigmapkeyref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.configMapKeyRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromfieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.fieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromresourcefieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.resourceFieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefromsecretkeyref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].env[].valueFrom.secretKeyRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfrom"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].envFrom[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfromconfigmapref"> configMapRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> prefix </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfromsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfromconfigmapref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].envFrom[].configMapRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfromsecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].envFrom[].secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycle"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststart"> postStart </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestop"> preStop </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststart"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststartexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststarttcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststartexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststarthttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststarttcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.postStart.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestop"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestopexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestophttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestoptcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestopexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestophttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestophttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestophttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestophttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestoptcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].lifecycle.preStop.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobe"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobeexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobegrpc"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.grpc </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobehttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobehttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobetcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].livenessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersports"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].ports[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> containerPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> hostIP </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protocol </td> <td> string </td> <td> <br/> <br/> <i> Default </i> : TCP <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobe"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobeexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobegrpc"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.grpc </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobehttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobehttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobetcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].readinessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersresources"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].resources </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersresourcesclaims"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].resources.claims[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontext"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].securityContext </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> allowPrivilegeEscalation </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextcapabilities"> capabilities </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> privileged </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> procMount </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnlyRootFilesystem </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> runAsNonRoot </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUser </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextselinuxoptions"> seLinuxOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextseccompprofile"> seccompProfile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextwindowsoptions"> windowsOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextcapabilities"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.capabilities </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> add </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> drop </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextselinuxoptions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.seLinuxOptions </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> level </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> role </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextseccompprofile"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.seccompProfile </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> localhostProfile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontextwindowsoptions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].securityContext.windowsOptions </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gmsaCredentialSpec </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> gmsaCredentialSpecName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostProcess </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUserName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobe"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobeexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobegrpc"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.grpc </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobehttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobehttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobetcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].startupProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersvolumedevices"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].volumeDevices[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> devicePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainersvolumemounts"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.ephemeralContainers[].volumeMounts[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesephemeralcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> mountPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mountPropagation </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPathExpr </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributeshostaliases"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.hostAliases[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> hostnames </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> ip </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesimagepullsecrets"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.imagePullSecrets[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> args </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenv"> env </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfrom"> envFrom </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycle"> lifecycle </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobe"> livenessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersports"> ports </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobe"> readinessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersresources"> resources </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontext"> securityContext </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobe"> startupProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdin </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdinOnce </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tty </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersvolumedevices"> volumeDevices </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersvolumemounts"> volumeMounts </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> workingDir </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenv"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].env[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefrom"> valueFrom </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefrom"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].env[].valueFrom </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenv"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromconfigmapkeyref"> configMapKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromsecretkeyref"> secretKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromconfigmapkeyref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.configMapKeyRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromfieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.fieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromresourcefieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.resourceFieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefromsecretkeyref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].env[].valueFrom.secretKeyRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfrom"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].envFrom[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfromconfigmapref"> configMapRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> prefix </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfromsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfromconfigmapref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].envFrom[].configMapRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfromsecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].envFrom[].secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycle"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststart"> postStart </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestop"> preStop </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststart"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststartexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststarthttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststarttcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststartexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststarthttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststarthttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststarthttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststarthttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststarttcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.postStart.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestop"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestopexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestophttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestoptcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestopexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestophttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestophttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestophttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestophttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestoptcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].lifecycle.preStop.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobe"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].livenessProbe </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobeexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].livenessProbe.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobegrpc"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].livenessProbe.grpc </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobehttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].livenessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobehttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].livenessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobetcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].livenessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerslivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersports"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].ports[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> containerPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> hostIP </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protocol </td> <td> string </td> <td> <br/> <br/> <i> Default </i> : TCP <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobe"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].readinessProbe </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobeexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].readinessProbe.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobegrpc"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].readinessProbe.grpc </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobehttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].readinessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobehttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].readinessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobetcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].readinessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersresources"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].resources </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersresourcesclaims"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].resources.claims[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontext"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].securityContext </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> allowPrivilegeEscalation </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextcapabilities"> capabilities </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> privileged </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> procMount </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnlyRootFilesystem </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> runAsNonRoot </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUser </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextselinuxoptions"> seLinuxOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextseccompprofile"> seccompProfile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextwindowsoptions"> windowsOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextcapabilities"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].securityContext.capabilities </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> add </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> drop </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextselinuxoptions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].securityContext.seLinuxOptions </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> level </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> role </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextseccompprofile"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].securityContext.seccompProfile </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> localhostProfile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontextwindowsoptions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].securityContext.windowsOptions </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainerssecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gmsaCredentialSpec </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> gmsaCredentialSpecName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostProcess </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUserName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobe"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].startupProbe </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobeexec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].startupProbe.exec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobegrpc"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].startupProbe.grpc </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobehttpget"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].startupProbe.httpGet </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobehttpgethttpheaders"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].startupProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobetcpsocket"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].startupProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersvolumedevices"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].volumeDevices[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> devicePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainersvolumemounts"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.initContainers[].volumeMounts[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesinitcontainers"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> mountPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mountPropagation </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPathExpr </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesos"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.os </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesreadinessgates"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.readinessGates[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> conditionType </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesresourceclaims"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.resourceClaims[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesresourceclaimssource"> source </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesresourceclaimssource"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.resourceClaims[].source </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesresourceclaims"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resourceClaimName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> resourceClaimTemplateName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesschedulinggates"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.schedulingGates[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontext"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.securityContext </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> fsGroupChangePolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> runAsNonRoot </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUser </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextselinuxoptions"> seLinuxOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextseccompprofile"> seccompProfile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> supplementalGroups </td> <td> []integer </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextsysctls"> sysctls </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextwindowsoptions"> windowsOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextselinuxoptions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.securityContext.seLinuxOptions </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> level </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> role </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextseccompprofile"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.securityContext.seccompProfile </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> localhostProfile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextsysctls"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.securityContext.sysctls[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontextwindowsoptions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.securityContext.windowsOptions </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributessecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gmsaCredentialSpec </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> gmsaCredentialSpecName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostProcess </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUserName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributestolerations"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.tolerations[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> effect </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tolerationSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraints"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.topologySpreadConstraints[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> maxSkew </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> topologyKey </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> whenUnsatisfiable </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraintslabelselector"> labelSelector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabelKeys </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> minDomains </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> nodeAffinityPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> nodeTaintsPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraintslabelselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.topologySpreadConstraints[].labelSelector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraints"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraintslabelselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraintslabelselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.topologySpreadConstraints[].labelSelector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributestopologyspreadconstraintslabelselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesawselasticblockstore"> awsElasticBlockStore </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesazuredisk"> azureDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesazurefile"> azureFile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescephfs"> cephfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescinder"> cinder </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesconfigmap"> configMap </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescsi"> csi </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapi"> downwardAPI </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesemptydir"> emptyDir </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeral"> ephemeral </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesfc"> fc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesflexvolume"> flexVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesflocker"> flocker </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesgcepersistentdisk"> gcePersistentDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesgitrepo"> gitRepo </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesglusterfs"> glusterfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumeshostpath"> hostPath </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesiscsi"> iscsi </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesnfs"> nfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumespersistentvolumeclaim"> persistentVolumeClaim </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesphotonpersistentdisk"> photonPersistentDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesportworxvolume"> portworxVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojected"> projected </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesquobyte"> quobyte </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesrbd"> rbd </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesscaleio"> scaleIO </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumessecret"> secret </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesstorageos"> storageos </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesvspherevolume"> vsphereVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesawselasticblockstore"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].awsElasticBlockStore </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> partition </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesazuredisk"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].azureDisk </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> diskName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> diskURI </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> cachingMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> kind </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesazurefile"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].azureFile </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> secretName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> shareName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescephfs"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].cephfs </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> monitors </td> <td> []string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> secretFile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescephfssecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescephfssecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].cephfs.secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescephfs"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescinder"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].cinder </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescindersecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescindersecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].cinder.secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescinder"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesconfigmap"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].configMap </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesconfigmapitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesconfigmapitems"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].configMap.items[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesconfigmap"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescsi"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].csi </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> driver </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescsinodepublishsecretref"> nodePublishSecretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeAttributes </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescsinodepublishsecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].csi.nodePublishSecretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumescsi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapi"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].downwardAPI </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitems"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].downwardAPI.items[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitemsfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitemsresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitemsfieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].downwardAPI.items[].fieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitemsresourcefieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].downwardAPI.items[].resourceFieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesemptydir"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].emptyDir </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> medium </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> sizeLimit </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeral"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplate"> volumeClaimTemplate </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplate"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeral"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> spec </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> metadata </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplate"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> accessModes </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasource"> dataSource </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasourceref"> dataSourceRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresources"> resources </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselector"> selector </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storageClassName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasource"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.dataSource </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> kind </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiGroup </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecdatasourceref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.dataSourceRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> kind </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiGroup </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> namespace </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresources"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.resources </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresourcesclaims"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.resources.claims[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselector"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.selector </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselectormatchexpressions"> matchExpressions </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> matchLabels </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselectormatchexpressions"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesephemeralvolumeclaimtemplatespecselector"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> operator </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> values </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesfc"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].fc </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> lun </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> targetWWNs </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> wwids </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesflexvolume"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].flexVolume </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> driver </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> options </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesflexvolumesecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesflexvolumesecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].flexVolume.secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesflexvolume"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesflocker"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].flocker </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> datasetName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> datasetUUID </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesgcepersistentdisk"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].gcePersistentDisk </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> pdName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> partition </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesgitrepo"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].gitRepo </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> repository </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> directory </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> revision </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesglusterfs"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].glusterfs </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> endpoints </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumeshostpath"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].hostPath </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesiscsi"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].iscsi </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> iqn </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> lun </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> targetPortal </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> chapAuthDiscovery </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> chapAuthSession </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initiatorName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> iscsiInterface </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> portals </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesiscsisecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesiscsisecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].iscsi.secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesiscsi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesnfs"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].nfs </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> server </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumespersistentvolumeclaim"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].persistentVolumeClaim </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> claimName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesphotonpersistentdisk"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].photonPersistentDisk </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> pdID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesportworxvolume"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].portworxVolume </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojected"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsources"> sources </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsources"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojected"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesconfigmap"> configMap </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapi"> downwardAPI </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcessecret"> secret </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesserviceaccounttoken"> serviceAccountToken </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesconfigmap"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].configMap </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesconfigmapitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesconfigmapitems"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].configMap.items[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesconfigmap"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapi"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI.items[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsfieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI.items[].fieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitemsresourcefieldref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].downwardAPI.items[].resourceFieldRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcessecret"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].secret </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcessecretitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcessecretitems"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].secret.items[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcessecret"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsourcesserviceaccounttoken"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].projected.sources[].serviceAccountToken </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> audience </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> expirationSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesquobyte"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].quobyte </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> registry </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> volume </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> group </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tenant </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesrbd"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].rbd </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> monitors </td> <td> []string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> keyring </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> pool </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesrbdsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesrbdsecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].rbd.secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesrbd"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesscaleio"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].scaleIO </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gateway </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesscaleiosecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> system </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protectionDomain </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> sslEnabled </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storageMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePool </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesscaleiosecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].scaleIO.secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesscaleio"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumessecret"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].secret </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumessecretitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> secretName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumessecretitems"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].secret.items[] </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumessecret"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesstorageos"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].storageos </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesstorageossecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeNamespace </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesstorageossecretref"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].storageos.secretRef </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesstorageos"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specservicesriggerspecservicesriggeradditionalpodspecattributesvolumesvspherevolume"> spec.servicesRiggerSpec.servicesRiggerAdditionalPodSpecAttributes.volumes[].vsphereVolume </h3> <p> <sup> <sup> <a href="#specservicesriggerspecservicesriggeradditionalpodspecattributesvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePolicyID </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePolicyName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspec"> spec.sideContainersSpec[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> args </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecenv"> env </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecenvfrom"> envFrom </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> imagePullPolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecycle"> lifecycle </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclivenessprobe"> livenessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecports"> ports </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecreadinessprobe"> readinessProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecresources"> resources </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecsecuritycontext"> securityContext </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecstartupprobe"> startupProbe </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdin </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> stdinOnce </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationMessagePolicy </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tty </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecvolumedevices"> volumeDevices </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecvolumemounts"> volumeMounts </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> workingDir </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenv"> spec.sideContainersSpec[].env[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecenvvaluefrom"> valueFrom </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvvaluefrom"> spec.sideContainersSpec[].env[].valueFrom </h3> <p> <sup> <sup> <a href="#specsidecontainersspecenv"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspecenvvaluefromconfigmapkeyref"> configMapKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecenvvaluefromfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecenvvaluefromresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecenvvaluefromsecretkeyref"> secretKeyRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvvaluefromconfigmapkeyref"> spec.sideContainersSpec[].env[].valueFrom.configMapKeyRef </h3> <p> <sup> <sup> <a href="#specsidecontainersspecenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvvaluefromfieldref"> spec.sideContainersSpec[].env[].valueFrom.fieldRef </h3> <p> <sup> <sup> <a href="#specsidecontainersspecenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvvaluefromresourcefieldref"> spec.sideContainersSpec[].env[].valueFrom.resourceFieldRef </h3> <p> <sup> <sup> <a href="#specsidecontainersspecenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvvaluefromsecretkeyref"> spec.sideContainersSpec[].env[].valueFrom.secretKeyRef </h3> <p> <sup> <sup> <a href="#specsidecontainersspecenvvaluefrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvfrom"> spec.sideContainersSpec[].envFrom[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspecenvfromconfigmapref"> configMapRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> prefix </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecenvfromsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvfromconfigmapref"> spec.sideContainersSpec[].envFrom[].configMapRef </h3> <p> <sup> <sup> <a href="#specsidecontainersspecenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecenvfromsecretref"> spec.sideContainersSpec[].envFrom[].secretRef </h3> <p> <sup> <sup> <a href="#specsidecontainersspecenvfrom"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecycle"> spec.sideContainersSpec[].lifecycle </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspeclifecyclepoststart"> postStart </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecycleprestop"> preStop </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecyclepoststart"> spec.sideContainersSpec[].lifecycle.postStart </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspeclifecyclepoststartexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecyclepoststarthttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecyclepoststarttcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecyclepoststartexec"> spec.sideContainersSpec[].lifecycle.postStart.exec </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecyclepoststarthttpget"> spec.sideContainersSpec[].lifecycle.postStart.httpGet </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecyclepoststarthttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecyclepoststarthttpgethttpheaders"> spec.sideContainersSpec[].lifecycle.postStart.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecyclepoststarthttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecyclepoststarttcpsocket"> spec.sideContainersSpec[].lifecycle.postStart.tcpSocket </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecyclepoststart"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecycleprestop"> spec.sideContainersSpec[].lifecycle.preStop </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecycle"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspeclifecycleprestopexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecycleprestophttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecycleprestoptcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecycleprestopexec"> spec.sideContainersSpec[].lifecycle.preStop.exec </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecycleprestophttpget"> spec.sideContainersSpec[].lifecycle.preStop.httpGet </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclifecycleprestophttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecycleprestophttpgethttpheaders"> spec.sideContainersSpec[].lifecycle.preStop.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecycleprestophttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclifecycleprestoptcpsocket"> spec.sideContainersSpec[].lifecycle.preStop.tcpSocket </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclifecycleprestop"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclivenessprobe"> spec.sideContainersSpec[].livenessProbe </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspeclivenessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclivenessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclivenessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclivenessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclivenessprobeexec"> spec.sideContainersSpec[].livenessProbe.exec </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclivenessprobegrpc"> spec.sideContainersSpec[].livenessProbe.grpc </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclivenessprobehttpget"> spec.sideContainersSpec[].livenessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspeclivenessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclivenessprobehttpgethttpheaders"> spec.sideContainersSpec[].livenessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclivenessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specsidecontainersspeclivenessprobetcpsocket"> spec.sideContainersSpec[].livenessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specsidecontainersspeclivenessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecports"> spec.sideContainersSpec[].ports[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> containerPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> hostIP </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostPort </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protocol </td> <td> string </td> <td> <br/> <br/> <i> Default </i> : TCP <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecreadinessprobe"> spec.sideContainersSpec[].readinessProbe </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspecreadinessprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecreadinessprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecreadinessprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecreadinessprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecreadinessprobeexec"> spec.sideContainersSpec[].readinessProbe.exec </h3> <p> <sup> <sup> <a href="#specsidecontainersspecreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecreadinessprobegrpc"> spec.sideContainersSpec[].readinessProbe.grpc </h3> <p> <sup> <sup> <a href="#specsidecontainersspecreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecreadinessprobehttpget"> spec.sideContainersSpec[].readinessProbe.httpGet </h3> <p> <sup> <sup> <a href="#specsidecontainersspecreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecreadinessprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecreadinessprobehttpgethttpheaders"> spec.sideContainersSpec[].readinessProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspecreadinessprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecreadinessprobetcpsocket"> spec.sideContainersSpec[].readinessProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specsidecontainersspecreadinessprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecresources"> spec.sideContainersSpec[].resources </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspecresourcesclaims"> claims </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> limits </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> requests </td> <td> map[string]int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecresourcesclaims"> spec.sideContainersSpec[].resources.claims[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspecresources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecsecuritycontext"> spec.sideContainersSpec[].securityContext </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> allowPrivilegeEscalation </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecsecuritycontextcapabilities"> capabilities </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> privileged </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> procMount </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnlyRootFilesystem </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsGroup </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> runAsNonRoot </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUser </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecsecuritycontextselinuxoptions"> seLinuxOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecsecuritycontextseccompprofile"> seccompProfile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecsecuritycontextwindowsoptions"> windowsOptions </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecsecuritycontextcapabilities"> spec.sideContainersSpec[].securityContext.capabilities </h3> <p> <sup> <sup> <a href="#specsidecontainersspecsecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> add </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> drop </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecsecuritycontextselinuxoptions"> spec.sideContainersSpec[].securityContext.seLinuxOptions </h3> <p> <sup> <sup> <a href="#specsidecontainersspecsecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> level </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> role </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecsecuritycontextseccompprofile"> spec.sideContainersSpec[].securityContext.seccompProfile </h3> <p> <sup> <sup> <a href="#specsidecontainersspecsecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> localhostProfile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecsecuritycontextwindowsoptions"> spec.sideContainersSpec[].securityContext.windowsOptions </h3> <p> <sup> <sup> <a href="#specsidecontainersspecsecuritycontext"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gmsaCredentialSpec </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> gmsaCredentialSpecName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> hostProcess </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> runAsUserName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecstartupprobe"> spec.sideContainersSpec[].startupProbe </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specsidecontainersspecstartupprobeexec"> exec </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> failureThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecstartupprobegrpc"> grpc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecstartupprobehttpget"> httpGet </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initialDelaySeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> periodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> successThreshold </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecstartupprobetcpsocket"> tcpSocket </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> terminationGracePeriodSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> <tr> <td> timeoutSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecstartupprobeexec"> spec.sideContainersSpec[].startupProbe.exec </h3> <p> <sup> <sup> <a href="#specsidecontainersspecstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> command </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecstartupprobegrpc"> spec.sideContainersSpec[].startupProbe.grpc </h3> <p> <sup> <sup> <a href="#specsidecontainersspecstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> service </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecstartupprobehttpget"> spec.sideContainersSpec[].startupProbe.httpGet </h3> <p> <sup> <sup> <a href="#specsidecontainersspecstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specsidecontainersspecstartupprobehttpgethttpheaders"> httpHeaders </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> scheme </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecstartupprobehttpgethttpheaders"> spec.sideContainersSpec[].startupProbe.httpGet.httpHeaders[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspecstartupprobehttpget"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> value </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecstartupprobetcpsocket"> spec.sideContainersSpec[].startupProbe.tcpSocket </h3> <p> <sup> <sup> <a href="#specsidecontainersspecstartupprobe"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> port </td> <td> int or string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> host </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecvolumedevices"> spec.sideContainersSpec[].volumeDevices[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> devicePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specsidecontainersspecvolumemounts"> spec.sideContainersSpec[].volumeMounts[] </h3> <p> <sup> <sup> <a href="#specsidecontainersspec"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> mountPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mountPropagation </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPath </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> subPathExpr </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specslaveha"> spec.slaveHA </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Slave high availability mechanism configuration. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> slaveHAGracePeriod </td> <td> integer </td> <td> Time in seconds between when a node fails, and when slave high availability mechanism starts relocating shards. If set to 0, will not affect cluster configuration. <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specupgradespec"> spec.upgradeSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Specification for upgrades of Redis Enterprise </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> autoUpgradeRedisEnterprise </td> <td> boolean </td> <td> Whether to upgrade Redis Enterprise automatically when operator is upgraded <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specvolumes"> spec.volumes[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ Parent </a> </sup> </sup> </p> <p> Volume represents a named volume in a pod that may be accessed by any container in the pod. More info: <a href="https://kubernetes.io/docs/concepts/storage/volumes"> https://kubernetes.io/docs/concepts/storage/volumes </a> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specvolumesawselasticblockstore"> awsElasticBlockStore </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesazuredisk"> azureDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesazurefile"> azureFile </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumescephfs"> cephfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumescinder"> cinder </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesconfigmap"> configMap </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumescsi"> csi </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesdownwardapi"> downwardAPI </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesemptydir"> emptyDir </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesfc"> fc </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesflexvolume"> flexVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesflocker"> flocker </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesgcepersistentdisk"> gcePersistentDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesgitrepo"> gitRepo </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesglusterfs"> glusterfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumeshostpath"> hostPath </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesiscsi"> iscsi </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesnfs"> nfs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumespersistentvolumeclaim"> persistentVolumeClaim </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesphotonpersistentdisk"> photonPersistentDisk </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesportworxvolume"> portworxVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesprojected"> projected </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesquobyte"> quobyte </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesrbd"> rbd </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesscaleio"> scaleIO </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumessecret"> secret </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesstorageos"> storageos </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesvspherevolume"> vsphereVolume </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesawselasticblockstore"> spec.volumes[].awsElasticBlockStore </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> partition </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesazuredisk"> spec.volumes[].azureDisk </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> diskName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> diskURI </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> cachingMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> kind </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesazurefile"> spec.volumes[].azureFile </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> secretName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> shareName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumescephfs"> spec.volumes[].cephfs </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> monitors </td> <td> []string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> secretFile </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumescephfssecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumescephfssecretref"> spec.volumes[].cephfs.secretRef </h3> <p> <sup> <sup> <a href="#specvolumescephfs"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumescinder"> spec.volumes[].cinder </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumescindersecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumescindersecretref"> spec.volumes[].cinder.secretRef </h3> <p> <sup> <sup> <a href="#specvolumescinder"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesconfigmap"> spec.volumes[].configMap </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesconfigmapitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesconfigmapitems"> spec.volumes[].configMap.items[] </h3> <p> <sup> <sup> <a href="#specvolumesconfigmap"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumescsi"> spec.volumes[].csi </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> driver </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumescsinodepublishsecretref"> nodePublishSecretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeAttributes </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumescsinodepublishsecretref"> spec.volumes[].csi.nodePublishSecretRef </h3> <p> <sup> <sup> <a href="#specvolumescsi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesdownwardapi"> spec.volumes[].downwardAPI </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesdownwardapiitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesdownwardapiitems"> spec.volumes[].downwardAPI.items[] </h3> <p> <sup> <sup> <a href="#specvolumesdownwardapi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specvolumesdownwardapiitemsfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesdownwardapiitemsresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesdownwardapiitemsfieldref"> spec.volumes[].downwardAPI.items[].fieldRef </h3> <p> <sup> <sup> <a href="#specvolumesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesdownwardapiitemsresourcefieldref"> spec.volumes[].downwardAPI.items[].resourceFieldRef </h3> <p> <sup> <sup> <a href="#specvolumesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesemptydir"> spec.volumes[].emptyDir </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> medium </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> sizeLimit </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesfc"> spec.volumes[].fc </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> lun </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> targetWWNs </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> wwids </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesflexvolume"> spec.volumes[].flexVolume </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> driver </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> options </td> <td> map[string]string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesflexvolumesecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesflexvolumesecretref"> spec.volumes[].flexVolume.secretRef </h3> <p> <sup> <sup> <a href="#specvolumesflexvolume"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesflocker"> spec.volumes[].flocker </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> datasetName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> datasetUUID </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesgcepersistentdisk"> spec.volumes[].gcePersistentDisk </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> pdName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> partition </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesgitrepo"> spec.volumes[].gitRepo </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> repository </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> directory </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> revision </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesglusterfs"> spec.volumes[].glusterfs </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> endpoints </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumeshostpath"> spec.volumes[].hostPath </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> type </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesiscsi"> spec.volumes[].iscsi </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> iqn </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> lun </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> true </td> </tr> <tr> <td> targetPortal </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> chapAuthDiscovery </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> chapAuthSession </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> initiatorName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> iscsiInterface </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> portals </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesiscsisecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesiscsisecretref"> spec.volumes[].iscsi.secretRef </h3> <p> <sup> <sup> <a href="#specvolumesiscsi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesnfs"> spec.volumes[].nfs </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> server </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumespersistentvolumeclaim"> spec.volumes[].persistentVolumeClaim </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> claimName </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesphotonpersistentdisk"> spec.volumes[].photonPersistentDisk </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> pdID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesportworxvolume"> spec.volumes[].portworxVolume </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumeID </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojected"> spec.volumes[].projected </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specvolumesprojectedsources"> sources </a> </td> <td> []object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsources"> spec.volumes[].projected.sources[] </h3> <p> <sup> <sup> <a href="#specvolumesprojected"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specvolumesprojectedsourcesconfigmap"> configMap </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesprojectedsourcesdownwardapi"> downwardAPI </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesprojectedsourcessecret"> secret </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesprojectedsourcesserviceaccounttoken"> serviceAccountToken </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcesconfigmap"> spec.volumes[].projected.sources[].configMap </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specvolumesprojectedsourcesconfigmapitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcesconfigmapitems"> spec.volumes[].projected.sources[].configMap.items[] </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsourcesconfigmap"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcesdownwardapi"> spec.volumes[].projected.sources[].downwardAPI </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specvolumesprojectedsourcesdownwardapiitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcesdownwardapiitems"> spec.volumes[].projected.sources[].downwardAPI.items[] </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsourcesdownwardapi"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specvolumesprojectedsourcesdownwardapiitemsfieldref"> fieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesprojectedsourcesdownwardapiitemsresourcefieldref"> resourceFieldRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcesdownwardapiitemsfieldref"> spec.volumes[].projected.sources[].downwardAPI.items[].fieldRef </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsourcesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fieldPath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> apiVersion </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcesdownwardapiitemsresourcefieldref"> spec.volumes[].projected.sources[].downwardAPI.items[].resourceFieldRef </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsourcesdownwardapiitems"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> resource </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> containerName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> divisor </td> <td> int or string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcessecret"> spec.volumes[].projected.sources[].secret </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#specvolumesprojectedsourcessecretitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcessecretitems"> spec.volumes[].projected.sources[].secret.items[] </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsourcessecret"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesprojectedsourcesserviceaccounttoken"> spec.volumes[].projected.sources[].serviceAccountToken </h3> <p> <sup> <sup> <a href="#specvolumesprojectedsources"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> audience </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> expirationSeconds </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int64 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesquobyte"> spec.volumes[].quobyte </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> registry </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> volume </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> group </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> tenant </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesrbd"> spec.volumes[].rbd </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> image </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> monitors </td> <td> []string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> keyring </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> pool </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesrbdsecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> user </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesrbdsecretref"> spec.volumes[].rbd.secretRef </h3> <p> <sup> <sup> <a href="#specvolumesrbd"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesscaleio"> spec.volumes[].scaleIO </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> gateway </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> <a href="#specvolumesscaleiosecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> system </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> protectionDomain </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> sslEnabled </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storageMode </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePool </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesscaleiosecretref"> spec.volumes[].scaleIO.secretRef </h3> <p> <sup> <sup> <a href="#specvolumesscaleio"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumessecret"> spec.volumes[].secret </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> defaultMode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumessecretitems"> items </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> optional </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> secretName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumessecretitems"> spec.volumes[].secret.items[] </h3> <p> <sup> <sup> <a href="#specvolumessecret"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> key </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> path </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> mode </td> <td> integer </td> <td> <br/> <br/> <i> Format </i> : int32 <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesstorageos"> spec.volumes[].storageos </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> readOnly </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specvolumesstorageossecretref"> secretRef </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> volumeNamespace </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesstorageossecretref"> spec.volumes[].storageos.secretRef </h3> <p> <sup> <sup> <a href="#specvolumesstorageos"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specvolumesvspherevolume"> spec.volumes[].vsphereVolume </h3> <p> <sup> <sup> <a href="#specvolumes"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> volumePath </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> fsType </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePolicyID </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> storagePolicyName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="status"> status </h3> <p> <sup> <sup> <a href="#"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#statusbundleddatabaseversions"> bundledDatabaseVersions </a> </td> <td> []object </td> <td> Versions of open source databases bundled by Redis Enterprise Software - please note that in order to use a specific version it should be supported by the ‘upgradePolicy’ - ‘major’ or ‘latest’ according to the desired version (major/minor) <br/> </td> <td> false </td> </tr> <tr> <td> ingressOrRouteMethodStatus </td> <td> string </td> <td> The ingressOrRouteSpec/ActiveActive spec method that exist <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statuslicensestatus"> licenseStatus </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statusmanagedapis"> managedAPIs </a> </td> <td> object </td> <td> Indicates cluster APIs that are being managed by the operator. This only applies to cluster APIs which are optionally-managed by the operator, such as cluster LDAP configuration. Most other APIs are automatically managed by the operator, and are not listed here. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statusmodules"> modules </a> </td> <td> []object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statusocspstatus"> ocspStatus </a> </td> <td> object </td> <td> An API object that represents the cluster's OCSP status <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statuspersistencestatus"> persistenceStatus </a> </td> <td> object </td> <td> The status of the Persistent Volume Claims that are used for Redis Enterprise Cluster persistence. The status will correspond to the status of one or more of the PVCs (failed/resizing if one of them is in resize or failed to resize) <br/> </td> <td> false </td> </tr> <tr> <td> redisEnterpriseIPFamily </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> specStatus </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> state </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusbundleddatabaseversions"> status.bundledDatabaseVersions[] </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> dbType </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> version </td> <td> string </td> <td> <br/> </td> <td> true </td> </tr> <tr> <td> major </td> <td> boolean </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statuslicensestatus"> status.licenseStatus </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> activationDate </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> expirationDate </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> licenseState </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> shardsLimit </td> <td> integer </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusmanagedapis"> status.managedAPIs </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <p> Indicates cluster APIs that are being managed by the operator. This only applies to cluster APIs which are optionally-managed by the operator, such as cluster LDAP configuration. Most other APIs are automatically managed by the operator, and are not listed here. </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> ldap </td> <td> boolean </td> <td> Indicate whether cluster LDAP configuration is managed by the operator. When this is enabled, the operator will reconcile the cluster LDAP configuration according to the '.spec.ldap' field in the RedisEnterpriseCluster resource. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusmodules"> status.modules[] </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> displayName </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> name </td> <td> string </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> versions </td> <td> []string </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusocspstatus"> status.ocspStatus </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <p> An API object that represents the cluster's OCSP status </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> certStatus </td> <td> string </td> <td> Indicates the proxy certificate status - GOOD/REVOKED/UNKNOWN. <br/> </td> <td> false </td> </tr> <tr> <td> nextUpdate </td> <td> string </td> <td> The time at or before which newer information will be available about the status of the certificate (if available) <br/> </td> <td> false </td> </tr> <tr> <td> producedAt </td> <td> string </td> <td> The time at which the OCSP responder signed this response. <br/> </td> <td> false </td> </tr> <tr> <td> responderUrl </td> <td> string </td> <td> The OCSP responder url from which this status came from. <br/> </td> <td> false </td> </tr> <tr> <td> revocationTime </td> <td> string </td> <td> The time at which the certificate was revoked or placed on hold. <br/> </td> <td> false </td> </tr> <tr> <td> thisUpdate </td> <td> string </td> <td> The most recent time at which the status being indicated is known by the responder to have been correct. <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statuspersistencestatus"> status.persistenceStatus </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <p> The status of the Persistent Volume Claims that are used for Redis Enterprise Cluster persistence. The status will correspond to the status of one or more of the PVCs (failed/resizing if one of them is in resize or failed to resize) </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> status </td> <td> string </td> <td> The current status of the PVCs <br/> </td> <td> false </td> </tr> <tr> <td> succeeded </td> <td> string </td> <td> The number of PVCs that are provisioned with the expected size <br/> </td> <td> false </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/reference/redis_enterprise_cluster_api/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.6-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisJSON 2.6 release notes </h1> <p class="text-lg -mt-5 mb-10"> RESP3 support. New commands JSON.MERGE and JSON.MSET. </p> <h2 id="requirements"> Requirements </h2> <p> RedisJSON v2.6.12 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 7.2 </li> <li> Minimum Redis Enterprise Software version (cluster): 7.2.4 </li> </ul> <h2 id="v2612-september-2024"> v2.6.12 (September 2024) </h2> <p> This is a maintenance release for RedisJSON 2.6 </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/redisjson/redisjson/pull/1225"> #1225 </a> Crash on SET commands with recursive overlapping paths (MOD-7279) </li> <li> HDT#261 (Redis Enterprise A-A only) Crash when a JSON contains an EOF character (MOD-7464) </li> </ul> </li> </ul> <h2 id="v2610-april-2024"> v2.6.10 (April 2024) </h2> <p> This is a maintenance release for RedisJSON 2.6. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/1192"> #1192 </a> Crashes with numeric values greater than i64::MAX (MOD-6501, MOD-4551, MOD-4856, MOD-5714) </li> <li> HDT#228 (Redis Enterprise A-A only) Incorrect error when processing escaped characters (MOD-6645) </li> </ul> </li> </ul> <h2 id="v269-january-2024"> v2.6.9 (January 2024) </h2> <p> This is a maintenance release for RedisJSON 2.6. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/issues/1131"> #1131 </a> , <a href="https://github.com/RedisJSON/RedisJSON/pull/1143"> #1143 </a> <strong> BREAKING </strong> - Revert JSONPath default path value from <code> $ </code> to <code> . </code> under RESP3 (MOD-6156) </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/1095"> #1095 </a> Fix for RediSearch deadlock. See RediSearch 2.8.10 release notes (MOD-5895) </li> </ul> </li> </ul> <h2 id="v268-november-2023"> v2.6.8 (November 2023) </h2> <p> This is a maintenance release for RedisJSON 2.6. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <p> Details: </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> RHEL 7 is no longer supported as of v2.6.8. </div> </div> <p> This is a version number alignment with RedisJSON for Redis Enterprise (with Active-Active support). </p> <h2 id="v267-october-2023"> v2.6.7 (October 2023) </h2> <p> This is a maintenance release for RedisJSON 2.6. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <p> Details: </p> <ul> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/1102"> #1102 </a> Added support for CBL-Mariner 2 </li> <li> <a href="https://github.com/RedisJSON/RedisJSON/pull/1099"> #1099 </a> Added support for RHEL9 and Rocky Linux 9 </li> </ul> </li> </ul> <h2 id="v266-august-2023"> v2.6.6 (August 2023) </h2> <p> This is a maintenance release for RedisJSON 2.6. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <p> Details: </p> <p> This is just a version number alignment with RedisJSON for Redis Enterprise (with Active-Active support). </p> <h2 id="v26-ga-v264-july-2023"> v2.6 GA (v2.6.4) (July 2023) </h2> <p> This is the General Availability release of RedisJSON 2.6. </p> <h3 id="headlines"> Headlines </h3> <p> RedisJSON 2.6 introduces support for RESP3 and new commands. </p> <h3 id="whats-new-in-26"> What's new in 2.6 </h3> <ul> <li> <p> Introduce <a href="/docs/latest/commands/json.merge"> <code> JSON.MERGE </code> </a> in compliance with <a href="https://datatracker.ietf.org/doc/html/rfc7396"> RFC 7396 </a> , supporting: </p> <ul> <li> <p> Creating new attributes on an existing JSON document </p> </li> <li> <p> Updating and replacing values in parent and child attributes </p> </li> <li> <p> Deleting existing attributes (by setting the value to <code> null </code> ) </p> </li> <li> <p> Array update - replacing an entire array with the new value </p> </li> </ul> </li> <li> <p> Introduce <a href="/docs/latest/commands/json.mset"> <code> JSON.MSET </code> </a> , supporting atomic multiple sets for keys in the same hash slot </p> </li> <li> <p> New <code> FORMAT </code> argument in <code> JSON.ARRPOP </code> and <code> JSON.GET </code> to retrieve the results as JSON strings or RESP3 hierarchical structures (RESP3 only) </p> </li> <li> <p> <code> JSON.RESP </code> is now regarded as deprecated </p> </li> <li> <p> Legacy paths (paths that don't start with either <code> $. </code> or <code> $[ </code> or equal to <code> $ </code> ), except those starting with <code> . </code> , are now deprecated </p> </li> </ul> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <ul> <li> <p> The version inside Redis will be 2.6.4 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a GA flag. </p> </li> <li> <p> Minimal Redis version: 7.2 </p> </li> </ul> </div> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.6-release-notes/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/ocsp/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin cluster ocsp </h1> <p class="text-lg -mt-5 mb-10"> Manages OCSP. </p> <p> Manages OCSP configuration and verifies the status of a server certificate maintained by a third-party <a href="https://en.wikipedia.org/wiki/Certificate_authority"> certificate authority (CA) </a> . </p> <h2 id="ocsp-certificate_compatible"> <code> ocsp certificate_compatible </code> </h2> <p> Checks if the proxy certificate contains an OCSP URI. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster ocsp certificate_compatible </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <p> None </p> <h3 id="returns"> Returns </h3> <p> Returns the OCSP URI if it exists. Otherwise, it returns an error. </p> <h3 id="example"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster ocsp certificate_compatible </span></span><span class="line"><span class="cl">Success. OCSP URI is http://responder.ocsp.url.com </span></span></code></pre> </div> <h2 id="ocsp-config"> <code> ocsp config </code> </h2> <p> Displays or updates OCSP configuration. Run the command without the <code> set </code> option to display the current configuration of a parameter. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster ocsp config &lt;OCSP parameter&gt; </span></span><span class="line"><span class="cl"> <span class="o">[</span><span class="nb">set</span> &lt;value&gt;<span class="o">]</span> </span></span></code></pre> </div> <h3 id="parameters-1"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> ocsp_functionality </td> <td> enabled <br/> <br/> disabled </td> <td> Enables or turns off OCSP for the cluster </td> </tr> <tr> <td> query_frequency </td> <td> integer <nobr> (range: 60-86400) </nobr> <nobr> (default: 3600) </nobr> </td> <td> The time interval in seconds between OCSP queries to check the certificate's status </td> </tr> <tr> <td> recovery_frequency </td> <td> integer <nobr> (range: 60-86400) </nobr> <nobr> (default: 60) </nobr> </td> <td> The time interval in seconds between retries after a failed query </td> </tr> <tr> <td> recovery_max_tries </td> <td> integer <nobr> (range: 1-100) </nobr> <nobr> (default: 5) </nobr> </td> <td> The number of retries before the validation query fails and invalidates the certificate </td> </tr> <tr> <td> responder_url </td> <td> string </td> <td> The OCSP server URL embedded in the proxy certificate (you cannot manually set this parameter) </td> </tr> <tr> <td> response_timeout </td> <td> integer <nobr> (range: 1-60) </nobr> <nobr> (default: 1) </nobr> </td> <td> The time interval in seconds to wait for a response before timing out </td> </tr> </tbody> </table> <h3 id="returns-1"> Returns </h3> <p> If you run the <code> ocsp config </code> command without the <code> set </code> option, it displays the specified parameter's current configuration. </p> <h3 id="example-1"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster ocsp config recovery_frequency </span></span><span class="line"><span class="cl">Recovery frequency of the OCSP server is <span class="m">60</span> seconds </span></span><span class="line"><span class="cl">$ rladmin cluster ocsp config recovery_frequency <span class="nb">set</span> <span class="m">30</span> </span></span><span class="line"><span class="cl">$ rladmin cluster ocsp config recovery_frequency </span></span><span class="line"><span class="cl">Recovery frequency of the OCSP server is <span class="m">30</span> seconds </span></span></code></pre> </div> <h2 id="ocsp-status"> <code> ocsp status </code> </h2> <p> Returns the latest cached status of the certificate's OCSP response. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster ocsp status </span></span></code></pre> </div> <h3 id="parameters-2"> Parameters </h3> <p> None </p> <h3 id="returns-2"> Returns </h3> <p> Returns the latest cached status of the certificate's OCSP response. </p> <h3 id="example-2"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster ocsp status </span></span><span class="line"><span class="cl">OCSP certificate status is: REVOKED </span></span><span class="line"><span class="cl">produced_at: Wed, <span class="m">22</span> Dec <span class="m">2021</span> 12:50:11 GMT </span></span><span class="line"><span class="cl">responder_url: http://responder.ocsp.url.com </span></span><span class="line"><span class="cl">revocation_time: Wed, <span class="m">22</span> Dec <span class="m">2021</span> 12:50:04 GMT </span></span><span class="line"><span class="cl">this_update: Wed, <span class="m">22</span> Dec <span class="m">2021</span> 12:50:11 GMT </span></span></code></pre> </div> <h2 id="ocsp-test_certificate"> <code> ocsp test_certificate </code> </h2> <p> Queries the OCSP server for the certificate's latest status, then caches and displays the response. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster ocsp test_certificate </span></span></code></pre> </div> <h3 id="parameters-3"> Parameters </h3> <p> None </p> <h3 id="returns-3"> Returns </h3> <p> Returns the latest status of the certificate's OCSP response. </p> <h3 id="example-3"> Example </h3> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster ocsp test_certificate </span></span><span class="line"><span class="cl">Initiating a query to OCSP server </span></span><span class="line"><span class="cl">...OCSP certificate status is: REVOKED </span></span><span class="line"><span class="cl">produced_at: Wed, <span class="m">22</span> Dec <span class="m">2021</span> 12:50:11 GMT </span></span><span class="line"><span class="cl">responder_url: http://responder.ocsp.url.com </span></span><span class="line"><span class="cl">revocation_time: Wed, <span class="m">22</span> Dec <span class="m">2021</span> 12:50:04 GMT </span></span><span class="line"><span class="cl">this_update: Wed, <span class="m">22</span> Dec <span class="m">2021</span> 12:50:11 GMT </span></span></code></pre> </div> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/ocsp/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/config/.html
<section class="prose w-full py-12"> <h1 class="command-name"> CONFIG </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CONFIG</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> Depends on subcommand. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This is a container command for runtime configuration commands. </p> <p> To see the list of available commands you can call <a href="/docs/latest/commands/config-help/"> <code> CONFIG HELP </code> </a> . </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/config/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.60.0/.html
<section class="prose w-full py-12"> <h1> Redis Insight v2.60.0, October 2024 </h1> <p class="text-lg -mt-5 mb-10"> Redis Insight v2.60 </p> <h2 id="260-october-2024"> 2.60 (October 2024) </h2> <p> This is the General Availability (GA) release of Redis Insight 2.60. </p> <h3 id="highlights"> Highlights </h3> <ul> <li> Advanced and schema-aware command auto-complete for <a href="https://redis.io/docs/latest/develop/interact/search-and-query/?utm_source=redisinsight&amp;utm_medium=main&amp;utm_campaign=release_notes"> Redis Query Engine </a> is now available in Workbench, enabling faster and more accurate query building with smart suggestions for indexes, schemas, and expressions. </li> <li> Support for adding multiple elements to the head or tail of lists, for both new or existing keys. </li> <li> Multiple UI enhancements for clarity and ease of use when editing Redis Data Integration (RDI) jobs. </li> </ul> <h3 id="details"> Details </h3> <p> <strong> Features and improvements </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3553"> #3553 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/3647"> #3647 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/3669"> #3669 </a> Advanced, schema-aware auto-complete for <a href="https://redis.io/docs/latest/develop/interact/search-and-query/?utm_source=redisinsight&amp;utm_medium=main&amp;utm_campaign=release_notes"> Redis Query Engine </a> in Workbench. Enjoy faster query building with context-sensitive suggestions that recognize indexes, schemas, and fields based on your current query. Start typing any <a href="https://redis.io/docs/latest/commands/?group=search"> Redis Query Engine </a> command in Workbench to try this feature. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3891"> #3891 </a> Allows to easily push multiple elements to the head or tail of list data types, whether creating new or updating existing lists. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3891"> #3891 </a> UX/UI enhancements to provide more details about Redis Data Integration (RDI) job transformation and output results in the dry-run section. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3981"> #3981 </a> Removes confirmation prompts for template insertions in Redis Data Integration jobs, simplifying a workflow. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3827"> #3827 </a> Provides easy-to-understand metrics of network input/output by automatically converting units in Browser Overview. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3982"> #3982 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/3975"> #3975 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/3941"> #3941 </a> Various vulnerabilities have been fixed. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/insight/release-notes/v.2.60.0/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/databases/import-export/.html
<section class="prose w-full py-12 max-w-none"> <h1> Import and export data </h1> <p class="text-lg -mt-5 mb-10"> How to import, export, flush, and migrate your data. </p> <nav> <a href="/docs/latest/operate/rs/databases/import-export/import-data/"> Import data into a database </a> <p> You can import export or backup files of a specific Redis Enterprise Software database to restore data. You can either import from a single file or from multiple files, such as when you want to import from a backup of a clustered database. </p> <a href="/docs/latest/operate/rs/databases/import-export/export-data/"> Export data from a database </a> <p> You can export data to import it into a new database or to make a backup. This article shows how to do so. </p> <a href="/docs/latest/operate/rs/databases/import-export/flush/"> Flush database data </a> <p> To delete the data in a database without deleting the database, you can use Redis CLI to flush it from the database. You can also use Redis CLI, the admin console, and the Redis Software REST API to flush data from Active-Active databases. </p> <a href="/docs/latest/operate/rs/databases/import-export/schedule-backups/"> Schedule periodic backups </a> <p> Schedule backups of your databases to make sure you always have valid backups. </p> <a href="/docs/latest/operate/rs/databases/import-export/migrate-to-active-active/"> Migrate a database to Active-Active </a> <p> Use Replica Of to migrate your database to an Active-Active database. </p> <a href="/docs/latest/operate/rs/databases/import-export/replica-of/"> Replica Of geo-distributed Redis </a> <p> Replica Of provides read-only access to replicas of the dataset from different geographical locations. </p> </nav> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/databases/import-export/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/clusters/configure/cluster-settings/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster settings </h1> <p class="text-lg -mt-5 mb-10"> You can view and set various cluster settings such as cluster name, email service, time zone, and license. </p> <p> You can view and set various cluster settings, such as cluster name, email service, time zone, and license, on the <strong> Cluster &gt; Configuration </strong> page. </p> <h2 id="general-configuration-tab"> General configuration tab </h2> <h3 id="upload-cluster-license-key"> Upload cluster license key </h3> <p> After purchasing a cluster license and if your account has the "Admin" role, you can upload the cluster license key, either during initial cluster creation or at any time afterward. The license key defines various cluster settings, such as the maximum number of shards you can have in the cluster. For more detailed information see <a href="/docs/latest/operate/rs/7.4/clusters/configure/license-keys/"> Cluster license keys </a> . </p> <h3 id="view-max-number-of-allowed-shards"> View max number of allowed shards </h3> <p> The maximum number of allowed shards, which is determined by the cluster license key, appears in the <strong> Max number of shards </strong> field in the <strong> License </strong> section. </p> <h3 id="view-cluster-name"> View cluster name </h3> <p> The cluster name appears in the <strong> Cluster name </strong> field in the <strong> License </strong> section. This gives a common name that your team or Redis support can refer to. It is especially helpful if you have multiple clusters. </p> <h3 id="set-time-zone"> Set time zone </h3> <p> You can change the <strong> Time zone </strong> field to ensure the date, time fields, and log entries in the Cluster Manager UI are shown in your preferred time zone. This setting doesn't affect other system logs or services. </p> <h2 id="alert-settings-tab"> Alert settings tab </h2> <p> The <strong> Alert Settings </strong> tab lets you configure alerts that are relevant to the entire cluster, such as alerts for cluster utilization, nodes, node utilization, security, and database utilization. </p> <p> You can also configure email server settings and <a href="/docs/latest/operate/rs/7.4/clusters/monitoring/#send-alerts-by-email"> send alerts by email </a> to relevant users. </p> <h3 id="configure-email-server-settings"> Configure email server settings </h3> <p> To enable email alerts: </p> <ol> <li> <p> Enter your email server details in the <strong> Email server settings </strong> section. </p> </li> <li> <p> Select a connection security method: </p> <ul> <li> <p> TLS/SSL </p> </li> <li> <p> STARTTLS </p> </li> <li> <p> None </p> </li> </ul> </li> <li> <p> Send a test email to verify your email server settings. </p> </li> </ol> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/clusters/configure/cluster-settings/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/hmset/.html
<section class="prose w-full py-12"> <h1 class="command-name"> HMSET <span class="text-base"> (deprecated) </span> </h1> <div class="border-l-8 pl-4"> <p> As of Redis version 4.0.0, this command is regarded as deprecated. </p> <p> It can be replaced by <a href="/docs/latest/commands/hset/"> <code> HSET </code> </a> with multiple field-value pairs when migrating or writing new code. </p> </div> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">HMSET key field value [field value ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of fields being set. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @hash </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Sets the specified fields to their respective values in the hash stored at <code> key </code> . This command overwrites any specified fields already existing in the hash. If <code> key </code> does not exist, a new key holding a hash is created. </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; HMSET myhash field1 "Hello" field2 "World" "OK" redis&gt; HGET myhash field1 "Hello" redis&gt; HGET myhash field2 "World" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> . <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/hmset/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics/node-metrics/.html
<section class="prose w-full py-12 max-w-none"> <h1> Node metrics </h1> <p class="text-lg -mt-5 mb-10"> Documents the node metrics used with Redis Enterprise Software REST API calls. </p> <table> <thead> <tr> <th> Metric name </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> available_flash </td> <td> float </td> <td> Available flash on the node (bytes) </td> </tr> <tr> <td> available_memory </td> <td> float </td> <td> Available RAM on the node (bytes) </td> </tr> <tr> <td> avg_latency </td> <td> float </td> <td> Average latency of requests handled by endpoints on the node (micro-sec); returned only when there is traffic </td> </tr> <tr> <td> bigstore_free </td> <td> float </td> <td> Free space of backend flash (used by flash DB's BigRedis) (bytes); returned only when BigRedis is enabled </td> </tr> <tr> <td> bigstore_iops </td> <td> float </td> <td> Rate of I/O operations against backend flash for all shards which are part of a flash-based DB (BigRedis) on the node (ops/sec); returned only when BigRedis is enabled </td> </tr> <tr> <td> bigstore_kv_ops </td> <td> float </td> <td> Rate of value read/write operations against backend flash for all shards which are part of a flash-based DB (BigRedis) on the node (ops/sec); returned only when BigRedis is enabled </td> </tr> <tr> <td> bigstore_throughput </td> <td> float </td> <td> Throughput of I/O operations against backend flash for all shards which are part of a flash-based DB (BigRedis) on the node (bytes/sec); returned only when BigRedis is enabled </td> </tr> <tr> <td> conns </td> <td> float </td> <td> Number of clients connected to endpoints on the node </td> </tr> <tr> <td> cpu_idle </td> <td> float </td> <td> CPU idle time portion (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> cpu_system </td> <td> float </td> <td> CPU time portion spent in kernel (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> cpu_user </td> <td> float </td> <td> CPU time portion spent by users-pace processes (0-1, multiply by 100 to get percent) </td> </tr> <tr> <td> cur_aof_rewrites </td> <td> float </td> <td> Number of current AOF rewrites by shards on this node </td> </tr> <tr> <td> egress_bytes </td> <td> float </td> <td> Rate of outgoing network traffic to the node (bytes/sec) </td> </tr> <tr> <td> ephemeral_storage_avail </td> <td> float </td> <td> Disk space available to Redis Enterprise processes on configured ephemeral disk (bytes) </td> </tr> <tr> <td> ephemeral_storage_free </td> <td> float </td> <td> Free disk space on configured ephemeral disk (bytes) </td> </tr> <tr> <td> free_memory </td> <td> float </td> <td> Free memory on the node (bytes) </td> </tr> <tr> <td> ingress_bytes </td> <td> float </td> <td> Rate of incoming network traffic to the node (bytes/sec) </td> </tr> <tr> <td> persistent_storage_avail </td> <td> float </td> <td> Disk space available to Redis Enterprise processes on configured persistent disk (bytes) </td> </tr> <tr> <td> persistent_storage_free </td> <td> float </td> <td> Free disk space on configured persistent disk (bytes) </td> </tr> <tr> <td> provisional_flash </td> <td> float </td> <td> Amount of flash available for new shards on this node, taking into account overbooking, max Redis servers, reserved flash, and provision and migration thresholds (bytes) </td> </tr> <tr> <td> provisional_memory </td> <td> float </td> <td> Amount of RAM available for new shards on this node, taking into account overbooking, max Redis servers, reserved memory, and provision and migration thresholds (bytes) </td> </tr> <tr> <td> total_req </td> <td> float </td> <td> Request rate handled by endpoints on the node (ops/sec) </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics/node-metrics/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ft.aliasupdate/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FT.ALIASUPDATE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FT.ALIASUPDATE alias index </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/interact/search-and-query"> Search 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> </dl> <p> Add an alias to an index. If the alias is already associated with another index, FT.ALIASUPDATE removes the alias association with the previous index. </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> alias index </code> </summary> <p> is alias to be added to an index. </p> </details> <h2 id="return"> Return </h2> <p> FT.ALIASUPDATE returns a simple string reply <code> OK </code> if executed correctly, or an error reply otherwise. </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Update an index alias </b> </summary> <p> Update the alias of an index. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.ALIASUPDATE <span class="nb">alias</span> idx </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ft.aliasadd/"> <code> FT.ALIASADD </code> </a> | <a href="/docs/latest/commands/ft.aliasdel/"> <code> FT.ALIASDEL </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/interact/search-and-query/"> RediSearch </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft.aliasupdate/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </details> </section>
https://redis.io/docs/latest/operate/rs/7.4/databases/active-active/develop/data-types/sorted-sets/.html
<section class="prose w-full py-12 max-w-none"> <h1> Sorted sets in Active-Active databases </h1> <p class="text-lg -mt-5 mb-10"> Information about using sorted sets with an Active-Active database. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <a href="/docs/latest/commands/geoadd/"> Redis Geospatial (Geo) </a> is based on Sorted Sets, so the same Active-Active database development instructions apply to Geo. </div> </div> <p> Similar to Redis Sets, Redis Sorted Sets are non-repeating collections of Strings. The difference between the two is that every member of a Sorted Set is associated with a score used to order the Sorted Set from lowest to highest. While members are unique, they may have the same score. </p> <p> With Sorted Sets, you can quickly add, remove or update elements as well as get ranges by score or by rank (position). Sorted Sets in Active-Active databases behave the same and maintain additional metadata to handle concurrent conflicting writes. Conflict resolution is done in two phases: </p> <ol> <li> First, the database resolves conflict at the set level using "OR Set" (Observed-Remove Set). With OR-Set behavior, writes across multiple Active-Active database instances are typically unioned except in cases of conflicts. Conflicting writes can happen when an Active-Active database instance deletes an element while the other adds or updates the same element. In this case, an observed Remove rule is followed, and only instances it has already seen are removed. In all other cases, the Add / Update element wins. </li> <li> Second, the database resolves conflict at the score level. In this case, the score is treated as a counter and applies the same conflict resolution as regular counters. </li> </ol> <p> See the following examples to get familiar with Sorted Sets' behavior in Active-Active database: </p> <p> Example of Simple Sorted Set with No Conflict: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> ZADD Z 1.1 x </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> </td> <td style="text-align:center"> ZADD Z 1.2 y </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> ZRANGE Z 0 -1 =&gt; x y </td> <td style="text-align:center"> ZRANGE Z 0 -1 =&gt; x y </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : When adding two different elements to a Sorted Set from different replicas (in this example, x with score 1.1 was added by Instance 1 to Sorted Set Z, and y with score 1.2 was added by Instance 2 to Sorted Set Z) in a non-concurrent manner (i.e. each operation happened separately and after both instances were in sync), the end result is a Sorted Set including both elements in each Active-Active database instance. Example of Sorted Set and Concurrent Add: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> ZADD Z 1.1 x </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> </td> <td style="text-align:center"> ZADD Z 2.1 x </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 1.1 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 2.1 </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 2.1 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 2.1 </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : When concurrently adding an element x to a Sorted Set Z by two different Active-Active database instances (Instance 1 added score 1.1 and Instance 2 added score 2.1), the Active-Active database implements Last Write Win (LWW) to determine the score of x. In this scenario, Instance 2 performed the ZADD operation at time t2&gt;t1 and therefore the Active-Active database sets the score 2.1 to x. </p> <p> Example of Sorted Set with Concurrent Add Happening at the Exact Same Time: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> ZADD Z 1.1 x </td> <td style="text-align:center"> ZADD Z 2.1 x </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 1.1 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 2.1 </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 1.1 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 1.1 </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : The example above shows a relatively rare situation, in which two Active-Active database instances concurrently added the same element x to a Sorted Set at the same exact time but with a different score, i.e. Instance 1 added x with a 1.1 score and Instance 2 added x with a 2.1 score. After syncing, the Active-Active database realized that both operations happened at the same time and resolved the conflict by arbitrarily (but consistently across all Active-Active database instances) giving precedence to Instance 1. Example of Sorted Set with Concurrent Counter Increment: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> ZADD Z 1.1 x </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> ZINCRBY Z 1.0 x </td> <td style="text-align:center"> ZINCRBY Z 1.0 x </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 3.1 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 3.1 </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : The result is the sum of all ZINCRBY operations performed by all Active-Active database instances. </p> <p> Example of Removing an Element from a Sorted Set: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> ZADD Z 4.1 x </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 4.1 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 4.1 </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> ZREM Z x </td> <td style="text-align:center"> ZINCRBY Z 2.0 x </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> ZSCORE Z x =&gt; nill </td> <td style="text-align:center"> ZSCORE Z x =&gt; 6.1 </td> </tr> <tr> <td style="text-align:right"> t6 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t7 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 2.0 </td> <td style="text-align:center"> ZSCORE Z x =&gt; 2.0 </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : At t4 - t5, concurrent ZREM and ZINCRBY operations ran on Instance 1 and Instance 2 respectively. Before the instances were in sync, the ZREM operation could only delete what had been seen by Instance 1, so Instance 2 was not affected. Therefore, the ZSCORE operation shows the local effect on x. At t7, after both instances were in-sync, the Active-Active database resolved the conflict by subtracting 4.1 (the value of element x in Instance 1) from 6.1 (the value of element x in Instance 2). </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/active-active/develop/data-types/sorted-sets/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/changelog/2023/may-2023/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Cloud changelog (May 2023) </h1> <p class="text-lg -mt-5 mb-10"> New features, enhancements, and other changes added to Redis Cloud during May 2023. </p> <p> This changelog lists new features, enhancements, and other changes added to Redis Cloud during May 2023. </p> <h2 id="new-features-and-enhancements"> New features and enhancements </h2> <h3 id="cloud-api---fixed-plans-support"> Cloud API - Fixed plans support </h3> <p> The <a href="/docs/latest/operate/rc/api/"> Redis Cloud API </a> supports new endpoints to manage fixed subscriptions and databases. </p> <p> The new fixed endpoints can be viewed in the <a href="https://api.redislabs.com/v1/swagger-ui/index.html#/Subscriptions%20-%20Fixed"> Redis Cloud Swagger UI </a> . For more information about using the Redis Cloud API, see <a href="/docs/latest/operate/rc/api/get-started/use-rest-api/"> Use the REST API </a> . </p> <h3 id="active-active-access-roles"> Active-Active access roles </h3> <p> For <a href="/docs/latest/operate/rc/databases/configuration/active-active-redis/"> Active-Active databases </a> , you can now define roles with different levels of access for different regions. </p> <p> For more information, see <a href="/docs/latest/operate/rc/security/access-control/data-access-control/active-active-roles/"> Active-Active roles </a> . </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/changelog/2023/may-2023/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rc/billing-and-payments/.html
<section class="prose w-full py-12 max-w-none"> <h1> Billing &amp; payments </h1> <p class="text-lg -mt-5 mb-10"> Describes how to view billing transactions and manage payment methods for Redis Cloud subscriptions. </p> <p> The <strong> Billing &amp; Payments </strong> screen: </p> <ul> <li> Shows recent transactions for your account </li> <li> Helps you manage your payment methods </li> <li> Applies coupon credits to your account </li> </ul> <a href="/docs/latest/images/rc/billing-billing-history-tab.png" sdata-lightbox="/images/rc/billing-billing-history-tab.png"> <img alt="The Billing &amp; Payments screen shows billing transactions and manage payment methods." src="/docs/latest/images/rc/billing-billing-history-tab.png"/> </a> <p> The following tabs are available: </p> <ul> <li> <p> The <strong> Billing History </strong> tab displays recent charges and payments. Each transaction includes the following details: </p> <table> <thead> <tr> <th style="text-align:left"> Detail </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> Date </td> <td style="text-align:left"> Date the transaction was recorded </td> </tr> <tr> <td style="text-align:left"> Description </td> <td style="text-align:left"> Description of the transaction </td> </tr> <tr> <td style="text-align:left"> Reference </td> <td style="text-align:left"> Reference number </td> </tr> <tr> <td style="text-align:left"> Amount </td> <td style="text-align:left"> Transaction amount </td> </tr> </tbody> </table> <p> Billing details may vary between regions. </p> <p> You can <a href="#download-invoice"> download invoices </a> on this tab. </p> <p> A <strong> Pay Now </strong> button appears in selected regions. </p> <a href="/docs/latest/images/rc/billing-payments-pay-now.png" sdata-lightbox="/images/rc/billing-payments-pay-now.png"> <img alt="Use the Pay Now button to Pay your invoice in selected regions." src="/docs/latest/images/rc/billing-payments-pay-now.png" width="100px"/> </a> <p> Select this button to pay your invoice. </p> </li> <li> <p> The <strong> Payment Methods </strong> tab lists your current payment methods. You can add a new payment method, associate different payment methods with specific subscriptions, and remove payment methods. </p> <a href="/docs/latest/images/rc/billing-payment-method-tab.png" sdata-lightbox="/images/rc/billing-payment-method-tab.png"> <img alt="The Payments Methods tab helps you manage payments for your subscriptions." src="/docs/latest/images/rc/billing-payment-method-tab.png"/> </a> <p> Select <strong> Add Credit Card </strong> to enter new credit card details. </p> </li> <li> <p> The <strong> Credits </strong> tab shows coupon credits that have been applied to your account, if any. </p> <a href="/docs/latest/images/rc/billing-payments-credits-tab.png" sdata-lightbox="/images/rc/billing-payments-credits-tab.png"> <img alt="The Credits tab lets you apply coupons to your account and shows credits that have already been applied." src="/docs/latest/images/rc/billing-payments-credits-tab.png"/> </a> <table> <thead> <tr> <th style="text-align:left"> Detail </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> Code </td> <td style="text-align:left"> Coupon code </td> </tr> <tr> <td style="text-align:left"> Coupon Amount </td> <td style="text-align:left"> Amount credited to your account </td> </tr> <tr> <td style="text-align:left"> Current Balance </td> <td style="text-align:left"> Amount left </td> </tr> <tr> <td style="text-align:left"> Date added </td> <td style="text-align:left"> Date applied to your account </td> </tr> <tr> <td style="text-align:left"> Expiration Date </td> <td style="text-align:left"> Date the amount expires </td> </tr> </tbody> </table> <p> You can <a href="#apply-coupon"> apply a coupon </a> on this tab. </p> </li> </ul> <h2 id="download-invoice"> Download invoice </h2> <p> To download an invoice: </p> <ol> <li> <p> In the <a href="https://cloud.redis.io/"> Redis Cloud console </a> , select <strong> Billing &amp; Payments </strong> . </p> </li> <li> <p> From the <strong> Billing History </strong> tab, locate and select the invoice. </p> </li> <li> <p> Select the <strong> Download invoice </strong> icon displayed to the right of the invoice amount. </p> <a href="/docs/latest/images/rc/icon-billing-download.png" sdata-lightbox="/images/rc/icon-billing-download.png"> <img alt="Use the download icon to download a PDF for the selected invoice." src="/docs/latest/images/rc/icon-billing-download.png" width="50px"/> </a> </li> </ol> <p> The invoice is downloaded as an Acrobat PDF file. Use your browser's download features to manage the file. </p> <h2 id="add-payment-method"> Add payment method </h2> <p> To add a new payment method: </p> <ol> <li> <p> In the <a href="https://cloud.redis.io/"> Redis Cloud console </a> , select <strong> Billing &amp; Payments &gt; Payment Methods </strong> . </p> </li> <li> <p> Select <strong> Add credit card </strong> and add the credit card details. </p> <a href="/docs/latest/images/rc/billing-add-credit-card.png" sdata-lightbox="/images/rc/billing-add-credit-card.png"> <img alt="Select Add Credit Card to add a new payment method" src="/docs/latest/images/rc/billing-add-credit-card.png" width="80%"/> </a> </li> <li> <p> If you need to change the account billing address for this card, activate the <strong> Change Address </strong> slider and enter the new billing address. </p> <a href="/docs/latest/images/rc/billing-update-billing-address.png" sdata-lightbox="/images/rc/billing-update-billing-address.png"> <img alt="Deactivate the Use account address slider to specify a different billing address." src="/docs/latest/images/rc/billing-update-billing-address.png" width="80%"/> </a> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Changing the billing address for your account will remove any payment methods associated with the old billing address. </div> </div> </li> <li> <p> Select the <strong> Add Credit Card </strong> button to save your changes. </p> <a href="/docs/latest/images/rc/button-billing-save-card.png" sdata-lightbox="/images/rc/button-billing-save-card.png"> <img alt="Use the Save Card button to save new payment details." src="/docs/latest/images/rc/button-billing-save-card.png" width="150px"/> </a> </li> </ol> <h2 id="edit-billing-address"> Edit billing address </h2> <p> To edit the Redis Cloud account billing address: </p> <ol> <li> <p> In the <a href="https://cloud.redis.io/"> Redis Cloud console </a> , select <strong> Billing &amp; Payments &gt; Payment Methods </strong> . </p> </li> <li> <p> Select <strong> Credit card options &gt; Edit billing address </strong> . </p> <a href="/docs/latest/images/rc/billing-credit-card-options-menu.png" sdata-lightbox="/images/rc/billing-credit-card-options-menu.png"> <img alt="The Credit card options menu on the upper-right hand corner of the payment method." src="/docs/latest/images/rc/billing-credit-card-options-menu.png" width="200px"/> </a> </li> <li> <p> Enter the new billing address. You must re-enter your payment method details to confirm your address change. </p> <a href="/docs/latest/images/rc/account-settings-change-billing-address.png" sdata-lightbox="/images/rc/account-settings-change-billing-address.png"> <img alt="The Edit account billing address screen." src="/docs/latest/images/rc/account-settings-change-billing-address.png" width="80%"/> </a> <p> Select the checkbox to confirm that your previous payment methods will be removed. </p> <a href="/docs/latest/images/rc/account-settings-confirm-billing-address.png" sdata-lightbox="/images/rc/account-settings-confirm-billing-address.png"> <img alt="The Edit account billing address screen." src="/docs/latest/images/rc/account-settings-confirm-billing-address.png" width="80%"/> </a> <p> Select <strong> Continue </strong> to save your new address. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> Changing the billing address for your account will remove any payment methods associated with the old billing address. See <a href="#add-payment-method"> Add payment method </a> to learn how to add a payment method back to your account. </div> </div> </li> </ol> <h2 id="edit-mailing-address"> Edit mailing address </h2> <p> To edit the mailing address associated with a payment method: </p> <ol> <li> <p> In the <a href="https://cloud.redis.io/"> Redis Cloud console </a> , select <strong> Billing &amp; Payments </strong> and then select the <strong> Payment Methods </strong> tab. </p> </li> <li> <p> Select <strong> Credit card options &gt; Edit mailing address </strong> . </p> <a href="/docs/latest/images/rc/billing-credit-card-options-menu.png" sdata-lightbox="/images/rc/billing-credit-card-options-menu.png"> <img alt="The Credit card options menu on the upper-right hand corner of the payment method." src="/docs/latest/images/rc/billing-credit-card-options-menu.png" width="200px"/> </a> </li> <li> <p> If the mailing address is different from the billing address, deactivate the <strong> Use billing address </strong> slider and enter the new mailing address. </p> <a href="/docs/latest/images/rc/billing-change-mailing-address.png" sdata-lightbox="/images/rc/billing-change-mailing-address.png"> <img alt="The Edit mailing address screen." src="/docs/latest/images/rc/billing-change-mailing-address.png" width="80%"/> </a> </li> </ol> <h2 id="apply-coupon"> Apply coupon </h2> <p> Coupons apply credits to your Redis Cloud account. To redeem a coupon: </p> <ol> <li> <p> In the <a href="https://cloud.redis.io/"> Redis Cloud console </a> , select <strong> Billing &amp; Payments </strong> and then select the <strong> Credits </strong> tab. </p> </li> <li> <p> Enter the coupon code and then select the <strong> Apply </strong> button. </p> <a href="/docs/latest/images/rc/button-billing-payments-apply.png" sdata-lightbox="/images/rc/button-billing-payments-apply.png"> <img alt="Use the Apply button to redeem a coupon." src="/docs/latest/images/rc/button-billing-payments-apply.png" width="80px"/> </a> <p> The value of the coupon is applied to your account when accepted. </p> </li> </ol> <p> For help, contact <a href="https://support.redislabs.com"> Support </a> . </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <p> Generally, charges are non-refundable. </p> <p> For any special circumstances that may warrant a refund, please contact <a href="https://support.redislabs.com"> Support </a> and be sure to provide detail about the reasons for the refund request. </p> </div> </div> <h2 id="download-cost-report"> Download cost report </h2> <p> Select the <strong> Cost report </strong> button to download a report of all shard costs in CSV format. </p> <a href="/docs/latest/images/rc/button-cost-report-download.png" sdata-lightbox="/images/rc/button-cost-report-download.png"> <img alt="The cost report download button." src="/docs/latest/images/rc/button-cost-report-download.png" width="150px"/> </a> <p> The report gives a breakdown of all your Redis billing unit costs, per subscription and database, by month. Subscriptions under the minimum subscription price are broken down into actual billing unit prices and the difference from minimum price. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/billing-and-payments/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/services_configuration/pdns_server/.html
<section class="prose w-full py-12 max-w-none"> <h1> PDNS server object </h1> <p class="text-lg -mt-5 mb-10"> Documents the pdns_server object used with Redis Enterprise Software REST API calls. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> operating_mode </td> <td> 'disabled' <br/> 'enabled' </td> <td> Enable/disable the PDNS server </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/services_configuration/pdns_server/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/acl-genpass/.html
<section class="prose w-full py-12"> <h1 class="command-name"> ACL GENPASS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">ACL GENPASS [bits]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 6.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> ACL users need a solid password in order to authenticate to the server without security risks. Such password does not need to be remembered by humans, but only by computers, so it can be very long and strong (unguessable by an external attacker). The <code> ACL GENPASS </code> command generates a password starting from /dev/urandom if available, otherwise (in systems without /dev/urandom) it uses a weaker system that is likely still better than picking a weak password by hand. </p> <p> By default (if /dev/urandom is available) the password is strong and can be used for other uses in the context of a Redis application, for instance in order to create unique session identifiers or other kind of unguessable and not colliding IDs. The password generation is also very cheap because we don't really ask /dev/urandom for bits at every execution. At startup Redis creates a seed using /dev/urandom, then it will use SHA256 in counter mode, with HMAC-SHA256(seed,counter) as primitive, in order to create more random bytes as needed. This means that the application developer should be feel free to abuse <code> ACL GENPASS </code> to create as many secure pseudorandom strings as needed. </p> <p> The command output is a hexadecimal representation of a binary string. By default it emits 256 bits (so 64 hex characters). The user can provide an argument in form of number of bits to emit from 1 to 1024 to change the output length. Note that the number of bits provided is always rounded to the next multiple of 4. So for instance asking for just 1 bit password will result in 4 bits to be emitted, in the form of a single hex character. </p> <h2 id="examples"> Examples </h2> <pre tabindex="0"><code>&gt; ACL GENPASS "dd721260bfe1b3d9601e7fbab36de6d04e2e67b0ef1c53de59d45950db0dd3cc" &gt; ACL GENPASS 32 "355ef3dd" &gt; ACL GENPASS 5 "90" </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : pseudorandom data. By default it contains 64 bytes, representing 256 bits of data. If <code> bits </code> was given, the output string length is the number of specified bits (rounded to the next multiple of 4) divided by 4. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/acl-genpass/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/ft.config-help.html
<section class="prose w-full py-12"> <h1 class="command-name"> FT.CONFIG HELP </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FT.CONFIG HELP option </pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/interact/search-and-query"> Search 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> </dl> <p> Describe configuration options </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> option </code> </summary> <p> is name of the configuration option, or '*' for all. </p> </details> <h2 id="return"> Return </h2> <p> FT.CONFIG HELP returns an array reply of the configuration name and value. </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Get configuration details </b> </summary> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; FT.CONFIG HELP TIMEOUT </span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> TIMEOUT </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Description </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Query <span class="o">(</span>search<span class="o">)</span> timeout </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> Value </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="s2">"42"</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ft.config-set/"> <code> FT.CONFIG SET </code> </a> | <a href="/docs/latest/commands/ft.config-get/"> <code> FT.CONFIG GET </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/interact/search-and-query/"> RediSearch </a> </p> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft.config-help/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/networking/mdns/.html
<section class="prose w-full py-12 max-w-none"> <h1> Client prerequisites for mDNS </h1> <p class="text-lg -mt-5 mb-10"> Requirements for using the mDNS protocol in development and testing environments. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> mDNS is only supported for development and testing environments. </div> </div> <p> If you choose to use the mDNS protocol when <a href="/docs/latest/operate/rs/networking/cluster-dns/"> you set the cluster name </a> , make sure that the configurations and prerequisites for resolving database endpoints are met on the client machines. If you have <a href="/docs/latest/operate/rs/databases/import-export/replica-of/"> Replica Of </a> databases on the cluster, the configurations and prerequisites are also required for the Redis Enterprise Software nodes. </p> <p> To prepare a client or node for mDNS: </p> <ol> <li> <p> Make sure that the clients and cluster nodes are on the same physical network or have the network infrastructure configured to allow multicasting between them. </p> </li> <li> <p> Install these prerequisite packages: </p> <ul> <li> <p> For Ubuntu: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">apt-get install libnss-mdns </span></span></code></pre> </div> </li> <li> <p> For RHEL/CentOS 6.x: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm </span></span><span class="line"><span class="cl">$ yum install nss-mdns </span></span><span class="line"><span class="cl">$ service avahi-daemon start </span></span></code></pre> </div> </li> <li> <p> For RHEL/CentOS 7: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rpm -ivh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm </span></span><span class="line"><span class="cl">$ yum install nss-mdns </span></span><span class="line"><span class="cl">$ service avahi-daemon start </span></span></code></pre> </div> </li> </ul> </li> <li> <p> If you are using <a href="/docs/latest/operate/rs/networking/multi-ip-ipv6/"> mDNS with IPv6 addresses </a> , update the hosts line in <code> /etc/nsswitch.conf </code> to: </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l">files mdns4_minimal</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="l">\[NOTFOUND=return\] mdns</span><span class="w"> </span></span></span></code></pre> </div> </li> </ol> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/networking/mdns/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/json.get.html
<section class="prose w-full py-12"> <h1 class="command-name"> JSON.GET </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">JSON.GET key [INDENT indent] [NEWLINE newline] [SPACE space] [path [path ...]]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/json"> JSON 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) when path is evaluated to a single value where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key </dd> </dl> <p> Return the value at <code> path </code> in JSON serialized form </p> <p> <a href="#examples"> Examples </a> </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key to parse. </p> </details> <h2 id="optional-arguments"> Optional arguments </h2> <details open=""> <summary> <code> path </code> </summary> <p> is JSONPath to specify. Default is root <code> $ </code> . JSON.GET accepts multiple <code> path </code> arguments. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <p> When using a single JSONPath, the root of the matching values is a JSON string with a top-level <strong> array </strong> of serialized JSON value. In contrast, a legacy path returns a single value. </p> <p> When using multiple JSONPath arguments, the root of the matching values is a JSON string with a top-level <strong> object </strong> , with each object value being a top-level array of serialized JSON value. In contrast, if all paths are legacy paths, each object value is a single serialized JSON value. If there are multiple paths that include both legacy path and JSONPath, the returned value conforms to the JSONPath version (an array of values). </p> </div> </div> </details> <details open=""> <summary> <code> INDENT </code> </summary> <p> sets the indentation string for nested levels. </p> </details> <details open=""> <summary> <code> NEWLINE </code> </summary> <p> sets the string that's printed at the end of each line. </p> </details> <details open=""> <summary> <code> SPACE </code> </summary> <p> sets the string that's put between a key and a value. </p> </details> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <p> Produce pretty-formatted JSON with <code> redis-cli </code> by following this example: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">~/$ redis-cli --raw </span></span><span class="line"><span class="cl">redis&gt; JSON.GET myjsonkey INDENT <span class="s2">"\t"</span> NEWLINE <span class="s2">"\n"</span> SPACE <span class="s2">" "</span> path.to.value<span class="o">[</span>1<span class="o">]</span></span></span></code></pre> </div> </div> </div> <h2 id="return"> Return </h2> <p> JSON.GET returns a bulk string representing a JSON array of string replies. Each string is the JSON serialization of each JSON value that matches a path. Using multiple paths, JSON.GET returns a bulk string representing a JSON object with string values. Each string value is an array of the JSON serialization of each JSON value that matches a path. For more information about replies, see <a href="/docs/latest/develop/reference/protocol-spec/"> Redis serialization protocol specification </a> . </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Return the value at <code> path </code> in JSON serialized form </b> </summary> <p> Create a JSON document. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.SET doc $ <span class="s1">'{"a":2, "b": 3, "nested": {"a": 4, "b": null}}'</span> </span></span><span class="line"><span class="cl">OK</span></span></code></pre> </div> <p> With a single JSONPath (JSON array bulk string): </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.GET doc $..b </span></span><span class="line"><span class="cl"><span class="s2">"[3,null]"</span></span></span></code></pre> </div> <p> Using multiple paths with at least one JSONPath returns a JSON string with a top-level object with an array of JSON values per path: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.GET doc ..a $..b </span></span><span class="line"><span class="cl"><span class="s2">"{\"</span>$<span class="s2">..b\":[3,null],\"..a\":[2,4]}"</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/json.set/"> <code> JSON.SET </code> </a> | <a href="/docs/latest/commands/json.mget/"> <code> JSON.MGET </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <ul> <li> <a href="/docs/latest/develop/data-types/json/"> RedisJSON </a> </li> <li> <a href="/docs/latest/develop/interact/search-and-query/indexing/"> Index and search JSON documents </a> </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/json.get/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/script-flush/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SCRIPT FLUSH </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SCRIPT FLUSH [ASYNC | SYNC]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.6.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) with N being the number of scripts in cache </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @scripting </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Flush the Lua scripts cache. </p> <p> By default, <code> SCRIPT FLUSH </code> will synchronously flush the cache. Starting with Redis 6.2, setting the <strong> lazyfree-lazy-user-flush </strong> configuration directive to "yes" changes the default flush mode to asynchronous. </p> <p> It is possible to use one of the following modifiers to dictate the flushing mode explicitly: </p> <ul> <li> <code> ASYNC </code> : flushes the cache asynchronously </li> <li> <code> SYNC </code> : flushes the cache synchronously </li> </ul> <p> For more information about <a href="/docs/latest/commands/eval/"> <code> EVAL </code> </a> scripts please refer to <a href="/docs/latest/develop/interact/programmability/eval-intro/"> Introduction to Eval Scripts </a> . </p> <h2 id="behavior-change-history"> Behavior change history </h2> <ul> <li> <code> &gt;= 6.2.0 </code> : Default flush behavior now configurable by the <strong> lazyfree-lazy-user-flush </strong> configuration directive. </li> </ul> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> . <br/> <h2> History </h2> <ul> <li> Starting with Redis version 6.2.0: Added the <code> ASYNC </code> and <code> SYNC </code> flushing mode modifiers. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/script-flush/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/rebalance/.html
<section class="prose w-full py-12 max-w-none"> <h1> Rebalance database requests </h1> <p class="text-lg -mt-5 mb-10"> REST API requests to rebalance database shards </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#put-bdbs-actions-rebalance"> PUT </a> </td> <td> <code> /v1/bdbs/{uid}/actions/rebalance </code> </td> <td> Rebalance database shards </td> </tr> </tbody> </table> <h2 id="put-bdbs-actions-rebalance"> Rebalance database shards </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/bdbs/<span class="o">{</span>int: uid<span class="o">}</span>/actions/rebalance </span></span></code></pre> </div> <p> Distributes the database's shards across nodes based on the database's shard placement policy. See <a href="/docs/latest/operate/rs/databases/memory-performance/shard-placement-policy/"> Shard placement policy </a> for more information about shard placement and available policies. </p> <h4 id="required-permissions"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/permissions/#view_bdb_info"> view_bdb_info </a> </td> <td> admin <br/> cluster_member <br/> cluster_viewer <br/> db_member <br/> db_viewer </td> </tr> </tbody> </table> <h3 id="put-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /bdbs/1/actions/rebalance </span></span></code></pre> </div> <p> Dry-run example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /bdbs/1/actions/rebalance?only_failovers<span class="o">=</span>true<span class="p">&amp;</span><span class="nv">dry_run</span><span class="o">=</span><span class="nb">true</span> </span></span></code></pre> </div> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The unique ID of the database to rebalance. </td> </tr> </tbody> </table> <h4 id="query-parameters"> Query parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> dry_run </td> <td> boolean </td> <td> If true, returns the blueprint of the rebalanced database without actually changing the database. Default is false. </td> </tr> <tr> <td> only_failovers </td> <td> boolean </td> <td> If true, only runs failovers and no migrations. Default is false. </td> </tr> <tr> <td> max_operations </td> <td> integer </td> <td> Optional. The number of operations to do. Only works if <code> only_failovers </code> is true. If not provided, uses the number of the database's primary-replica pairs. </td> </tr> </tbody> </table> <h3 id="put-response"> Response </h3> <ul> <li> <p> If <code> dry_run </code> is <code> false </code> , returns an <code> action_uid </code> . You can track the action's progress with a <a href="/docs/latest/operate/rs/references/rest-api/requests/actions/#get-action"> <code> GET /v1/actions/&lt;action_uid&gt; </code> </a> request. </p> </li> <li> <p> If <code> dry_run </code> is <code> true </code> , returns the balanced shards' blueprint. </p> <p> You can rearrange shards according to this blueprint if you use it in the <code> shards_blueprint </code> field of a <a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/optimize_shards_placement/#put-bdbs-rearrange-shards"> rearrange database shards </a> request. </p> <p> You should also pass the rebalance shards' <code> cluster-state-id </code> response header as a request header of the rearrange database shards request to make sure the optimized shard placement is relevant for the current cluster state. The cluster will reject the update if its state changed since the optimal shards placement blueprint was generated. </p> </li> </ul> <h4 id="example-response"> Example response </h4> <p> If <code> dry_run </code> is <code> false </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"action_uid"</span>: <span class="s2">"21ad01d5-55aa-4ec6-b5c0-44dc95176486"</span> </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span></code></pre> </div> <p> If <code> dry_run </code> is <code> true </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="o">[</span> </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"nodes"</span>: <span class="o">[</span> </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"node_uid"</span>: <span class="s2">"3"</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"role"</span>: <span class="s2">"master"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span>, </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"node_uid"</span>: <span class="s2">"1"</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"role"</span>: <span class="s2">"slave"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">]</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"slot_range"</span>: <span class="s2">"5461-10922"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span>, </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"nodes"</span>: <span class="o">[</span> </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"node_uid"</span>: <span class="s2">"3"</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"role"</span>: <span class="s2">"master"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span>, </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"node_uid"</span>: <span class="s2">"1"</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"role"</span>: <span class="s2">"slave"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">]</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"slot_range"</span>: <span class="s2">"10923-16383"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span>, </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"nodes"</span>: <span class="o">[</span> </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"node_uid"</span>: <span class="s2">"3"</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"role"</span>: <span class="s2">"master"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span>, </span></span><span class="line"><span class="cl"> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"node_uid"</span>: <span class="s2">"1"</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"role"</span>: <span class="s2">"slave"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"> <span class="o">]</span>, </span></span><span class="line"><span class="cl"> <span class="s2">"slot_range"</span>: <span class="s2">"0-5460"</span> </span></span><span class="line"><span class="cl"> <span class="o">}</span> </span></span><span class="line"><span class="cl"><span class="o">]</span> </span></span></code></pre> </div> <h4 id="put-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok"> 200 OK </a> </td> <td> When <code> dry_run </code> is false: The request is accepted and is being processed. When the database is recovered, its status will become active. <br/> When <code> dry_run </code> is true: No error. </td> </tr> <tr> <td> <a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request"> 400 Bad Request </a> </td> <td> Bad request. Invalid input parameters. </td> </tr> <tr> <td> <a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found"> 404 Not Found </a> </td> <td> Attempting to perform an action on a nonexistent database. </td> </tr> <tr> <td> <a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-406-not-acceptable"> 406 Not Acceptable </a> </td> <td> Not enough resources in the cluster to host the database. </td> </tr> <tr> <td> <a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-409-conflict"> 409 Conflict </a> </td> <td> Database is currently busy with another action, recovery is already in progress, or is not in a recoverable state. </td> </tr> <tr> <td> <a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-500-internal-server-error"> 500 Internal Server Error </a> </td> <td> Internal server error. </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/rebalance/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/echo/.html
<section class="prose w-full py-12"> <h1 class="command-name"> ECHO </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">ECHO message</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 1.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> <code> @connection </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns <code> message </code> . </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; ECHO "Hello World!" "Hello World!" </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : the given string. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/echo/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/prepare-install/.html
<section class="prose w-full py-12 max-w-none"> <h1> Prepare to install Redis Enterprise Software </h1> <p class="text-lg -mt-5 mb-10"> Prepare to install Redis Enterprise Software. </p> <p> Before you install Redis Enterprise Software: </p> <ul> <li> <p> <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/prepare-install/download-install-package/"> Download an installation package </a> . </p> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/manage-installation-questions/"> View installation questions </a> and optionally prepare answers before installation. </p> </li> <li> <p> Review the <a href="/docs/latest/operate/rs/7.4/security/"> security considerations </a> for your deployment. </p> </li> <li> <p> Check that you have root-level access to each node, either directly or with <code> sudo </code> . </p> </li> <li> <p> Check that all <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/prepare-install/port-availability/"> required ports are available </a> . </p> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/installing-upgrading/configuring/linux-swap/"> Turn off Linux swap </a> on all cluster nodes. </p> </li> <li> <p> If you require the <code> redislabs </code> UID (user ID) and GID (group ID) numbers to be the same on all the nodes, create the <code> redislabs </code> user and group with the required numbers on each node. </p> </li> <li> <p> If you want to use Auto Tiering for your databases, see <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/install-on-linux/#auto-tiering-installation"> Auto Tiering installation </a> . </p> </li> </ul> <h2 id="next-steps"> Next steps </h2> <ul> <li> <p> View <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/install-script/"> installation script options </a> before starting the installation. </p> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/"> Install Redis Enterprise Software </a> . </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/prepare-install/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/redis-data-integration/data-pipelines/deploy/.html
<section class="prose w-full py-12 max-w-none"> <h1> Deploy a pipeline </h1> <p class="text-lg -mt-5 mb-10"> Learn how to deploy an RDI pipeline </p> <p> The sections below explain how to deploy a pipeline after you have created the required <a href="/docs/latest/integrate/redis-data-integration/data-pipelines/data-pipelines/"> configuration </a> . </p> <h2 id="set-secrets"> Set secrets </h2> <p> Before you deploy your pipeline, you must set the authentication secrets for the source and target databases. Each secret has a corresponding property name that you can pass to the <a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-set-secret/"> <code> redis-di set-secret </code> </a> command to set the property's value. You can then refer to these properties in <code> config.yaml </code> using the syntax " <code> ${PROPERTY_NAME} </code> " (the sample <a href="#the-configyaml-file"> config.yaml file </a> shows these properties in use). For example, you would use the following command line to set the source database username to <code> myUserName </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di set-secret SOURCE_DB_USERNAME myUserName </span></span></code></pre> </div> <p> The table below shows the property name for each secret. Note that the username and password are required for the source and target, but the other secrets are only relevant to TLS/mTLS connections. </p> <table> <thead> <tr> <th style="text-align:left"> Property name </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <code> SOURCE_DB_USERNAME </code> </td> <td style="text-align:left"> Username for the source database </td> </tr> <tr> <td style="text-align:left"> <code> SOURCE_DB_PASSWORD </code> </td> <td style="text-align:left"> Password for the source database </td> </tr> <tr> <td style="text-align:left"> <code> SOURCE_DB_CACERT </code> </td> <td style="text-align:left"> (For TLS only) Source database trust certificate </td> </tr> <tr> <td style="text-align:left"> <code> SOURCE_DB_KEY </code> </td> <td style="text-align:left"> (For mTLS only) Source database private key </td> </tr> <tr> <td style="text-align:left"> <code> SOURCE_DB_CERT </code> </td> <td style="text-align:left"> (For mTLS only) Source database public key </td> </tr> <tr> <td style="text-align:left"> <code> SOURCE_DB_KEY_PASSWORD </code> </td> <td style="text-align:left"> (For mTLS only) Source database private key password </td> </tr> <tr> <td style="text-align:left"> <code> TARGET_DB_USERNAME </code> </td> <td style="text-align:left"> Username for the target database </td> </tr> <tr> <td style="text-align:left"> <code> TARGET_DB_PASSWORD </code> </td> <td style="text-align:left"> Password for the target database </td> </tr> <tr> <td style="text-align:left"> <code> TARGET_DB_CACERT </code> </td> <td style="text-align:left"> (For TLS only) Target database trust certificate </td> </tr> <tr> <td style="text-align:left"> <code> TARGET_DB_KEY </code> </td> <td style="text-align:left"> (For mTLS only) Target database private key </td> </tr> <tr> <td style="text-align:left"> <code> TARGET_DB_CERT </code> </td> <td style="text-align:left"> (For mTLS only) Target database public key </td> </tr> <tr> <td style="text-align:left"> <code> TARGET_DB_KEY_PASSWORD </code> </td> <td style="text-align:left"> (For mTLS only) Target database private key password </td> </tr> </tbody> </table> <h2 id="deploy-a-pipeline"> Deploy a pipeline </h2> <p> When you have created your configuration, including the <a href="/docs/latest/integrate/redis-data-integration/data-pipelines/data-pipelines/#job-files"> jobs </a> , use the <a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-deploy/"> <code> redis-di deploy </code> </a> command to deploy them: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di deploy --dir &lt;path to pipeline folder&gt; </span></span></code></pre> </div> <p> You can also deploy a pipeline using <a href="/docs/latest/develop/tools/insight/rdi-connector/"> Redis Insight </a> . </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/data-pipelines/deploy/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise REST API objects </h1> <p class="text-lg -mt-5 mb-10"> Documents the objects used with Redis Enterprise Software REST API calls. </p> <p> Certain <a href="/docs/latest/operate/rs/references/rest-api/requests/"> REST API requests </a> require you to include specific objects in the request body. Many requests also return objects in the response body. </p> <p> Both REST API requests and responses represent these objects as <a href="https://www.json.org"> JSON </a> . </p> <table> <thead> <tr> <th style="text-align:left"> Object </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/action/"> action </a> </td> <td style="text-align:left"> An object that represents cluster actions </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/alert/"> alert </a> </td> <td style="text-align:left"> An object that contains alert info </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/bdb/"> bdb </a> </td> <td style="text-align:left"> An object that represents a database </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/bdb_group/"> bdb_group </a> </td> <td style="text-align:left"> An object that represents a group of databases with a shared memory pool </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/bootstrap/"> bootstrap </a> </td> <td style="text-align:left"> An object for bootstrap configuration </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/check_result/"> check_result </a> </td> <td style="text-align:left"> An object that contains the results of a cluster check </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/cluster/"> cluster </a> </td> <td style="text-align:left"> An object that represents a cluster </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/cluster_settings/"> cluster_settings </a> </td> <td style="text-align:left"> An object for cluster resource management settings </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/cm_settings/"> cm_settings </a> </td> <td style="text-align:left"> A REST API object that represents Cluster Manager UI settings </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/"> crdb </a> </td> <td style="text-align:left"> An object that represents an Active-Active database </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/crdb_task/"> crdb_task </a> </td> <td style="text-align:left"> An object that represents a CRDB task </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/db_alerts_settings/"> db_alerts_settings </a> </td> <td style="text-align:left"> An object for database alerts configuration </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/db-conns-auditing-config/"> db_conns_auditing_config </a> </td> <td style="text-align:left"> An object for database connection auditing settings </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/job_scheduler/"> job_scheduler </a> </td> <td style="text-align:left"> An object for job scheduler settings </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/jwt_authorize/"> jwt_authorize </a> </td> <td style="text-align:left"> An object for user authentication or a JW token refresh request </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/ldap/"> ldap </a> </td> <td style="text-align:left"> An object that contains the cluster's LDAP configuration </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/ldap_mapping/"> ldap_mapping </a> </td> <td style="text-align:left"> An object that represents a mapping between an LDAP group and roles </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/module/"> module </a> </td> <td style="text-align:left"> An object that represents a Redis module </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/node/"> node </a> </td> <td style="text-align:left"> An object that represents a node in the cluster </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/ocsp/"> ocsp </a> </td> <td style="text-align:left"> An object that represents the cluster's OCSP configuration </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/ocsp_status/"> ocsp_status </a> </td> <td style="text-align:left"> An object that represents the cluster's OCSP status </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/proxy/"> proxy </a> </td> <td style="text-align:left"> An object that represents a proxy in the cluster </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/redis_acl/"> redis_acl </a> </td> <td style="text-align:left"> An object that represents a Redis access control list (ACL) </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/role/"> role </a> </td> <td style="text-align:left"> An object that represents a role </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/services_configuration/"> services_configuration </a> </td> <td style="text-align:left"> An object for optional cluster services settings </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/shard/"> shard </a> </td> <td style="text-align:left"> An object that represents a database shard </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/state-machine/"> state-machine </a> </td> <td style="text-align:left"> An object that represents a state machine. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/statistics/"> statistics </a> </td> <td style="text-align:left"> An object that contains metrics for clusters, databases, nodes, or shards </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/suffix/"> suffix </a> </td> <td style="text-align:left"> An object that represents a DNS suffix </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/rest-api/objects/user/"> user </a> </td> <td style="text-align:left"> An API object that represents a Redis Enterprise user </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/offline-installation/.html
<section class="prose w-full py-12 max-w-none"> <h1> Offline installation </h1> <p class="text-lg -mt-5 mb-10"> If you install Redis Enterprise Software on a machine with no internet connection, you need to perform two tasks manually. </p> <p> By default, the installation process requires an internet connection to enable installing dependency packages and for <a href="/docs/latest/operate/rs/7.4/clusters/configure/sync-clocks/"> synchronizing the operating system clock </a> against an NTP server. </p> <p> If you install Redis Enterprise Software on a machine without an internet connection, you need to perform two tasks manually. </p> <h2 id="install-required-dependency-packages"> Install required dependency packages </h2> <p> When you install Redis Enterprise Software on a machine that is not connected to the internet, the installation process fails and displays an error message informing you it failed to automatically install dependencies. Review the installation steps in the console to see which missing dependencies the process attempted to install. Install all these dependency packages and then run the installation again. </p> <h2 id="set-up-ntp-time-synchronization"> Set up NTP time synchronization </h2> <p> At the end of the installation, the process asks if you want to set up NTP time synchronization. If you choose <code> Yes </code> while you are not connected to the internet, the action fails and displays the appropriate error message, but the installation completes successfully. Despite the successful completion of the installation, you still have to configure all nodes for <a href="/docs/latest/operate/rs/7.4/clusters/configure/sync-clocks/"> NTP time synchronization </a> . </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/offline-installation/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/tdigest.min.html
<section class="prose w-full py-12"> <h1 class="command-name"> TDIGEST.MIN </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">TDIGEST.MIN key</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/probabilistic"> Bloom 2.4.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> </dl> <p> Returns the minimum observation value from a t-digest sketch. </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> is key name for an existing t-digest sketch. </details> <h2 id="return-value"> Return value </h2> <p> <a href="/docs/latest/develop/reference/protocol-spec/#simple-strings"> Simple string reply </a> of minimum observation value from a sketch. The result is always accurate. 'nan' if the sketch is empty. </p> <h2 id="examples"> Examples </h2> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; TDIGEST.CREATE t </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; TDIGEST.MIN t </span></span><span class="line"><span class="cl"><span class="s2">"nan"</span> </span></span><span class="line"><span class="cl">redis&gt; TDIGEST.ADD t <span class="m">3</span> <span class="m">4</span> <span class="m">1</span> <span class="m">2</span> <span class="m">5</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; TDIGEST.MIN t </span></span><span class="line"><span class="cl"><span class="s2">"1"</span></span></span></code></pre> </div> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/tdigest.min/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/cf.insert.html
<section class="prose w-full py-12"> <h1 class="command-name"> CF.INSERT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CF.INSERT key [CAPACITY capacity] [NOCREATE] ITEMS item [item ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/probabilistic"> Bloom 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(n * (k + i)), where n is the number of items, k is the number of sub-filters and i is maxIterations </dd> </dl> <p> Adds one or more items to a cuckoo filter, allowing the filter to be created with a custom capacity if it does not exist yet. </p> <p> This command is similar to <a href="/docs/latest/commands/cf.add/"> <code> CF.ADD </code> </a> , except that more than one item can be added and capacity can be specified. </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key name for a cuckoo filter to add items to. </p> <p> If <code> key </code> does not exist - a new cuckoo filter is created. </p> </details> <details open=""> <summary> <code> ITEMS item... </code> </summary> <p> One or more items to add. </p> </details> <h2 id="optional-arguments"> Optional arguments </h2> <details open=""> <summary> <code> CAPACITY capacity </code> </summary> <p> Specifies the desired capacity of the new filter, if this filter does not exist yet. </p> <p> If the filter already exists, then this parameter is ignored. </p> <p> If the filter does not exist yet and this parameter is <em> not </em> specified, then the filter is created with the module-level default capacity which is 1024. </p> <p> See <a href="/docs/latest/commands/cf.reserve/"> <code> CF.RESERVE </code> </a> for more information on cuckoo filter capacities. </p> </details> <details open=""> <summary> <code> NOCREATE </code> </summary> <p> If specified, prevents automatic filter creation if the filter does not exist (Instead, an error is returned). </p> <p> This option is mutually exclusive with <code> CAPACITY </code> . </p> </details> <h2 id="return-value"> Return value </h2> <p> Returns one of these replies: </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec/#arrays"> Array reply </a> of <a href="/docs/latest/develop/reference/protocol-spec/#integers"> Integer reply </a> - where "1" means that the item has been successfully added to the filter, and "-1" means that the item was not added because the filter is full. </li> <li> [] on error (invalid arguments, wrong key type, and so on) and also when <code> NOCREATE </code> is specified and <code> key </code> does not exist. </li> </ul> <h2 id="examples"> Examples </h2> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; CF.INSERT cf CAPACITY <span class="m">1000</span> ITEMS item1 item2 </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span></span></span></code></pre> </div> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; CF.INSERT cf1 CAPACITY <span class="m">1000</span> NOCREATE ITEMS item1 item2 </span></span><span class="line"><span class="cl"><span class="o">(</span>error<span class="o">)</span> ERR not found</span></span></code></pre> </div> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; CF.RESERVE cf2 <span class="m">2</span> BUCKETSIZE <span class="m">1</span> EXPANSION <span class="m">0</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; CF.INSERT cf2 ITEMS <span class="m">1</span> <span class="m">1</span> <span class="m">1</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> -1 </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> -1</span></span></code></pre> </div> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cf.insert/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/kubernetes/release-notes/previous-releases/k8s-5-4-10-8/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise for Kubernetes Release Notes 5.4.10-8 (January 2020) </h1> <p class="text-lg -mt-5 mb-10"> Support for the Redis Enterprise Software 5.4.10 and multiple enhancements. </p> <p> <a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases/tag/5.4.10-8"> Redis Enterprise for Kubernetes 5.4.10-8 </a> is now available. This release includes Redis Enterprise (RS) version <a href="/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-4-10-december-2019/"> 5.4.10-22 </a> and introduces new feature and bug fixes. </p> <h2 id="overview"> Overview </h2> <p> This is a maintenance release providing support for the Redis Enterprise Software release 5.4.10 and includes multiple enhancements. </p> <p> Follow these <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/"> instructions </a> for upgrading to this Kubernetes operator release. </p> <h2 id="new-features"> New features </h2> <ul> <li> <p> All-in-one deployment bundle and documentation enhancements - This release is the easiest to deploy yet, with a new quick start guide and an all-in-one file bundle for deploying the Redis Enterprise Operator. GitHub documentation was enhanced to cover advanced deployment scenarios with the complete reference to the custom resource specifications, guides, and examples. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Note: </div> <pre><code>Pay special attention to the yaml file naming changes and new yaml files that have been created for this release. These are highlighted in the quick start guide. </code></pre> </div> </div> </li> <li> <p> Rack Awareness - Support for the [Redis Software Rack Awareness][/docs/latest/operate/rs/clusters/configure/rack-zone-awareness/] feature was introduced to the Kubernetes deployment. It enables deploying nodes to different zones, in a multi-zone Kubernetes cluster. Databases that are rack-aware will have the cluster populate their master shard and replica shards in different nodes, across different zones or failure domains. This enables maintaining data persistence in case of zone failure. </p> </li> <li> <p> OLM Support - Redis Enterprise for Kubernetes is now RedHat OpenShift certified and can be effortlessly configured and deployed in Kubernetes clusters supporting OLM, including OpenShift 4.x clusters, with just a few clicks. OLM based deployments do not require Kubernetes cluster administrator rights to deploy the operator. </p> </li> <li> <p> Improve cluster nodes' pod scheduling resiliency - Redis Enterprise Cluster pod scheduling is hardened by implementing Kubernetes best practices and providing configuration recommendations to cluster operators. Scheduling resiliency minimizes the chance of cluster node pods eviction or failure to schedule. See the top 4 articles in the new <a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/92a2eff4b8c4ccafac459138f12e5f38acde825c/docs/topics.md#additional-topics"> Additonal Topics </a> documentation section. </p> </li> <li> <p> Update app.redislabs.com API version to stable - We've updated the Redis Enterprise Cluster custom resource API from <a href="https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-versioning"> alpha to stable </a> to reflect the current state of maturity of our implementation. </p> </li> </ul> <p> <a href="https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/"> Both versions of the API are supported </a> by Kubernetes versions that support specifying multiple API versions. </p> <p> For legacy Kubernetes versions, deployment files are available in the documentation repository that utilize the alpha version of the API. </p> <h2 id="information"> Information </h2> <ul> <li> This new release deprecates the Redis Enterprise Operator support for legacy Kubernetes version 1.8. </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <ul> <li> <p> Custom Resource Definition Changes - In order to comply with OLM best practices, a change was required to the Redis Enterprise Cluster Custom Resource Defintion (CRD) to introduce the status sub-resource. As a result of this change, any upgrade from an older release to this release requires a change to the CRD. Once the CRD is updated, all Redis Enterprise Clusters in the same K8s cluster must be updated to the latest release in order to continue operating properly. </p> </li> <li> <p> Cluster Recovery - </p> </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/release-notes/previous-releases/k8s-5-4-10-8/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/clusters/configure/.html
<section class="prose w-full py-12 max-w-none"> <h1> Configure clusters </h1> <p class="text-lg -mt-5 mb-10"> Configuration options for your Redis Enterprise cluster. </p> <p> You can manage your Redis Enterprise Software clusters with several different tools: </p> <ul> <li> Cluster Manager UI (the web-based user interface) </li> <li> Command-line tools ( <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/"> rladmin </a> , <a href="/docs/latest/develop/tools/cli/"> redis-cli </a> , <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/"> crdb-cli </a> ) </li> <li> <a href="/docs/latest/operate/rs/references/rest-api/"> REST API </a> </li> </ul> <nav> <a href="/docs/latest/operate/rs/clusters/configure/cluster-settings/"> Cluster settings </a> <p> You can view and set various cluster settings such as cluster name, email service, time zone, and license. </p> <a href="/docs/latest/operate/rs/clusters/configure/license-keys/"> Cluster license keys </a> <p> The cluster key (or license) enables features and capacity within Redis Enterprise Software </p> <a href="/docs/latest/operate/rs/clusters/configure/sync-clocks/"> Synchronize cluster node clocks </a> <p> Sync node clocks to avoid problems with internal custer communication. </p> <a href="/docs/latest/operate/rs/clusters/configure/rack-zone-awareness/"> Rack-zone awareness in Redis Enterprise Software </a> <p> Rack-zone awareness ensures high availability in the event of a rack or zone failure. </p> </nav> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/clusters/configure/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/cf.exists.html
<section class="prose w-full py-12"> <h1 class="command-name"> CF.EXISTS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CF.EXISTS key item</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available in: </dt> <dd class="m-0"> <a href="/docs/stack"> Redis Stack </a> / <a href="/docs/data-types/probabilistic"> Bloom 1.0.0 </a> </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(k), where k is the number of sub-filters </dd> </dl> <p> Determines whether a given item was added to a cuckoo filter. </p> <p> This command is similar to <a href="/docs/latest/commands/cf.mexists/"> <code> CF.MEXISTS </code> </a> , except that only one item can be checked. </p> <h2 id="required-arguments"> Required arguments </h2> <details open=""> <summary> <code> key </code> </summary> <p> is key name for a cuckoo filter. </p> </details> <details open=""> <summary> <code> item </code> </summary> <p> is an item to check. </p> </details> <h2 id="return-value"> Return value </h2> <p> Returns one of these replies: </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec/#integers"> Integer reply </a> , where <code> 1 </code> means that, with high probability, <code> item </code> had already been added to the filter, and <code> 0 </code> means that <code> key </code> does not exist or that <code> item </code> had not been added to the filter. See note in <a href="/docs/latest/commands/cf.del/"> <code> CF.DEL </code> </a> . </li> <li> [] on error (invalid arguments, wrong key type, and so on) </li> </ul> <h2 id="examples"> Examples </h2> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; CF.ADD cf item1 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; CF.EXISTS cf item1 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span> </span></span><span class="line"><span class="cl">redis&gt; CF.EXISTS cf item2 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span></span></span></code></pre> </div> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cf.exists/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/hexists/.html
<section class="prose w-full py-12"> <h1 class="command-name"> HEXISTS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">HEXISTS key field</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @read </code> <span class="mr-1 last:hidden"> , </span> <code> @hash </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns if <code> field </code> is an existing field in the hash stored at <code> key </code> . </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; HSET myhash field1 "foo" (integer) 1 redis&gt; HEXISTS myhash field1 (integer) 1 redis&gt; HEXISTS myhash field2 (integer) 0 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 0 </code> if the hash does not contain the field, or the key does not exist. </li> <li> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : <code> 1 </code> if the hash contains the field. </li> </ul> <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/hexists/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/get-started/faq/.html
<section class="prose w-full py-12"> <h1> Redis FAQ </h1> <p class="text-lg -mt-5 mb-10"> Commonly asked questions when getting started with Redis </p> <h2 id="how-is-redis-different-from-other-key-value-stores"> How is Redis different from other key-value stores? </h2> <ul> <li> Redis has a different evolution path in the key-value DBs where values can contain more complex data types, with atomic operations defined on those data types. Redis data types are closely related to fundamental data structures and are exposed to the programmer as such, without additional abstraction layers. </li> <li> Redis is an in-memory but persistent on disk database, so it represents a different trade off where very high write and read speed is achieved with the limitation of data sets that can't be larger than memory. Another advantage of in-memory databases is that the memory representation of complex data structures is much simpler to manipulate compared to the same data structures on disk, so Redis can do a lot with little internal complexity. At the same time the two on-disk storage formats (RDB and AOF) don't need to be suitable for random access, so they are compact and always generated in an append-only fashion (Even the AOF log rotation is an append-only operation, since the new version is generated from the copy of data in memory). However this design also involves different challenges compared to traditional on-disk stores. Being the main data representation on memory, Redis operations must be carefully handled to make sure there is always an updated version of the data set on disk. </li> </ul> <h2 id="whats-the-redis-memory-footprint"> What's the Redis memory footprint? </h2> <p> To give you a few examples (all obtained using 64-bit instances): </p> <ul> <li> An empty instance uses ~ 3MB of memory. </li> <li> 1 Million small Keys -&gt; String Value pairs use ~ 85MB of memory. </li> <li> 1 Million Keys -&gt; Hash value, representing an object with 5 fields, use ~ 160 MB of memory. </li> </ul> <p> Testing your use case is trivial. Use the <code> redis-benchmark </code> utility to generate random data sets then check the space used with the <code> INFO memory </code> command. </p> <p> 64-bit systems will use considerably more memory than 32-bit systems to store the same keys, especially if the keys and values are small. This is because pointers take 8 bytes in 64-bit systems. But of course the advantage is that you can have a lot of memory in 64-bit systems, so in order to run large Redis servers a 64-bit system is more or less required. The alternative is sharding. </p> <h2 id="why-does-redis-keep-its-entire-dataset-in-memory"> Why does Redis keep its entire dataset in memory? </h2> <p> In the past the Redis developers experimented with Virtual Memory and other systems in order to allow larger than RAM datasets, but after all we are very happy if we can do one thing well: data served from memory, disk used for storage. So for now there are no plans to create an on disk backend for Redis. Most of what Redis is, after all, a direct result of its current design. </p> <p> If your real problem is not the total RAM needed, but the fact that you need to split your data set into multiple Redis instances, please read the <a href="/docs/latest/operate/oss_and_stack/management/scaling/"> partitioning page </a> in this documentation for more info. </p> <p> Redis Ltd., the company sponsoring Redis development, has developed a "Redis on Flash" solution that uses a mixed RAM/flash approach for larger data sets with a biased access pattern. You may check their offering for more information, however this feature is not part of the Redis Community Edition code base. </p> <h2 id="can-you-use-redis-with-a-disk-based-database"> Can you use Redis with a disk-based database? </h2> <p> Yes, a common design pattern involves taking very write-heavy small data in Redis (and data you need the Redis data structures to model your problem in an efficient way), and big <em> blobs </em> of data into an SQL or eventually consistent on-disk database. Similarly sometimes Redis is used in order to take in memory another copy of a subset of the same data stored in the on-disk database. This may look similar to caching, but actually is a more advanced model since normally the Redis dataset is updated together with the on-disk DB dataset, and not refreshed on cache misses. </p> <h2 id="how-can-i-reduce-redis-overall-memory-usage"> How can I reduce Redis' overall memory usage? </h2> <p> A good practice is to consider memory consumption when mapping your logical data model to the physical data model within Redis. These considerations include using specific data types, key patterns, and normalization. </p> <p> Beyond data modeling, there is more info in the <a href="/docs/latest/operate/oss_and_stack/management/optimization/memory-optimization/"> Memory Optimization page </a> . </p> <h2 id="what-happens-if-redis-runs-out-of-memory"> What happens if Redis runs out of memory? </h2> <p> Redis has built-in protections allowing the users to set a max limit on memory usage, using the <code> maxmemory </code> option in the configuration file to put a limit to the memory Redis can use. If this limit is reached, Redis will start to reply with an error to write commands (but will continue to accept read-only commands). </p> <p> You can also configure Redis to evict keys when the max memory limit is reached. See the <a href="/docs/latest/develop/reference/eviction/"> eviction policy docs </a> for more information on this. </p> <h2 id="background-saving-fails-with-a-fork-error-on-linux"> Background saving fails with a fork() error on Linux? </h2> <p> Short answer: <code> echo 1 &gt; /proc/sys/vm/overcommit_memory </code> :) </p> <p> And now the long one: </p> <p> The Redis background saving schema relies on the copy-on-write semantic of the <code> fork </code> system call in modern operating systems: Redis forks (creates a child process) that is an exact copy of the parent. The child process dumps the DB on disk and finally exits. In theory the child should use as much memory as the parent being a copy, but actually thanks to the copy-on-write semantic implemented by most modern operating systems the parent and child process will <em> share </em> the common memory pages. A page will be duplicated only when it changes in the child or in the parent. Since in theory all the pages may change while the child process is saving, Linux can't tell in advance how much memory the child will take, so if the <code> overcommit_memory </code> setting is set to zero the fork will fail unless there is as much free RAM as required to really duplicate all the parent memory pages. If you have a Redis dataset of 3 GB and just 2 GB of free memory it will fail. </p> <p> Setting <code> overcommit_memory </code> to 1 tells Linux to relax and perform the fork in a more optimistic allocation fashion, and this is indeed what you want for Redis. </p> <p> You can refer to the <a href="http://man7.org/linux/man-pages/man5/proc.5.html"> proc(5) </a> man page for explanations of the available values. </p> <h2 id="are-redis-on-disk-snapshots-atomic"> Are Redis on-disk snapshots atomic? </h2> <p> Yes, the Redis background saving process is always forked when the server is outside of the execution of a command, so every command reported to be atomic in RAM is also atomic from the point of view of the disk snapshot. </p> <h2 id="how-can-redis-use-multiple-cpus-or-cores"> How can Redis use multiple CPUs or cores? </h2> <p> It's not very frequent that CPU becomes your bottleneck with Redis, as usually Redis is either memory or network bound. For instance, when using pipelining a Redis instance running on an average Linux system can deliver 1 million requests per second, so if your application mainly uses O(N) or O(log(N)) commands, it is hardly going to use too much CPU. </p> <p> However, to maximize CPU usage you can start multiple instances of Redis in the same box and treat them as different servers. At some point a single box may not be enough anyway, so if you want to use multiple CPUs you can start thinking of some way to shard earlier. </p> <p> You can find more information about using multiple Redis instances in the <a href="/docs/latest/operate/oss_and_stack/management/scaling/"> Partitioning page </a> . </p> <p> As of version 4.0, Redis has started implementing threaded actions. For now this is limited to deleting objects in the background and blocking commands implemented via Redis modules. For subsequent releases, the plan is to make Redis more and more threaded. </p> <h2 id="what-is-the-maximum-number-of-keys-a-single-redis-instance-can-hold-what-is-the-maximum-number-of-elements-in-a-hash-list-set-and-sorted-set"> What is the maximum number of keys a single Redis instance can hold? What is the maximum number of elements in a Hash, List, Set, and Sorted Set? </h2> <p> Redis can handle up to 2^32 keys, and was tested in practice to handle at least 250 million keys per instance. </p> <p> Every hash, list, set, and sorted set, can hold 2^32 elements. </p> <p> In other words your limit is likely the available memory in your system. </p> <h2 id="why-does-my-replica-have-a-different-number-of-keys-its-master-instance"> Why does my replica have a different number of keys its master instance? </h2> <p> If you use keys with limited time to live (Redis expires) this is normal behavior. This is what happens: </p> <ul> <li> The primary generates an RDB file on the first synchronization with the replica. </li> <li> The RDB file will not include keys already expired in the primary but which are still in memory. </li> <li> These keys are still in the memory of the Redis primary, even if logically expired. They'll be considered non-existent, and their memory will be reclaimed later, either incrementally or explicitly on access. While these keys are not logically part of the dataset, they are accounted for in the <a href="/docs/latest/commands/info/"> <code> INFO </code> </a> output and in the <a href="/docs/latest/commands/dbsize/"> <code> DBSIZE </code> </a> command. </li> <li> When the replica reads the RDB file generated by the primary, this set of keys will not be loaded. </li> </ul> <p> Because of this, it's common for users with many expired keys to see fewer keys in the replicas. However, logically, the primary and replica will have the same content. </p> <h2 id="where-does-the-name-redis-come-from"> Where does the name "Redis" come from? </h2> <p> Redis is an acronym that stands for <strong> RE </strong> mote <strong> DI </strong> ctionary <strong> S </strong> erver. </p> <h2 id="why-did-salvatore-sanfilippo-start-the-redis-project"> Why did Salvatore Sanfilippo start the Redis project? </h2> <p> Salvatore originally created Redis to scale <a href="https://github.com/antirez/lloogg"> LLOOGG </a> , a real-time log analysis tool. But after getting the basic Redis server working, he decided to share the work with other people and turn Redis into an open source project. </p> <h2 id="how-is-redis-pronounced"> How is Redis pronounced? </h2> <p> "Redis" (/ˈrɛd-ɪs/) is pronounced like the word "red" plus the word "kiss" without the "k". </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/get-started/faq/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/config-rewrite/.html
<section class="prose w-full py-12"> <h1 class="command-name"> CONFIG REWRITE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CONFIG REWRITE</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.8.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(1) </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @admin </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @dangerous </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> The <code> CONFIG REWRITE </code> command rewrites the <code> redis.conf </code> file the server was started with, applying the minimal changes needed to make it reflect the configuration currently used by the server, which may be different compared to the original one because of the use of the <a href="/docs/latest/commands/config-set/"> <code> CONFIG SET </code> </a> command. </p> <p> The rewrite is performed in a very conservative way: </p> <ul> <li> Comments and the overall structure of the original redis.conf are preserved as much as possible. </li> <li> If an option already exists in the old redis.conf file, it will be rewritten at the same position (line number). </li> <li> If an option was not already present, but it is set to its default value, it is not added by the rewrite process. </li> <li> If an option was not already present, but it is set to a non-default value, it is appended at the end of the file. </li> <li> Non used lines are blanked. For instance if you used to have multiple <code> save </code> directives, but the current configuration has fewer or none as you disabled RDB persistence, all the lines will be blanked. </li> </ul> <p> CONFIG REWRITE is also able to rewrite the configuration file from scratch if the original one no longer exists for some reason. However if the server was started without a configuration file at all, the CONFIG REWRITE will just return an error. </p> <h2 id="atomic-rewrite-process"> Atomic rewrite process </h2> <p> In order to make sure the redis.conf file is always consistent, that is, on errors or crashes you always end with the old file, or the new one, the rewrite is performed with a single <code> write(2) </code> call that has enough content to be at least as big as the old file. Sometimes additional padding in the form of comments is added in order to make sure the resulting file is big enough, and later the file gets truncated to remove the padding at the end. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> when the configuration was rewritten properly. Otherwise an error is returned. <br/> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/config-rewrite/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/develop/interact/programmability/lua-api/.html
<section class="prose w-full py-12"> <h1> Redis Lua API reference </h1> <p class="text-lg -mt-5 mb-10"> Executing Lua in Redis </p> <p> Redis includes an embedded <a href="https://www.lua.org/"> Lua 5.1 </a> interpreter. The interpreter runs user-defined <a href="/docs/latest/develop/interact/programmability/eval-intro/"> ephemeral scripts </a> and <a href="/docs/latest/develop/interact/programmability/functions-intro/"> functions </a> . Scripts run in a sandboxed context and can only access specific Lua packages. This page describes the packages and APIs available inside the execution's context. </p> <h2 id="sandbox-context"> Sandbox context </h2> <p> The sandboxed Lua context attempts to prevent accidental misuse and reduce potential threats from the server's environment. </p> <p> Scripts should never try to access the Redis server's underlying host systems. That includes the file system, network, and any other attempt to perform a system call other than those supported by the API. </p> <p> Scripts should operate solely on data stored in Redis and data provided as arguments to their execution. </p> <h3 id="global-variables-and-functions"> Global variables and functions </h3> <p> The sandboxed Lua execution context blocks the declaration of global variables and functions. The blocking of global variables is in place to ensure that scripts and functions don't attempt to maintain any runtime context other than the data stored in Redis. In the (somewhat uncommon) use case that a context needs to be maintain between executions, you should store the context in Redis' keyspace. </p> <p> Redis will return a "Script attempted to create global variable 'my_global_variable" error when trying to execute the following snippet: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">my_global_variable</span> <span class="o">=</span> <span class="s1">'some value'</span> </span></span></code></pre> </div> <p> And similarly for the following global function declaration: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kr">function</span> <span class="nf">my_global_function</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="c1">-- Do something amazing</span> </span></span><span class="line"><span class="cl"><span class="kr">end</span> </span></span></code></pre> </div> <p> You'll also get a similar error when your script attempts to access any global variables that are undefined in the runtime's context: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="c1">-- The following will surely raise an error</span> </span></span><span class="line"><span class="cl"><span class="kr">return</span> <span class="n">an_undefined_global_variable</span> </span></span></code></pre> </div> <p> Instead, all variable and function definitions are required to be declared as local. To do so, you'll need to prepend the <a href="https://www.lua.org/manual/5.1/manual.html#2.4.7"> <em> local </em> </a> keyword to your declarations. For example, the following snippet will be considered perfectly valid by Redis: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">my_local_variable</span> <span class="o">=</span> <span class="s1">'some value'</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="kr">function</span> <span class="nf">my_local_function</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="c1">-- Do something else, but equally amazing</span> </span></span><span class="line"><span class="cl"><span class="kr">end</span> </span></span></code></pre> </div> <p> <strong> Note: </strong> the sandbox attempts to prevent the use of globals. Using Lua's debugging functionality or other approaches such as altering the meta table used for implementing the globals' protection to circumvent the sandbox isn't hard. However, it is difficult to circumvent the protection by accident. If the user messes with the Lua global state, the consistency of AOF and replication can't be guaranteed. In other words, just don't do it. </p> <h3 id="imported-lua-modules"> Imported Lua modules </h3> <p> Using imported Lua modules is not supported inside the sandboxed execution context. The sandboxed execution context prevents the loading modules by disabling Lua's <a href="https://www.lua.org/pil/8.1.html"> <code> require </code> function </a> . </p> <p> The only libraries that Redis ships with and that you can use in scripts are listed under the <a href="#runtime-libraries"> Runtime libraries </a> section. </p> <h2 id="runtime-globals"> Runtime globals </h2> <p> While the sandbox prevents users from declaring globals, the execution context is pre-populated with several of these. </p> <h3 id="the-_redis_-singleton"> The <em> redis </em> singleton </h3> <p> The <em> redis </em> singleton is an object instance that's accessible from all scripts. It provides the API to interact with Redis from scripts. Its description follows <a href="#redis_object"> below </a> . </p> <h3 id="the-keys-global-variable"> The <em> KEYS </em> global variable </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: no </li> </ul> <p> <strong> Important: </strong> to ensure the correct execution of scripts, both in standalone and clustered deployments, all names of keys that a function accesses must be explicitly provided as input key arguments. The script <strong> should only </strong> access keys whose names are given as input arguments. Scripts <strong> should never </strong> access keys with programmatically-generated names or based on the contents of data structures stored in the database. </p> <p> The <em> KEYS </em> global variable is available only for <a href="/docs/latest/develop/interact/programmability/eval-intro/"> ephemeral scripts </a> . It is pre-populated with all key name input arguments. </p> <h3 id="the-argv-global-variable"> The <em> ARGV </em> global variable </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: no </li> </ul> <p> The <em> ARGV </em> global variable is available only in <a href="/docs/latest/develop/interact/programmability/eval-intro/"> ephemeral scripts </a> . It is pre-populated with all regular input arguments. </p> <h2 id="redis_object"> <em> redis </em> object </h2> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> The Redis Lua execution context always provides a singleton instance of an object named <em> redis </em> . The <em> redis </em> instance enables the script to interact with the Redis server that's running it. Following is the API provided by the <em> redis </em> object instance. </p> <h3 id="redis.call"> <code> redis.call(command [,arg...]) </code> </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> The <code> redis.call() </code> function calls a given Redis command and returns its reply. Its inputs are the command and arguments, and once called, it executes the command in Redis and returns the reply. </p> <p> For example, we can call the <a href="/docs/latest/commands/echo/"> <code> ECHO </code> </a> command from a script and return its reply like so: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kr">return</span> <span class="n">redis.call</span><span class="p">(</span><span class="s1">'ECHO'</span><span class="p">,</span> <span class="s1">'Echo, echo... eco... o...'</span><span class="p">)</span> </span></span></code></pre> </div> <p> If and when <code> redis.call() </code> triggers a runtime exception, the raw exception is raised back to the user as an error, automatically. Therefore, attempting to execute the following ephemeral script will fail and generate a runtime exception because <a href="/docs/latest/commands/echo/"> <code> ECHO </code> </a> accepts exactly one argument: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis</span><span class="o">&gt;</span> <span class="n">EVAL</span> <span class="s2">"return redis.call('ECHO', 'Echo,', 'echo... ', 'eco... ', 'o...')"</span> <span class="mi">0</span> </span></span><span class="line"><span class="cl"><span class="p">(</span><span class="n">error</span><span class="p">)</span> <span class="n">ERR</span> <span class="n">Wrong</span> <span class="n">number</span> <span class="n">of</span> <span class="n">args</span> <span class="n">calling</span> <span class="n">Redis</span> <span class="n">command</span> <span class="n">from</span> <span class="n">script</span> <span class="n">script</span><span class="p">:</span> <span class="n">b0345693f4b77517a711221050e76d24ae60b7f7</span><span class="p">,</span> <span class="n">on</span> <span class="err">@</span><span class="n">user_script</span><span class="p">:</span><span class="mf">1.</span> </span></span></code></pre> </div> <p> Note that the call can fail due to various reasons, see <a href="/docs/latest/develop/interact/programmability/eval-intro/#execution-under-low-memory-conditions"> Execution under low memory conditions </a> and <a href="#script_flags"> Script flags </a> </p> <p> To handle Redis runtime errors use <code> redis.pcall() </code> instead. </p> <h3 id="redis.pcall"> <code> redis.pcall(command [,arg...]) </code> </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> This function enables handling runtime errors raised by the Redis server. The <code> redis.pcall() </code> function behaves exactly like <a href="#redis.call"> <code> redis.call() </code> </a> , except that it: </p> <ul> <li> Always returns a reply. </li> <li> Never throws a runtime exception, and returns in its stead a <a href="#redis.error_reply"> <code> redis.error_reply </code> </a> in case that a runtime exception is thrown by the server. </li> </ul> <p> The following demonstrates how to use <code> redis.pcall() </code> to intercept and handle runtime exceptions from within the context of an ephemeral script. </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">reply</span> <span class="o">=</span> <span class="n">redis.pcall</span><span class="p">(</span><span class="s1">'ECHO'</span><span class="p">,</span> <span class="n">unpack</span><span class="p">(</span><span class="n">ARGV</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="kr">if</span> <span class="n">reply</span><span class="p">[</span><span class="s1">'err'</span><span class="p">]</span> <span class="o">~=</span> <span class="kc">nil</span> <span class="kr">then</span> </span></span><span class="line"><span class="cl"> <span class="c1">-- Handle the error sometime, but for now just log it</span> </span></span><span class="line"><span class="cl"> <span class="n">redis.log</span><span class="p">(</span><span class="n">redis.LOG_WARNING</span><span class="p">,</span> <span class="n">reply</span><span class="p">[</span><span class="s1">'err'</span><span class="p">])</span> </span></span><span class="line"><span class="cl"> <span class="n">reply</span><span class="p">[</span><span class="s1">'err'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'ERR Something is wrong, but no worries, everything is under control'</span> </span></span><span class="line"><span class="cl"><span class="kr">end</span> </span></span><span class="line"><span class="cl"><span class="kr">return</span> <span class="n">reply</span> </span></span></code></pre> </div> <p> Evaluating this script with more than one argument will return: </p> <pre tabindex="0"><code>redis&gt; EVAL "..." 0 hello world (error) ERR Something is wrong, but no worries, everything is under control </code></pre> <h3 id="redis.error_reply"> <code> redis.error_reply(x) </code> </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> This is a helper function that returns an <a href="/docs/latest/develop/reference/protocol-spec/#simple-errors"> error reply </a> . The helper accepts a single string argument and returns a Lua table with the <em> err </em> field set to that string. </p> <p> The outcome of the following code is that <em> error1 </em> and <em> error2 </em> are identical for all intents and purposes: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">text</span> <span class="o">=</span> <span class="s1">'ERR My very special error'</span> </span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">reply1</span> <span class="o">=</span> <span class="p">{</span> <span class="n">err</span> <span class="o">=</span> <span class="n">text</span> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">reply2</span> <span class="o">=</span> <span class="n">redis.error_reply</span><span class="p">(</span><span class="n">text</span><span class="p">)</span> </span></span></code></pre> </div> <p> Therefore, both forms are valid as means for returning an error reply from scripts: </p> <pre tabindex="0"><code>redis&gt; EVAL "return { err = 'ERR My very special table error' }" 0 (error) ERR My very special table error redis&gt; EVAL "return redis.error_reply('ERR My very special reply error')" 0 (error) ERR My very special reply error </code></pre> <p> For returning Redis status replies refer to <a href="#redis.status_reply"> <code> redis.status_reply() </code> </a> . Refer to the <a href="#data-type-conversion"> Data type conversion </a> for returning other response types. </p> <p> <strong> Note: </strong> By convention, Redis uses the first word of an error string as a unique error code for specific errors or <code> ERR </code> for general-purpose errors. Scripts are advised to follow this convention, as shown in the example above, but this is not mandatory. </p> <h3 id="redis.status_reply"> <code> redis.status_reply(x) </code> </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> This is a helper function that returns a <a href="/docs/latest/develop/reference/protocol-spec#simple-strings"> simple string reply </a> . "OK" is an example of a standard Redis status reply. The Lua API represents status replies as tables with a single field, <em> ok </em> , set with a simple status string. </p> <p> The outcome of the following code is that <em> status1 </em> and <em> status2 </em> are identical for all intents and purposes: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">text</span> <span class="o">=</span> <span class="s1">'Frosty'</span> </span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">status1</span> <span class="o">=</span> <span class="p">{</span> <span class="n">ok</span> <span class="o">=</span> <span class="n">text</span> <span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">status2</span> <span class="o">=</span> <span class="n">redis.status_reply</span><span class="p">(</span><span class="n">text</span><span class="p">)</span> </span></span></code></pre> </div> <p> Therefore, both forms are valid as means for returning status replies from scripts: </p> <pre tabindex="0"><code>redis&gt; EVAL "return { ok = 'TICK' }" 0 TICK redis&gt; EVAL "return redis.status_reply('TOCK')" 0 TOCK </code></pre> <p> For returning Redis error replies refer to <a href="#redis.error_reply"> <code> redis.error_reply() </code> </a> . Refer to the <a href="#data-type-conversion"> Data type conversion </a> for returning other response types. </p> <h3 id="redis.sha1hex"> <code> redis.sha1hex(x) </code> </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> This function returns the SHA1 hexadecimal digest of its single string argument. </p> <p> You can, for example, obtain the empty string's SHA1 digest: </p> <pre tabindex="0"><code>redis&gt; EVAL "return redis.sha1hex('')" 0 "da39a3ee5e6b4b0d3255bfef95601890afd80709" </code></pre> <h3 id="redis.log"> <code> redis.log(level, message) </code> </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> This function writes to the Redis server log. </p> <p> It expects two input arguments: the log level and a message. The message is a string to write to the log file. Log level can be on of these: </p> <ul> <li> <code> redis.LOG_DEBUG </code> </li> <li> <code> redis.LOG_VERBOSE </code> </li> <li> <code> redis.LOG_NOTICE </code> </li> <li> <code> redis.LOG_WARNING </code> </li> </ul> <p> These levels map to the server's log levels. The log only records messages equal or greater in level than the server's <code> loglevel </code> configuration directive. </p> <p> The following snippet: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis.log</span><span class="p">(</span><span class="n">redis.LOG_WARNING</span><span class="p">,</span> <span class="s1">'Something is terribly wrong'</span><span class="p">)</span> </span></span></code></pre> </div> <p> will produce a line similar to the following in your server's log: </p> <pre tabindex="0"><code>[32343] 22 Mar 15:21:39 # Something is terribly wrong </code></pre> <h3 id="redis.setresp"> <code> redis.setresp(x) </code> </h3> <ul> <li> Since version: 6.0.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> This function allows the executing script to switch between <a href="/docs/latest/develop/reference/protocol-spec/"> Redis Serialization Protocol (RESP) </a> versions for the replies returned by <a href="#redis.call"> <code> redis.call() </code> </a> and <a href="#redis.pcall"> <code> redis.pcall() </code> </a> . It expects a single numerical argument as the protocol's version. The default protocol version is <em> 2 </em> , but it can be switched to version <em> 3 </em> . </p> <p> Here's an example of switching to RESP3 replies: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis.setresp</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span> </span></span></code></pre> </div> <p> Please refer to the <a href="#data-type-conversion"> Data type conversion </a> for more information about type conversions. </p> <h3 id="redis.set_repl"> <code> redis.set_repl(x) </code> </h3> <ul> <li> Since version: 3.2.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: no </li> </ul> <p> <strong> Note: </strong> this feature is only available when script effects replication is employed. Calling it when using verbatim script replication will result in an error. As of Redis version 2.6.0, scripts were replicated verbatim, meaning that the scripts' source code was sent for execution by replicas and stored in the AOF. An alternative replication mode added in version 3.2.0 allows replicating only the scripts' effects. As of Redis version 7.0, script replication is no longer supported, and the only replication mode available is script effects replication. </p> <p> <strong> Warning: </strong> this is an advanced feature. Misuse can cause damage by violating the contract that binds the Redis master, its replicas, and AOF contents to hold the same logical content. </p> <p> This function allows a script to assert control over how its effects are propagated to replicas and the AOF afterward. A script's effects are the Redis write commands that it calls. </p> <p> By default, all write commands that a script executes are replicated. Sometimes, however, better control over this behavior can be helpful. This can be the case, for example, when storing intermediate values in the master alone. </p> <p> Consider a script that intersects two sets and stores the result in a temporary key with <a href="/docs/latest/commands/sunionstore/"> <code> SUNIONSTORE </code> </a> . It then picks five random elements ( <a href="/docs/latest/commands/srandmember/"> <code> SRANDMEMBER </code> </a> ) from the intersection and stores ( <a href="/docs/latest/commands/sadd/"> <code> SADD </code> </a> ) them in another set. Finally, before returning, it deletes the temporary key that stores the intersection of the two source sets. </p> <p> In this case, only the new set with its five randomly-chosen elements needs to be replicated. Replicating the <a href="/docs/latest/commands/sunionstore/"> <code> SUNIONSTORE </code> </a> command and the <a href="/docs/latest/commands/del/"> <code> DEL </code> </a> ition of the temporary key is unnecessary and wasteful. </p> <p> The <code> redis.set_repl() </code> function instructs the server how to treat subsequent write commands in terms of replication. It accepts a single input argument that only be one of the following: </p> <ul> <li> <code> redis.REPL_ALL </code> : replicates the effects to the AOF and replicas. </li> <li> <code> redis.REPL_AOF </code> : replicates the effects to the AOF alone. </li> <li> <code> redis.REPL_REPLICA </code> : replicates the effects to the replicas alone. </li> <li> <code> redis.REPL_SLAVE </code> : same as <code> REPL_REPLICA </code> , maintained for backward compatibility. </li> <li> <code> redis.REPL_NONE </code> : disables effect replication entirely. </li> </ul> <p> By default, the scripting engine is initialized to the <code> redis.REPL_ALL </code> setting when a script begins its execution. You can call the <code> redis.set_repl() </code> function at any time during the script's execution to switch between the different replication modes. </p> <p> A simple example follows: </p> <div class="highlight"> <pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis.replicate_commands</span><span class="p">()</span> <span class="c1">-- Enable effects replication in versions lower than Redis v7.0</span> </span></span><span class="line"><span class="cl"><span class="n">redis.call</span><span class="p">(</span><span class="s1">'SET'</span><span class="p">,</span> <span class="n">KEYS</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">ARGV</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="n">redis.set_repl</span><span class="p">(</span><span class="n">redis.REPL_NONE</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">redis.call</span><span class="p">(</span><span class="s1">'SET'</span><span class="p">,</span> <span class="n">KEYS</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">ARGV</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span> </span></span><span class="line"><span class="cl"><span class="n">redis.set_repl</span><span class="p">(</span><span class="n">redis.REPL_ALL</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">redis.call</span><span class="p">(</span><span class="s1">'SET'</span><span class="p">,</span> <span class="n">KEYS</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">ARGV</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span> </span></span></code></pre> </div> <p> If you run this script by calling <code> EVAL "..." 3 A B C 1 2 3 </code> , the result will be that only the keys <em> A </em> and <em> C </em> are created on the replicas and AOF. </p> <h3 id="redis.replicate_commands"> <code> redis.replicate_commands() </code> </h3> <ul> <li> Since version: 3.2.0 </li> <li> Until version: 7.0.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: no </li> </ul> <p> This function switches the script's replication mode from verbatim replication to effects replication. You can use it to override the default verbatim script replication mode used by Redis until version 7.0. </p> <p> <strong> Note: </strong> as of Redis v7.0, verbatim script replication is no longer supported. The default, and only script replication mode supported, is script effects' replication. For more information, please refer to <a href="/docs/latest/develop/interact/programmability/eval-intro/#replicating-commands-instead-of-scripts"> <code> Replicating commands instead of scripts </code> </a> </p> <h3 id="redis.breakpoint"> <code> redis.breakpoint() </code> </h3> <ul> <li> Since version: 3.2.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: no </li> </ul> <p> This function triggers a breakpoint when using the <a href="/docs/latest/develop/interact/programmability/lua-debugging/"> Redis Lua debugger </a> . </p> <h3 id="redis.debug"> <code> redis.debug(x) </code> </h3> <ul> <li> Since version: 3.2.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: no </li> </ul> <p> This function prints its argument in the <a href="/docs/latest/develop/interact/programmability/lua-debugging/"> Redis Lua debugger </a> console. </p> <h3 id="redis.acl_check_cmd"> <code> redis.acl_check_cmd(command [,arg...]) </code> </h3> <ul> <li> Since version: 7.0.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> This function is used for checking if the current user running the script has <a href="/docs/latest/operate/oss_and_stack/management/security/acl/"> ACL </a> permissions to execute the given command with the given arguments. </p> <p> The return value is a boolean <code> true </code> in case the current user has permissions to execute the command (via a call to <a href="#redis.call"> redis.call </a> or <a href="#redis.pcall"> redis.pcall </a> ) or <code> false </code> in case they don't. </p> <p> The function will raise an error if the passed command or its arguments are invalid. </p> <h3 id="redis.register_function"> <code> redis.register_function </code> </h3> <ul> <li> Since version: 7.0.0 </li> <li> Available in scripts: no </li> <li> Available in functions: yes </li> </ul> <p> This function is only available from the context of the <a href="/docs/latest/commands/function-load/"> <code> FUNCTION LOAD </code> </a> command. When called, it registers a function to the loaded library. The function can be called either with positional or named arguments. </p> <h4 id="redis.register_function_pos_args"> positional arguments: <code> redis.register_function(name, callback) </code> </h4> <p> The first argument to <code> redis.register_function </code> is a Lua string representing the function name. The second argument to <code> redis.register_function </code> is a Lua function. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; FUNCTION LOAD "#!lua name=mylib\n redis.register_function('noop', function() end)" </code></pre> <h4 id="redis.register_function_named_args"> Named arguments: <code> redis.register_function{function_name=name, callback=callback, flags={flag1, flag2, ..}, description=description} </code> </h4> <p> The named arguments variant accepts the following arguments: </p> <ul> <li> <em> function_name </em> : the function's name. </li> <li> <em> callback </em> : the function's callback. </li> <li> <em> flags </em> : an array of strings, each a function flag (optional). </li> <li> <em> description </em> : function's description (optional). </li> </ul> <p> Both <em> function_name </em> and <em> callback </em> are mandatory. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; FUNCTION LOAD "#!lua name=mylib\n redis.register_function{function_name='noop', callback=function() end, flags={ 'no-writes' }, description='Does nothing'}" </code></pre> <h4 id="script_flags"> Script flags </h4> <p> <strong> Important: </strong> Use script flags with care, which may negatively impact if misused. Note that the default for Eval scripts are different than the default for functions that are mentioned below, see <a href="/docs/latest/develop/interact/programmability/eval-intro#eval-flags"> Eval Flags </a> </p> <p> When you register a function or load an Eval script, the server does not know how it accesses the database. By default, Redis assumes that all scripts read and write data. This results in the following behavior: </p> <ol> <li> They can read and write data. </li> <li> They can run in cluster mode, and are not able to run commands accessing keys of different hash slots. </li> <li> Execution against a stale replica is denied to avoid inconsistent reads. </li> <li> Execution under low memory is denied to avoid exceeding the configured threshold. </li> </ol> <p> You can use the following flags and instruct the server to treat the scripts' execution differently: </p> <ul> <li> <p> <code> no-writes </code> : this flag indicates that the script only reads data but never writes. </p> <p> By default, Redis will deny the execution of flagged scripts (Functions and Eval scripts with <a href="/docs/latest/develop/interact/programmability/eval-intro/#eval-flags"> shebang </a> ) against read-only replicas, as they may attempt to perform writes. Similarly, the server will not allow calling scripts with <a href="/docs/latest/commands/fcall_ro/"> <code> FCALL_RO </code> </a> / <a href="/docs/latest/commands/eval_ro/"> <code> EVAL_RO </code> </a> . Lastly, when data persistence is at risk due to a disk error, execution is blocked as well. </p> <p> Using this flag allows executing the script: </p> <ol> <li> With <a href="/docs/latest/commands/fcall_ro/"> <code> FCALL_RO </code> </a> / <a href="/docs/latest/commands/eval_ro/"> <code> EVAL_RO </code> </a> </li> <li> On read-only replicas. </li> <li> Even if there's a disk error (Redis is unable to persist so it rejects writes). </li> <li> When over the memory limit since it implies the script doesn't increase memory consumption (see <code> allow-oom </code> below) </li> </ol> <p> However, note that the server will return an error if the script attempts to call a write command. Also note that currently <a href="/docs/latest/commands/publish/"> <code> PUBLISH </code> </a> , <a href="/docs/latest/commands/spublish/"> <code> SPUBLISH </code> </a> and <a href="/docs/latest/commands/pfcount/"> <code> PFCOUNT </code> </a> are also considered write commands in scripts, because they could attempt to propagate commands to replicas and AOF file. </p> <p> For more information please refer to <a href="/docs/latest/develop/interact/programmability/#read-only_scripts"> Read-only scripts </a> </p> </li> <li> <p> <code> allow-oom </code> : use this flag to allow a script to execute when the server is out of memory (OOM). </p> <p> Unless used, Redis will deny the execution of flagged scripts (Functions and Eval scripts with <a href="/docs/latest/develop/interact/programmability/eval-intro/#eval-flags"> shebang </a> ) when in an OOM state. Furthermore, when you use this flag, the script can call any Redis command, including commands that aren't usually allowed in this state. Specifying <code> no-writes </code> or using <a href="/docs/latest/commands/fcall_ro/"> <code> FCALL_RO </code> </a> / <a href="/docs/latest/commands/eval_ro/"> <code> EVAL_RO </code> </a> also implies the script can run in OOM state (without specifying <code> allow-oom </code> ) </p> </li> <li> <p> <code> allow-stale </code> : a flag that enables running the flagged scripts (Functions and Eval scripts with <a href="/docs/latest/develop/interact/programmability/eval-intro/#eval-flags"> shebang </a> ) against a stale replica when the <code> replica-serve-stale-data </code> config is set to <code> no </code> . </p> <p> Redis can be set to prevent data consistency problems from using old data by having stale replicas return a runtime error. For scripts that do not access the data, this flag can be set to allow stale Redis replicas to run the script. Note however that the script will still be unable to execute any command that accesses stale data. </p> </li> <li> <p> <code> no-cluster </code> : the flag causes the script to return an error in Redis cluster mode. </p> <p> Redis allows scripts to be executed both in standalone and cluster modes. Setting this flag prevents executing the script against nodes in the cluster. </p> </li> <li> <p> <code> allow-cross-slot-keys </code> : The flag that allows a script to access keys from multiple slots. </p> <p> Redis typically prevents any single command from accessing keys that hash to multiple slots. This flag allows scripts to break this rule and access keys within the script that access multiple slots. Declared keys to the script are still always required to hash to a single slot. Accessing keys from multiple slots is discouraged as applications should be designed to only access keys from a single slot at a time, allowing slots to move between Redis servers. </p> <p> This flag has no effect when cluster mode is disabled. </p> </li> </ul> <p> Please refer to <a href="/docs/latest/develop/interact/programmability/functions-intro#function-flags"> Function Flags </a> and <a href="/docs/latest/develop/interact/programmability/eval-intro#eval-flags"> Eval Flags </a> for a detailed example. </p> <h3 id="redis.redis_version"> <code> redis.REDIS_VERSION </code> </h3> <ul> <li> Since version: 7.0.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> Returns the current Redis server version as a Lua string. The reply's format is <code> MM.mm.PP </code> , where: </p> <ul> <li> <strong> MM: </strong> is the major version. </li> <li> <strong> mm: </strong> is the minor version. </li> <li> <strong> PP: </strong> is the patch level. </li> </ul> <h3 id="redis.redis_version_num"> <code> redis.REDIS_VERSION_NUM </code> </h3> <ul> <li> Since version: 7.0.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> Returns the current Redis server version as a number. The reply is a hexadecimal value structured as <code> 0x00MMmmPP </code> , where: </p> <ul> <li> <strong> MM: </strong> is the major version. </li> <li> <strong> mm: </strong> is the minor version. </li> <li> <strong> PP: </strong> is the patch level. </li> </ul> <h2 id="data-type-conversion"> Data type conversion </h2> <p> Unless a runtime exception is raised, <code> redis.call() </code> and <code> redis.pcall() </code> return the reply from the executed command to the Lua script. Redis' replies from these functions are converted automatically into Lua's native data types. </p> <p> Similarly, when a Lua script returns a reply with the <code> return </code> keyword, that reply is automatically converted to Redis' protocol. </p> <p> Put differently; there's a one-to-one mapping between Redis' replies and Lua's data types and a one-to-one mapping between Lua's data types and the <a href="/docs/latest/develop/reference/protocol-spec/"> Redis Protocol </a> data types. The underlying design is such that if a Redis type is converted into a Lua type and converted back into a Redis type, the result is the same as the initial value. </p> <p> Type conversion from Redis protocol replies (i.e., the replies from <code> redis.call() </code> and <code> redis.pcall() </code> ) to Lua data types depends on the Redis Serialization Protocol version used by the script. The default protocol version during script executions is RESP2. The script may switch the replies' protocol versions by calling the <code> redis.setresp() </code> function. </p> <p> Type conversion from a script's returned Lua data type depends on the user's choice of protocol (see the <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command). </p> <p> The following sections describe the type conversion rules between Lua and Redis per the protocol's version. </p> <h3 id="resp2-to-lua-type-conversion"> RESP2 to Lua type conversion </h3> <p> The following type conversion rules apply to the execution's context by default as well as after calling <code> redis.setresp(2) </code> : </p> <ul> <li> <a href="/docs/latest/develop/reference/protocol-spec#integers"> RESP2 integer reply </a> -&gt; Lua number </li> <li> <a href="/docs/latest/develop/reference/protocol-spec#bulk-strings"> RESP2 bulk string reply </a> -&gt; Lua string </li> <li> <a href="/docs/latest/develop/reference/protocol-spec#arrays"> RESP2 array reply </a> -&gt; Lua table (may have other Redis data types nested) </li> <li> <a href="/docs/latest/develop/reference/protocol-spec#simple-strings"> RESP2 status reply </a> -&gt; Lua table with a single <em> ok </em> field containing the status string </li> <li> <a href="/docs/latest/develop/reference/protocol-spec#simple-errors"> RESP2 error reply </a> -&gt; Lua table with a single <em> err </em> field containing the error string </li> <li> <a href="/docs/latest/develop/reference/protocol-spec#bulk-strings"> RESP2 null bulk reply </a> and <a href="/docs/latest/develop/reference/protocol-spec#arrays"> RESP2 null multi-bulk reply </a> -&gt; Lua false boolean type </li> </ul> <h2 id="lua-to-resp2-type-conversion"> Lua to RESP2 type conversion </h2> <p> The following type conversion rules apply by default as well as after the user had called <code> HELLO 2 </code> : </p> <ul> <li> Lua number -&gt; <a href="/docs/latest/develop/reference/protocol-spec#integers"> RESP2 integer reply </a> (the number is converted into an integer) </li> <li> Lua string -&gt; <a href="/docs/latest/develop/reference/protocol-spec#bulk-strings"> RESP2 bulk string reply </a> </li> <li> Lua table (indexed, non-associative array) -&gt; <a href="/docs/latest/develop/reference/protocol-spec#arrays"> RESP2 array reply </a> (truncated at the first Lua <code> nil </code> value encountered in the table, if any) </li> <li> Lua table with a single <em> ok </em> field -&gt; <a href="/docs/latest/develop/reference/protocol-spec#simple-strings"> RESP2 status reply </a> </li> <li> Lua table with a single <em> err </em> field -&gt; <a href="/docs/latest/develop/reference/protocol-spec#simple-errors"> RESP2 error reply </a> </li> <li> Lua boolean false -&gt; <a href="/docs/latest/develop/reference/protocol-spec#bulk-strings"> RESP2 null bulk reply </a> </li> </ul> <p> There is an additional Lua-to-Redis conversion rule that has no corresponding Redis-to-Lua conversion rule: </p> <ul> <li> Lua Boolean <code> true </code> -&gt; <a href="/docs/latest/develop/reference/protocol-spec#integers"> RESP2 integer reply </a> with value of 1. </li> </ul> <p> There are three additional rules to note about converting Lua to Redis data types: </p> <ul> <li> Lua has a single numerical type, Lua numbers. There is no distinction between integers and floats. So we always convert Lua numbers into integer replies, removing the decimal part of the number, if any. <strong> If you want to return a Lua float, it should be returned as a string </strong> , exactly like Redis itself does (see, for instance, the <a href="/docs/latest/commands/zscore/"> <code> ZSCORE </code> </a> command). </li> <li> There's <a href="http://www.lua.org/pil/19.1.html"> no simple way to have nils inside Lua arrays </a> due to Lua's table semantics. Therefore, when Redis converts a Lua array to RESP, the conversion stops when it encounters a Lua <code> nil </code> value. </li> <li> When a Lua table is an associative array that contains keys and their respective values, the converted Redis reply will <strong> not </strong> include them. </li> </ul> <p> Lua to RESP2 type conversion examples: </p> <pre tabindex="0"><code>redis&gt; EVAL "return 10" 0 (integer) 10 redis&gt; EVAL "return { 1, 2, { 3, 'Hello World!' } }" 0 1) (integer) 1 2) (integer) 2 3) 1) (integer) 3 1) "Hello World!" redis&gt; EVAL "return redis.call('get','foo')" 0 "bar" </code></pre> <p> The last example demonstrates receiving and returning the exact return value of <code> redis.call() </code> (or <code> redis.pcall() </code> ) in Lua as it would be returned if the command had been called directly. </p> <p> The following example shows how floats and arrays that cont nils and keys are handled: </p> <pre tabindex="0"><code>redis&gt; EVAL "return { 1, 2, 3.3333, somekey = 'somevalue', 'foo', nil , 'bar' }" 0 1) (integer) 1 2) (integer) 2 3) (integer) 3 4) "foo" </code></pre> <p> As you can see, the float value of <em> 3.333 </em> gets converted to an integer <em> 3 </em> , the <em> somekey </em> key and its value are omitted, and the string "bar" isn't returned as there is a <code> nil </code> value that precedes it. </p> <h3 id="resp3-to-lua-type-conversion"> RESP3 to Lua type conversion </h3> <p> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md"> RESP3 </a> is a newer version of the <a href="/docs/latest/develop/reference/protocol-spec/"> Redis Serialization Protocol </a> . It is available as an opt-in choice as of Redis v6.0. </p> <p> An executing script may call the <a href="#redis.setresp"> <code> redis.setresp </code> </a> function during its execution and switch the protocol version that's used for returning replies from Redis' commands (that can be invoked via <a href="#redis.call"> <code> redis.call() </code> </a> or <a href="#redis.pcall"> <code> redis.pcall() </code> </a> ). </p> <p> Once Redis' replies are in RESP3 protocol, all of the <a href="#resp2-to-lua-type-conversion"> RESP2 to Lua conversion </a> rules apply, with the following additions: </p> <ul> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#map-type"> RESP3 map reply </a> -&gt; Lua table with a single <em> map </em> field containing a Lua table representing the fields and values of the map. </li> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#set-reply"> RESP set reply </a> -&gt; Lua table with a single <em> set </em> field containing a Lua table representing the elements of the set as fields, each with the Lua Boolean value of <code> true </code> . </li> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#null-reply"> RESP3 null </a> -&gt; Lua <code> nil </code> . </li> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#boolean-reply"> RESP3 true reply </a> -&gt; Lua true boolean value. </li> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#boolean-reply"> RESP3 false reply </a> -&gt; Lua false boolean value. </li> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#double-type"> RESP3 double reply </a> -&gt; Lua table with a single <em> double </em> field containing a Lua number representing the double value. </li> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#big-number-type"> RESP3 big number reply </a> -&gt; Lua table with a single <em> big_number </em> field containing a Lua string representing the big number value. </li> <li> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#verbatim-string-type"> Redis verbatim string reply </a> -&gt; Lua table with a single <em> verbatim_string </em> field containing a Lua table with two fields, <em> string </em> and <em> format </em> , representing the verbatim string and its format, respectively. </li> </ul> <p> <strong> Note: </strong> the RESP3 <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#big-number-type"> big number </a> and <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#verbatim-string-type"> verbatim strings </a> replies are only supported as of Redis v7.0 and greater. Also, presently, RESP3's <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#attribute-type"> attributes </a> , <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#streamed-strings"> streamed strings </a> and <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#streamed-aggregate-data-types"> streamed aggregate data types </a> are not supported by the Redis Lua API. </p> <h3 id="lua-to-resp3-type-conversion"> Lua to RESP3 type conversion </h3> <p> Regardless of the script's choice of protocol version set for replies with the [ <code> redis.setresp() </code> function] when it calls <code> redis.call() </code> or <code> redis.pcall() </code> , the user may opt-in to using RESP3 (with the <code> HELLO 3 </code> command) for the connection. Although the default protocol for incoming client connections is RESP2, the script should honor the user's preference and return adequately-typed RESP3 replies, so the following rules apply on top of those specified in the <a href="#lua-to-resp2-type-conversion"> Lua to RESP2 type conversion </a> section when that is the case. </p> <ul> <li> Lua Boolean -&gt; <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#boolean-reply"> RESP3 Boolean reply </a> (note that this is a change compared to the RESP2, in which returning a Boolean Lua <code> true </code> returned the number 1 to the Redis client, and returning a <code> false </code> used to return a <code> null </code> . </li> <li> Lua table with a single <em> map </em> field set to an associative Lua table -&gt; <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#map-type"> RESP3 map reply </a> . </li> <li> Lua table with a single <em> set </em> field set to an associative Lua table -&gt; <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#set-type"> RESP3 set reply </a> . Values can be set to anything and are discarded anyway. </li> <li> Lua table with a single <em> double </em> field to an associative Lua table -&gt; <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#double-type"> RESP3 double reply </a> . </li> <li> Lua nil -&gt; <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#null-reply"> RESP3 null </a> . </li> </ul> <p> However, if the connection is set use the RESP2 protocol, and even if the script replies with RESP3-typed responses, Redis will automatically perform a RESP3 to RESP2 conversion of the reply as is the case for regular commands. That means, for example, that returning the RESP3 map type to a RESP2 connection will result in the reply being converted to a flat RESP2 array that consists of alternating field names and their values, rather than a RESP3 map. </p> <h2 id="additional-notes-about-scripting"> Additional notes about scripting </h2> <h3 id="using-select-inside-scripts"> Using <code> SELECT </code> inside scripts </h3> <p> You can call the <a href="/docs/latest/commands/select/"> <code> SELECT </code> </a> command from your Lua scripts, like you can with any normal client connection. However, one subtle aspect of the behavior changed between Redis versions 2.8.11 and 2.8.12. Prior to Redis version 2.8.12, the database selected by the Lua script was <em> set as the current database </em> for the client connection that had called it. As of Redis version 2.8.12, the database selected by the Lua script only affects the execution context of the script, and does not modify the database that's selected by the client calling the script. This semantic change between patch level releases was required since the old behavior was inherently incompatible with Redis' replication and introduced bugs. </p> <h2 id="runtime-libraries"> Runtime libraries </h2> <p> The Redis Lua runtime context always comes with several pre-imported libraries. </p> <p> The following <a href="https://www.lua.org/manual/5.1/manual.html#5"> standard Lua libraries </a> are available to use: </p> <ul> <li> The <a href="https://www.lua.org/manual/5.1/manual.html#5.4"> <em> String Manipulation (string) </em> library </a> </li> <li> The <a href="https://www.lua.org/manual/5.1/manual.html#5.5"> <em> Table Manipulation (table) </em> library </a> </li> <li> The <a href="https://www.lua.org/manual/5.1/manual.html#5.6"> <em> Mathematical Functions (math) </em> library </a> </li> <li> The <a href="#os-library"> <em> Operating System Facilities (os) </em> library </a> </li> </ul> <p> In addition, the following external libraries are loaded and accessible to scripts: </p> <ul> <li> The <a href="#struct-library"> <em> struct </em> library </a> </li> <li> The <a href="#cjson-library"> <em> cjson </em> library </a> </li> <li> The <a href="#cmsgpack-library"> <em> cmsgpack </em> library </a> </li> <li> The <a href="#bitop-library"> <em> bitop </em> library </a> </li> </ul> <h3 id="os-library"> <em> os </em> library </h3> <ul> <li> Since version: 7.4 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> <em> os </em> provides a set of functions for dealing with date, time, and system commands. More details can be found in the <a href="https://www.lua.org/manual/5.1/manual.html#5.8"> Operating System Facilities </a> . Note that for sandbox security, currently only the following os functions is exposed: </p> <ul> <li> <code> os.clock() </code> </li> </ul> <h3 id="struct-library"> <em> struct </em> library </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> <em> struct </em> is a library for packing and unpacking C-like structures in Lua. It provides the following functions: </p> <ul> <li> <a href="#struct.pack"> <code> struct.pack() </code> </a> </li> <li> <a href="#struct.unpack"> <code> struct.unpack() </code> </a> </li> <li> <a href="#struct.size"> <code> struct.size() </code> </a> </li> </ul> <p> All of <em> struct </em> 's functions expect their first argument to be a <a href="#struct-formats"> format string </a> . </p> <h4 id="struct-formats"> <em> struct </em> formats </h4> <p> The following are valid format strings for <em> struct </em> 's functions: </p> <ul> <li> <code> &gt; </code> : big endian </li> <li> <code> &lt; </code> : little endian </li> <li> <code> ![num] </code> : alignment </li> <li> <code> x </code> : padding </li> <li> <code> b/B </code> : signed/unsigned byte </li> <li> <code> h/H </code> : signed/unsigned short </li> <li> <code> l/L </code> : signed/unsigned long </li> <li> <code> T </code> : size_t </li> <li> <code> i/In </code> : signed/unsigned integer with size <em> n </em> (defaults to the size of int) </li> <li> <code> cn </code> : sequence of <em> n </em> chars (from/to a string); when packing, n == 0 means the whole string; when unpacking, n == 0 means use the previously read number as the string's length. </li> <li> <code> s </code> : zero-terminated string </li> <li> <code> f </code> : float </li> <li> <code> d </code> : double </li> <li> <code> </code> (space): ignored </li> </ul> <h4 id="struct.pack"> <code> struct.pack(x) </code> </h4> <p> This function returns a struct-encoded string from values. It accepts a <a href="#struct-formats"> <em> struct </em> format string </a> as its first argument, followed by the values that are to be encoded. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL "return struct.pack('HH', 1, 2)" 0 "\x01\x00\x02\x00" </code></pre> <h4 id="struct.unpack"> <code> struct.unpack(x) </code> </h4> <p> This function returns the decoded values from a struct. It accepts a <a href="#struct-formats"> <em> struct </em> format string </a> as its first argument, followed by encoded struct's string. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL "return { struct.unpack('HH', ARGV[1]) }" 0 "\x01\x00\x02\x00" 1) (integer) 1 2) (integer) 2 3) (integer) 5 </code></pre> <h4 id="struct.size"> <code> struct.size(x) </code> </h4> <p> This function returns the size, in bytes, of a struct. It accepts a <a href="#struct-formats"> <em> struct </em> format string </a> as its only argument. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL "return struct.size('HH')" 0 (integer) 4 </code></pre> <h3 id="cjson-library"> <em> cjson </em> library </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> The <em> cjson </em> library provides fast <a href="https://json.org"> JSON </a> encoding and decoding from Lua. It provides these functions. </p> <h4 id="cjson.encode"> <code> cjson.encode(x) </code> </h4> <p> This function returns a JSON-encoded string for the Lua data type provided as its argument. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL "return cjson.encode({ ['foo'] = 'bar' })" 0 "{\"foo\":\"bar\"}" </code></pre> <h4 id="cjsondecodex-cjsondecode"> <code> cjson.decode(x) </code> {#cjson.decode()} </h4> <p> This function returns a Lua data type from the JSON-encoded string provided as its argument. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL "return cjson.decode(ARGV[1])['foo']" 0 '{"foo":"bar"}' "bar" </code></pre> <h3 id="cmsgpack-library"> <em> cmsgpack </em> library </h3> <ul> <li> Since version: 2.6.0 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> The <em> cmsgpack </em> library provides fast <a href="https://msgpack.org/index.html"> MessagePack </a> encoding and decoding from Lua. It provides these functions. </p> <h4 id="cmsgpackpackx-cmsgpackpack"> <code> cmsgpack.pack(x) </code> {#cmsgpack.pack()} </h4> <p> This function returns the packed string encoding of the Lua data type it is given as an argument. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL "return cmsgpack.pack({'foo', 'bar', 'baz'})" 0 "\x93\xa3foo\xa3bar\xa3baz" </code></pre> <h4 id="cmsgpackunpackx-cmsgpackunpack"> <code> cmsgpack.unpack(x) </code> {#cmsgpack.unpack()} </h4> <p> This function returns the unpacked values from decoding its input string argument. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL "return cmsgpack.unpack(ARGV[1])" 0 "\x93\xa3foo\xa3bar\xa3baz" 1) "foo" 2) "bar" 3) "baz" </code></pre> <h3 id="bitop-library"> <em> bit </em> library </h3> <ul> <li> Since version: 2.8.18 </li> <li> Available in scripts: yes </li> <li> Available in functions: yes </li> </ul> <p> The <em> bit </em> library provides bitwise operations on numbers. Its documentation resides at <a href="http://bitop.luajit.org/api.html"> Lua BitOp documentation </a> It provides the following functions. </p> <h4 id="bittobitx-bittobit"> <code> bit.tobit(x) </code> {#bit.tobit()} </h4> <p> Normalizes a number to the numeric range for bit operations and returns it. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL 'return bit.tobit(1)' 0 (integer) 1 </code></pre> <h4 id="bittohexx-n-bittohex"> <code> bit.tohex(x [,n]) </code> {#bit.tohex()} </h4> <p> Converts its first argument to a hex string. The number of hex digits is given by the absolute value of the optional second argument. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL 'return bit.tohex(422342)' 0 "000671c6" </code></pre> <h4 id="bitbnotx-bitbnot"> <code> bit.bnot(x) </code> {#bit.bnot()} </h4> <p> Returns the bitwise <strong> not </strong> of its argument. </p> <h4 id="bit.ops"> <code> bit.bnot(x) </code> <code> bit.bor(x1 [,x2...]) </code> , <code> bit.band(x1 [,x2...]) </code> and <code> bit.bxor(x1 [,x2...]) </code> </h4> <p> Returns either the bitwise <strong> or </strong> , bitwise <strong> and </strong> , or bitwise <strong> xor </strong> of all of its arguments. Note that more than two arguments are allowed. </p> <p> Usage example: </p> <pre tabindex="0"><code>redis&gt; EVAL 'return bit.bor(1,2,4,8,16,32,64,128)' 0 (integer) 255 </code></pre> <h4 id="bit.shifts"> <code> bit.lshift(x, n) </code> , <code> bit.rshift(x, n) </code> and <code> bit.arshift(x, n) </code> </h4> <p> Returns either the bitwise logical <strong> left-shift </strong> , bitwise logical <strong> right-shift </strong> , or bitwise <strong> arithmetic right-shift </strong> of its first argument by the number of bits given by the second argument. </p> <h4 id="bit.ro"> <code> bit.rol(x, n) </code> and <code> bit.ror(x, n) </code> </h4> <p> Returns either the bitwise <strong> left rotation </strong> , or bitwise <strong> right rotation </strong> of its first argument by the number of bits given by the second argument. Bits shifted out on one side are shifted back in on the other side. </p> <h4 id="bitbswapx-bitbswap"> <code> bit.bswap(x) </code> {#bit.bswap()} </h4> <p> Swaps the bytes of its argument and returns it. This can be used to convert little-endian 32-bit numbers to big-endian 32-bit numbers and vice versa. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/interact/programmability/lua-api/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/syncer_state/.html
<section class="prose w-full py-12 max-w-none"> <h1> Syncer state requests </h1> <p class="text-lg -mt-5 mb-10"> Syncer state requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-syncer-state"> GET </a> </td> <td> <code> /v1/bdbs/{uid}/syncer_state </code> </td> <td> Get a CRDB's syncer state </td> </tr> </tbody> </table> <h2 id="get-syncer-state"> Get syncer state </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/bdbs/<span class="o">{</span>int: uid<span class="o">}</span>/syncer_state </span></span></code></pre> </div> <p> Get a CRDB's syncer state as JSON. </p> <div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md"> <div class="p-2 pr-5"> <svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"> <circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5"> </circle> <path d="M10.5 14V16" stroke="currentColor" stroke-width="2"> </path> <path d="M10.5 5V12" stroke="currentColor" stroke-width="2"> </path> </svg> </div> <div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50"> <div class="font-medium"> Warning: </div> This endpoint is deprecated as of Redis Enterprise Software version 7.2.4 and will be removed in a future release. Use <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/syncer_state/crdt/"> <code> /v1/bdbs/&lt;uid&gt;/syncer_state/crdt </code> </a> instead. </div> </div> <h3 id="permissions"> Permissions </h3> <table> <thead> <tr> <th> Permission name </th> <th> Roles </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_bdb_info"> view_bdb_info </a> </td> <td> admin <br/> cluster_member <br/> cluster_viewer <br/> db_member <br/> db_viewer </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/bdbs/1/syncer_state </span></span></code></pre> </div> <h4 id="headers"> Headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> </tr> </thead> <tbody> <tr> <td> Host </td> <td> The domain name or IP of the cluster. </td> </tr> <tr> <td> Accept </td> <td> application/json </td> </tr> </tbody> </table> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> The unique ID of the database requested. </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns a JSON object that represents the syncer state. </p> <h4 id="example-json-body"> Example JSON body </h4> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"DB"</span><span class="p">:</span> <span class="mi">22</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"RunID"</span><span class="p">:</span> <span class="mi">1584086516</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="c1">// additional fields... </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="p">}</span> </span></span></code></pre> </div> <h4 id="get-status-codes"> Status codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"> 200 OK </a> </td> <td> OK </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Syncer state key does not exist </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> Internal error </td> </tr> <tr> <td> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4"> 503 Service Unavailable </a> </td> <td> Redis connection error, service unavailable </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/syncer_state/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user/.html
<section class="prose w-full py-12 max-w-none"> <h1> User object </h1> <p class="text-lg -mt-5 mb-10"> An API object that represents a Redis Enterprise user </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> integer </td> <td> User's unique ID </td> </tr> <tr> <td> account_id </td> <td> integer </td> <td> SM account ID </td> </tr> <tr> <td> action_uid </td> <td> string </td> <td> Action UID. If it exists, progress can be tracked by the <code> GET </code> <code> /actions/{uid} </code> API request (read-only) </td> </tr> <tr> <td> auth_method </td> <td> <strong> 'regular' </strong> <br/> 'certificate' <br/> 'entraid' </td> <td> User's authentication method </td> </tr> <tr> <td> bdbs_email_alerts </td> <td> complex object </td> <td> UIDs of databases that user will receive alerts for </td> </tr> <tr> <td> cluster_email_alerts </td> <td> boolean </td> <td> Activate cluster email alerts for a user </td> </tr> <tr> <td> email </td> <td> string </td> <td> User's email (pattern matching only ASCII characters) </td> </tr> <tr> <td> email_alerts </td> <td> boolean (default: true) </td> <td> Activate email alerts for a user </td> </tr> <tr> <td> name </td> <td> string </td> <td> User's name (pattern does not allow non-ASCII and special characters &amp;,&lt;,&gt;,") </td> </tr> <tr> <td> password </td> <td> string </td> <td> User's password. If <code> password_hash_method </code> is set to <code> 1 </code> , the password should be hashed using SHA-256. The format before hashing is <code> username:clustername:password </code> . </td> </tr> <tr> <td> password_hash_method </td> <td> '1' </td> <td> Used when password is passed pre-hashed to specify the hashing method </td> </tr> <tr> <td> password_issue_date </td> <td> string </td> <td> The date in which the password was set (read-only) </td> </tr> <tr> <td> role </td> <td> 'admin' <br/> 'cluster_member' <br/> 'cluster_viewer' <br/> 'db_member' <br/> <strong> 'db_viewer' </strong> <br/> 'user_manager' <br/> 'none' </td> <td> User's <a href="/docs/latest/operate/rs/references/rest-api/permissions/#roles"> role </a> </td> </tr> <tr> <td> role_uids </td> <td> array of integers </td> <td> UIDs of user's roles for role-based access control </td> </tr> <tr> <td> status </td> <td> 'active' <br/> 'locked' <br/> 'password_expired' </td> <td> User sign-in status (read-only) <br/> <strong> active </strong> : able to sign in <br/> <strong> locked </strong> : unable to sign in <br/> <strong> password_expired </strong> : unable to sign in because the password expired </td> </tr> </tbody> </table> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/user/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/commands/hdel/.html
<section class="prose w-full py-12"> <h1 class="command-name"> HDEL </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">HDEL key field [field ...]</pre> <dl class="grid grid-cols-[auto,1fr] gap-2 mb-12"> <dt class="font-semibold text-redis-ink-900 m-0"> Available since: </dt> <dd class="m-0"> 2.0.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N) where N is the number of fields to be removed. </dd> <dt class="font-semibold text-redis-ink-900 m-0"> ACL categories: </dt> <dd class="m-0"> <code> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @hash </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Removes the specified fields from the hash stored at <code> key </code> . Specified fields that do not exist within this hash are ignored. Deletes the hash if no fields remain. If <code> key </code> does not exist, it is treated as an empty hash and this command returns <code> 0 </code> . </p> <h2 id="examples"> Examples </h2> <div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex"> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z"> </path> </svg> <svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20"> <path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z"> </path> </svg> </div> <form class="redis-cli overflow-y-auto max-h-80"> <pre tabindex="0">redis&gt; HSET myhash field1 "foo" (integer) 1 redis&gt; HDEL myhash field1 (integer) 1 redis&gt; HDEL myhash field2 (integer) 0 </pre> <div class="prompt" style=""> <span> redis&gt; </span> <input autocomplete="off" name="prompt" spellcheck="false" type="text"/> </div> </form> <h2 id="resp2-reply"> RESP2 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : the number of fields that were removed from the hash, excluding any specified but non-existing fields. <h2 id="resp3-reply"> RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#integers"> Integer reply </a> : The number of fields that were removed from the hash, excluding any specified but non-existing fields. <br/> <h2> History </h2> <ul> <li> Starting with Redis version 2.4.0: Accepts multiple <code> field </code> arguments. </li> </ul> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/hdel/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/integrate/redisom-for-python.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisOM for Python </h1> <p class="text-lg -mt-5 mb-10"> Learn how to build with Redis Stack and Python </p> <p> <a href="https://github.com/redis/redis-om-python"> Redis OM Python </a> is a Redis client that provides high-level abstractions for managing document data in Redis. This tutorial shows you how to get up and running with Redis OM Python, Redis Stack, and the <a href="https://flask.palletsprojects.com/"> Flask </a> micro-framework. </p> <p> We'd love to see what you build with Redis Stack and Redis OM. <a href="https://discord.gg/redis"> Join the Redis community on Discord </a> to chat with us about all things Redis OM and Redis Stack. Read more about Redis OM Python <a href="https://redis.com/blog/introducing-redis-om-for-python/"> our announcement blog post </a> . </p> <h2 id="overview"> Overview </h2> <p> This application, an API built with Flask and a simple domain model, demonstrates common data manipulation patterns using Redis OM. </p> <p> Our entity is a Person, with the following JSON representation: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"A string, the person's first or given name"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"A string, the person's last or surname"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A string, optional unit number e.g. B or 1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"A string, name of the street they live on"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"A string, name of the city they live in"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"A string, state, province or county that they live in"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"A string, their zip or postal code"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"A string, country that they live in."</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"A string, free text personal statement"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"A string: a skill the person has"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"A string: another still that the person has"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> We'll let Redis OM handle generation of unique IDs, which it does using <a href="https://github.com/ulid/spec"> ULIDs </a> . Redis OM will also handle creation of unique Redis key names for us, as well as saving and retrieving entities from JSON documents stored in a Redis Stack database. </p> <h2 id="getting-started"> Getting Started </h2> <h3 id="requirements"> Requirements </h3> <p> To run this application you'll need: </p> <ul> <li> <a href="https://git-scm.com/download"> git </a> - to clone the repo to your machine. </li> <li> <a href="https://www.python.org/downloads/"> Python 3.9 or higher </a> . </li> <li> A <a href="https://redis.io"> Redis Stack </a> database, or Redis with the <a href="/docs/latest/develop/interact/search-and-query/"> Search and Query </a> and <a href="/docs/latest/develop/data-types/json/"> JSON </a> features installed. We've provided a <code> docker-compose.yml </code> for this. You can also <a href="https://redis.com/try-free/?utm_source=redisio&amp;utm_medium=referral&amp;utm_campaign=2023-09-try_free&amp;utm_content=cu-redis_cloud_users"> sign up for a free 30Mb database with Redis Cloud </a> - be sure to check the Redis Stack option when creating your cloud database. </li> <li> <a href="https://curl.se/"> curl </a> , or <a href="https://www.postman.com/"> Postman </a> - to send HTTP requests to the application. We'll provide examples using curl in this document. </li> <li> Optional: <a href="https://redis.com/redis-enterprise/redis-insight/"> Redis Insight </a> , a free data visualization and database management tool for Redis. When downloading Redis Insight, be sure to select version 2.x or use the version that comes with Redis Stack. </li> </ul> <h3 id="get-the-source-code"> Get the Source Code </h3> <p> Clone the repository from GitHub: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ git clone https://github.com/redis-developer/redis-om-python-flask-skeleton-app.git </span></span><span class="line"><span class="cl">$ <span class="nb">cd</span> redis-om-python-flask-skeleton-app </span></span></code></pre> </div> <h3 id="start-a-redis-stack-database-or-configure-your-redis-cloud-credentials"> Start a Redis Stack Database, or Configure your Redis Cloud Credentials </h3> <p> Next, we'll get a Redis Stack database up and running. If you're using Docker: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ docker-compose up -d </span></span><span class="line"><span class="cl">Creating network <span class="s2">"redis-om-python-flask-skeleton-app_default"</span> with the default driver </span></span><span class="line"><span class="cl">Creating redis_om_python_flask_starter ... <span class="k">done</span> </span></span></code></pre> </div> <p> If you're using Redis Cloud, you'll need the hostname, port number, and password for your database. Use these to set the <code> REDIS_OM_URL </code> environment variable like this: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="nb">export</span> <span class="nv">REDIS_OM_URL</span><span class="o">=</span>redis://default:&lt;password&gt;@&lt;host&gt;:&lt;port&gt; </span></span></code></pre> </div> <p> (This step is not required when working with Docker as the Docker container runs Redis on <code> localhost </code> port <code> 6379 </code> with no password, which is the default connection that Redis OM uses.) </p> <p> For example if your Redis Cloud database is at port <code> 9139 </code> on host <code> enterprise.redis.com </code> and your password is <code> 5uper53cret </code> then you'd set <code> REDIS_OM_URL </code> as follows: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="nb">export</span> <span class="nv">REDIS_OM_URL</span><span class="o">=</span>redis://default:[email protected]:9139 </span></span></code></pre> </div> <h3 id="create-a-python-virtual-environment-and-install-the-dependencies"> Create a Python Virtual Environment and Install the Dependencies </h3> <p> Create a Python virtual environment, and install the project dependencies which are <a href="https://pypi.org/project/Flask/"> Flask </a> , <a href="https://pypi.org/project/requests/"> Requests </a> (used only in the data loader script) and <a href="https://pypi.org/project/redis-om/"> Redis OM </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ python3 -m venv venv </span></span><span class="line"><span class="cl">$ . ./venv/bin/activate </span></span><span class="line"><span class="cl">$ pip install -r requirements.txt </span></span></code></pre> </div> <h3 id="start-the-flask-application"> Start the Flask Application </h3> <p> Let's start the Flask application in development mode, so that Flask will restart the server for you each time you save code changes in <code> app.py </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="nb">export</span> <span class="nv">FLASK_ENV</span><span class="o">=</span>development </span></span><span class="line"><span class="cl">$ flask run </span></span></code></pre> </div> <p> If all goes well, you should see output similar to this: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ flask run </span></span><span class="line"><span class="cl"> * Environment: development </span></span><span class="line"><span class="cl"> * Debug mode: on </span></span><span class="line"><span class="cl"> * Running on http://127.0.0.1:5000/ <span class="o">(</span>Press CTRL+C to quit<span class="o">)</span> </span></span><span class="line"><span class="cl"> * Restarting with stat </span></span><span class="line"><span class="cl"> * Debugger is active! </span></span><span class="line"><span class="cl"> * Debugger PIN: XXX-XXX-XXX </span></span></code></pre> </div> <p> You're now up and running, and ready to perform CRUD operations on data with Redis, Search and Query, JSON and Redis OM for Python! To make sure the server's running, point your browser at <code> http://127.0.0.1:5000/ </code> , where you can expect to see the application's basic home page: </p> <p> <img alt="screenshot" src="./images/python_server_running.png"/> </p> <h3 id="load-the-sample-data"> Load the Sample Data </h3> <p> We've provided a small amount of sample data (it's in <code> data/people.json </code> . The Python script <code> dataloader.py </code> loads each person into Redis by posting the data to the application's create a new person endpoint. Run it like this: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ python dataloader.py </span></span><span class="line"><span class="cl">Created person Robert McDonald with ID 01FX8RMR7NRS45PBT3XP9KNAZH </span></span><span class="line"><span class="cl">Created person Kareem Khan with ID 01FX8RMR7T60ANQTS4P9NKPKX8 </span></span><span class="line"><span class="cl">Created person Fernando Ortega with ID 01FX8RMR7YB283BPZ88HAG066P </span></span><span class="line"><span class="cl">Created person Noor Vasan with ID 01FX8RMR82D091TC37B45RCWY3 </span></span><span class="line"><span class="cl">Created person Dan Harris with ID 01FX8RMR8545RWW4DYCE5MSZA1 </span></span></code></pre> </div> <p> Make sure to take a copy of the output of the data loader, as your IDs will differ from those used in the tutorial. To follow along, substitute your IDs for the ones shown above. e.g. whenever we are working with Kareem Khan, change <code> 01FX8RMR7T60ANQTS4P9NKPKX8 </code> for the ID that your data loader assigned to Kareem in your Redis database. </p> <h3 id="problems"> Problems? </h3> <p> If the Flask server fails to start, take a look at its output. If you see log entries similar to this: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="k">raise</span> <span class="ne">ConnectionError</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_error_message</span><span class="p">(</span><span class="n">e</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="n">redis</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">ConnectionError</span><span class="p">:</span> <span class="n">Error</span> <span class="mi">61</span> <span class="n">connecting</span> <span class="n">to</span> <span class="n">localhost</span><span class="p">:</span><span class="mf">6379.</span> <span class="n">Connection</span> <span class="n">refused</span><span class="o">.</span> </span></span></code></pre> </div> <p> then you need to start the Redis Docker container if using Docker, or set the <code> REDIS_OM_URL </code> environment variable if using Redis Cloud. </p> <p> If you've set the <code> REDIS_OM_URL </code> environment variable, and the code errors with something like this on startup: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="k">raise</span> <span class="ne">ConnectionError</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_error_message</span><span class="p">(</span><span class="n">e</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="n">redis</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">ConnectionError</span><span class="p">:</span> <span class="n">Error</span> <span class="mi">8</span> <span class="n">connecting</span> <span class="n">to</span> <span class="n">enterprise</span><span class="o">.</span><span class="n">redis</span><span class="o">.</span><span class="n">com</span><span class="p">:</span><span class="mf">9139.</span> <span class="n">nodename</span> <span class="n">nor</span> <span class="n">servname</span> <span class="n">provided</span><span class="p">,</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">known</span><span class="o">.</span> </span></span></code></pre> </div> <p> then you'll need to check that you used the correct hostname, port, password and format when setting <code> REDIS_OM_URL </code> . </p> <p> If the data loader fails to post the sample data into the application, make sure that the Flask application is running <strong> before </strong> running the data loader. </p> <h2 id="create-read-update-and-delete-data"> Create, Read, Update and Delete Data </h2> <p> Let's create and manipulate some instances of our data model in Redis. Here we'll look at how to call the Flask API with curl (you could also use Postman), how the code works, and how the data's stored in Redis. </p> <h3 id="building-a-person-model-with-redis-om"> Building a Person Model with Redis OM </h3> <p> Redis OM allows us to model entities using Python classes, and the <a href="https://pypi.org/project/pydantic/"> Pydantic </a> framework. Our person model is contained in the file <code> person.py </code> . Here's some notes about how it works: </p> <ul> <li> We declare a class <code> Person </code> which extends a Redis OM class <code> JsonModel </code> . This tells Redis OM that we want to store these entities in Redis as JSON documents. </li> <li> We then declare each field in our model, specifying the data type and whether or not we want to index on that field. For example, here's the <code> age </code> field, which we've declared as a positive integer that we want to index on: </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">age</span><span class="p">:</span> <span class="n">PositiveInt</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span></code></pre> </div> <ul> <li> The <code> skills </code> field is a list of strings, declared thus: </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">skills</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span></code></pre> </div> <ul> <li> For the <code> personal_statement </code> field, we don't want to index on the field's value, as it's a free text sentence rather than a single word or digit. For this, we'll tell Redis OM that we want to be able to perform full text searches on the values: </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">personal_statement</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">full_text_search</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span></code></pre> </div> <ul> <li> <code> address </code> works differently from the other fields. Note that in our JSON representation of the model, address is an object rather than a string or numerical field. With Redis OM, this is modeled as a second class, which extends the Redis OM <code> EmbeddedJsonModel </code> class: </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">Address</span><span class="p">(</span><span class="n">EmbeddedJsonModel</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="c1"># field definitions...</span> </span></span></code></pre> </div> <ul> <li> <p> Fields in an <code> EmbeddedJsonModel </code> are defined in the same way, so our class contains a field definition for each data item in the address. </p> </li> <li> <p> Not every field in our JSON is present in every address, Redis OM allows us to declare a field as optional so long as we don't index it: </p> </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">unit</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span></code></pre> </div> <ul> <li> We can also set a default value for a field... let's say country should be "United Kingdom" unless otherwise specified: </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">country</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"United Kingdom"</span><span class="p">)</span> </span></span></code></pre> </div> <ul> <li> Finally, to add the embedded address object to our Person model, we declare a field of type <code> Address </code> in the Person class: </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">address</span><span class="p">:</span> <span class="n">Address</span> </span></span></code></pre> </div> <h3 id="adding-new-people"> Adding New People </h3> <p> The function <code> create_person </code> in <code> app.py </code> handles the creation of a new person in Redis. It expects a JSON object that adheres to our Person model's schema. The code to then create a new Person object with that data and save it in Redis is simple: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">new_person</span> <span class="o">=</span> <span class="n">Person</span><span class="p">(</span><span class="o">**</span><span class="n">request</span><span class="o">.</span><span class="n">json</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">new_person</span><span class="o">.</span><span class="n">save</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">new_person</span><span class="o">.</span><span class="n">pk</span> </span></span></code></pre> </div> <p> When a new Person instance is created, Redis OM assigns it a unique ULID primary key, which we can access as <code> .pk </code> . We return that to the caller, so that they know the ID of the object they just created. </p> <p> Persisting the object to Redis is then simply a matter of calling <code> .save() </code> on it. </p> <p> Try it out... with the server running, add a new person using curl: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://127.0.0.1:5000/person/new'</span> <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span>--header <span class="s1">'Content-Type: application/json'</span> <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span>--data-raw <span class="s1">'{ </span></span></span><span class="line"><span class="cl"><span class="s1"> "first_name": "Joanne", </span></span></span><span class="line"><span class="cl"><span class="s1"> "last_name": "Peel", </span></span></span><span class="line"><span class="cl"><span class="s1"> "age": 36, </span></span></span><span class="line"><span class="cl"><span class="s1"> "personal_statement": "Music is my life, I love gigging and playing with my band.", </span></span></span><span class="line"><span class="cl"><span class="s1"> "address": { </span></span></span><span class="line"><span class="cl"><span class="s1"> "street_number": 56, </span></span></span><span class="line"><span class="cl"><span class="s1"> "unit": "4A", </span></span></span><span class="line"><span class="cl"><span class="s1"> "street_name": "The Rushes", </span></span></span><span class="line"><span class="cl"><span class="s1"> "city": "Birmingham", </span></span></span><span class="line"><span class="cl"><span class="s1"> "state": "West Midlands", </span></span></span><span class="line"><span class="cl"><span class="s1"> "postal_code": "B91 6HG", </span></span></span><span class="line"><span class="cl"><span class="s1"> "country": "United Kingdom" </span></span></span><span class="line"><span class="cl"><span class="s1"> }, </span></span></span><span class="line"><span class="cl"><span class="s1"> "skills": [ </span></span></span><span class="line"><span class="cl"><span class="s1"> "synths", </span></span></span><span class="line"><span class="cl"><span class="s1"> "vocals", </span></span></span><span class="line"><span class="cl"><span class="s1"> "guitar" </span></span></span><span class="line"><span class="cl"><span class="s1"> ] </span></span></span><span class="line"><span class="cl"><span class="s1">}'</span> </span></span></code></pre> </div> <p> Running the above curl command will return the unique ULID ID assigned to the newly created person. For example <code> 01FX8SSSDN7PT9T3N0JZZA758G </code> . </p> <h3 id="examining-the-data-in-redis"> Examining the data in Redis </h3> <p> Let's take a look at what we just saved in Redis. Using Redis Insight or redis-cli, connect to the database and look at the value stored at key <code> :person.Person:01FX8SSSDN7PT9T3N0JZZA758G </code> . This is stored as a JSON document in Redis, so if using redis-cli you'll need the following command: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ redis-cli </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; json.get :person.Person:01FX8SSSDN7PT9T3N0JZZA758G </span></span></code></pre> </div> <p> If you're using Redis Insight, the browser will render the key value for you when you click on the key name: </p> <p> <img alt="Data in Redis Insight" src="./images/python_insight_explore_person.png"/> </p> <p> When storing data as JSON in Redis, we can update and retrieve the whole document, or just parts of it. For example, to retrieve only the person's address and first skill, use the following command (Redis Insight users should use the built in redis-cli for this): </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ redis-cli </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; json.get :person.Person:01FX8SSSDN7PT9T3N0JZZA758G $.address $.skills<span class="o">[</span>0<span class="o">]</span> </span></span><span class="line"><span class="cl"><span class="s2">"{\"</span>$<span class="s2">.skills[0]\":[\"synths\"],\"</span>$<span class="s2">.address\":[{\"pk\":\"01FX8SSSDNRDSRB3HMVH00NQTT\",\"street_number\":56,\"unit\":\"4A\",\"street_name\":\"The Rushes\",\"city\":\"Birmingham\",\"state\":\"West Midlands\",\"postal_code\":\"B91 6HG\",\"country\":\"United Kingdom\"}]}"</span> </span></span></code></pre> </div> <p> For more information on the JSON Path syntax used to query JSON documents in Redis, see the <a href="/docs/latest/develop/data-types/json/path/#jsonpath-syntax"> documentation </a> . </p> <h3 id="find-a-person-by-id"> Find a Person by ID </h3> <p> If we know a person's ID, we can retrieve their data. The function <code> find_by_id </code> in <code> app.py </code> receives an ID as its parameter, and asks Redis OM to retrieve and populate a Person object using the ID and the Person <code> .get </code> class method: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="k">try</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">person</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">person</span><span class="o">.</span><span class="n">dict</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="k">except</span> <span class="n">NotFoundError</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="p">{}</span> </span></span></code></pre> </div> <p> The <code> .dict() </code> method converts our Person object to a Python dictionary that Flask then returns to the caller. </p> <p> Note that if there is no Person with the supplied ID in Redis, <code> get </code> will throw a <code> NotFoundError </code> . </p> <p> Try this out with curl, substituting <code> 01FX8SSSDN7PT9T3N0JZZA758G </code> for the ID of a person that you just created in your database: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://localhost:5000/person/byid/01FX8SSSDN7PT9T3N0JZZA758G'</span> </span></span></code></pre> </div> <p> The server responds with a JSON object containing the user's data: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Birmingham"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDNRDSRB3HMVH00NQTT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"B91 6HG"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"West Midlands"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Rushes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Joanne"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Peel"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"Music is my life, I love gigging and playing with my band."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDN7PT9T3N0JZZA758G"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="find-people-with-matching-first-and-last-name"> Find People with Matching First and Last Name </h3> <p> Let's find all the people who have a given first and last name... This is handled by the function <code> find_by_name </code> in <code> app.py </code> . </p> <p> Here, we're using Person's <code> find </code> class method that's provided by Redis OM. We pass it a search query, specifying that we want to find people whose <code> first_name </code> field contains the value of the <code> first_name </code> parameter passed to <code> find_by_name </code> AND whose <code> last_name </code> field contains the value of the <code> last_name </code> parameter: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">people</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">first_name</span> <span class="o">==</span> <span class="n">first_name</span><span class="p">)</span> <span class="o">&amp;</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">last_name</span> <span class="o">==</span> <span class="n">last_name</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span> </span></span></code></pre> </div> <p> <code> .all() </code> tells Redis OM that we want to retrieve all matching people. </p> <p> Try this out with curl as follows: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/byname/Kareem/Khan'</span> </span></span></code></pre> </div> <p> <strong> Note: </strong> First and last name are case sensitive. </p> <p> The server responds with an object containing <code> results </code> , an array of matches: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"results"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7THMGA84RH8ZRQRRP9"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S1 5RE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Beltway"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">27</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Kareem"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Khan"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span><span class="s2">"I'm Kareem, a multi-instrumentalist and singer looking to join a new rock band."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span><span class="s2">"01FX8RMR7T60ANQTS4P9NKPKX8"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"drums"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="find-people-within-a-given-age-range"> Find People within a Given Age Range </h3> <p> It's useful to be able to find people that fall into a given age range... the function <code> find_in_age_range </code> in <code> app.py </code> handles this as follows... </p> <p> We'll again use Person's <code> find </code> class method, this time passing it a minimum and maximum age, specifying that we want results where the <code> age </code> field is between those values only: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">people</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">age</span> <span class="o">&gt;=</span> <span class="n">min_age</span><span class="p">)</span> <span class="o">&amp;</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">age</span> <span class="o">&lt;=</span> <span class="n">max_age</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span><span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"age"</span><span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span> </span></span></code></pre> </div> <p> Note that we can also use <code> .sort_by </code> to specify which field we want our results sorted by. </p> <p> Let's find everyone between 30 and 47 years old, sorted by age: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/byage/30/47'</span> </span></span></code></pre> </div> <p> This returns a <code> results </code> object containing an array of matches: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"results"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NW221STN6NVRDPEDT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S12 2MX"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Main Street"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">9</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">35</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Robert"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"McDonald"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"My name is Robert, I love meeting new people and enjoy music, coding and walking my dog."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NRS45PBT3XP9KNAZH"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"piano"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"trombone"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Birmingham"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDNRDSRB3HMVH00NQTT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"B91 6HG"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"West Midlands"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Rushes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Joanne"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Peel"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"Music is my life, I love gigging and playing with my band."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDN7PT9T3N0JZZA758G"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Nottingham"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82DDJ90CW8D1GM68YZ"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"NG1 1AA"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"Nottinghamshire"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Broadway"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A-1"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">37</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Noor"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Vasan"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I sing and play the guitar, I enjoy touring and meeting new people on the road."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82D091TC37B45RCWY3"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"San Diego"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United States"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YCDAVSWBMWCH2B07G"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"92102"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"California"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"C Street"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">1299</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">43</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Fernando"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Ortega"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I'm in a really cool band that plays a lot of cover songs. I'm the drummer!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YB283BPZ88HAG066P"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"clarinet"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"oboe"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"drums"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="find-people-in-a-given-city-with-a-specific-skill"> Find People in a Given City with a Specific Skill </h3> <p> Now, we'll try a slightly different sort of query. We want to find all of the people that live in a given city AND who also have a certain skill. This requires a search over both the <code> city </code> field which is a string, and the <code> skills </code> field, which is an array of strings. </p> <p> Essentially we want to say "Find me all the people whose city is <code> city </code> AND whose skills array CONTAINS <code> desired_skill </code> ", where <code> city </code> and <code> desired_skill </code> are the parameters to the <code> find_matching_skill </code> function in <code> app.py </code> . Here's the code for that: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">people</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">skills</span> <span class="o">&lt;&lt;</span> <span class="n">desired_skill</span><span class="p">)</span> <span class="o">&amp;</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">address</span><span class="o">.</span><span class="n">city</span> <span class="o">==</span> <span class="n">city</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span> </span></span></code></pre> </div> <p> The <code> &lt;&lt; </code> operator here is used to indicate "in" or "contains". </p> <p> Let's find all the guitar players in Sheffield: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/byskill/guitar/Sheffield'</span> </span></span></code></pre> </div> <p> <strong> Note: </strong> <code> Sheffield </code> is case sensitive. </p> <p> The server returns a <code> results </code> array containing matching people: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"results"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7THMGA84RH8ZRQRRP9"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S1 5RE"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Beltway"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">28</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Kareem"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Khan"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I'm Kareem, a multi-instrumentalist and singer looking to join a new rock band."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7T60ANQTS4P9NKPKX8"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"drums"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NW221STN6NVRDPEDT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S12 2MX"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Main Street"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">9</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">35</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Robert"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"McDonald"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"My name is Robert, I love meeting new people and enjoy music, coding and walking my dog."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NRS45PBT3XP9KNAZH"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"piano"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"trombone"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="find-people-using-full-text-search-on-their-personal-statements"> Find People using Full Text Search on their Personal Statements </h3> <p> Each person has a <code> personal_statement </code> field, which is a free text string containing a couple of sentences about them. We chose to index this in a way that makes it full text searchable, so let's see how to use this now. The code for this is in the function <code> find_matching_statements </code> in <code> app.py </code> . </p> <p> To search for people who have the value of the parameter <code> search_term </code> in their <code> personal_statement </code> field, we use the <code> % </code> operator: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">personal_statement</span> <span class="o">%</span> <span class="n">search_term</span><span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span> </span></span></code></pre> </div> <p> Let's find everyone who talks about "play" in their personal statement. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/bystatement/play'</span> </span></span></code></pre> </div> <p> The server responds with a <code> results </code> array of matching people: </p> <div class="highlight"> <pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"results"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"San Diego"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United States"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YCDAVSWBMWCH2B07G"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"92102"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"California"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"C Street"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">1299</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">43</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Fernando"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Ortega"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I'm in a really cool band that plays a lot of cover songs. I'm the drummer!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YB283BPZ88HAG066P"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"clarinet"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"oboe"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"drums"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Nottingham"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82DDJ90CW8D1GM68YZ"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"NG1 1AA"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"Nottinghamshire"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Broadway"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A-1"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">37</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Noor"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Vasan"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I sing and play the guitar, I enjoy touring and meeting new people on the road."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82D091TC37B45RCWY3"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Birmingham"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDNRDSRB3HMVH00NQTT"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"B91 6HG"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"West Midlands"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Rushes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Joanne"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Peel"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"Music is my life, I love gigging and playing with my band."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDN7PT9T3N0JZZA758G"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"> <span class="p">}</span> </span></span><span class="line"><span class="cl"> <span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> Note that we get results including matches for "play", "plays" and "playing". </p> <h3 id="update-a-persons-age"> Update a Person's Age </h3> <p> As well as retrieving information from Redis, we'll also want to update a Person's data from time to time. Let's see how to do that with Redis OM for Python. </p> <p> The function <code> update_age </code> in <code> app.py </code> accepts two parameters: <code> id </code> and <code> new_age </code> . Using these, we first retrieve the person's data from Redis and create a new object with it: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="k">try</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">person</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">except</span> <span class="n">NotFoundError</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="s2">"Bad request"</span><span class="p">,</span> <span class="mi">400</span> </span></span></code></pre> </div> <p> Assuming we find the person, let's update their age and save the data back to Redis: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">person</span><span class="o">.</span><span class="n">age</span> <span class="o">=</span> <span class="n">new_age</span> </span></span><span class="line"><span class="cl"> <span class="n">person</span><span class="o">.</span><span class="n">save</span><span class="p">()</span> </span></span></code></pre> </div> <p> Let's change Kareem Khan's age from 27 to 28: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://127.0.0.1:5000/person/01FX8RMR7T60ANQTS4P9NKPKX8/age/28'</span> </span></span></code></pre> </div> <p> The server responds with <code> ok </code> . </p> <h3 id="delete-a-person"> Delete a Person </h3> <p> If we know a person's ID, we can delete them from Redis without first having to load their data into a Person object. In the function <code> delete_person </code> in <code> app.py </code> , we call the <code> delete </code> class method on the Person class to do this: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">Person</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span> </span></span></code></pre> </div> <p> Let's delete Dan Harris, the person with ID <code> 01FX8RMR8545RWW4DYCE5MSZA1 </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://127.0.0.1:5000/person/01FX8RMR8545RWW4DYCE5MSZA1/delete'</span> </span></span></code></pre> </div> <p> The server responds with an <code> ok </code> response regardless of whether the ID provided existed in Redis. </p> <h3 id="setting-an-expiry-time-for-a-person"> Setting an Expiry Time for a Person </h3> <p> This is an example of how to run arbitrary Redis commands against instances of a model saved in Redis. Let's see how we can set the time to live (TTL) on a person, so that Redis will expire the JSON document after a configurable number of seconds have passed. </p> <p> The function <code> expire_by_id </code> in <code> app.py </code> handles this as follows. It takes two parameters: <code> id </code> - the ID of a person to expire, and <code> seconds </code> - the number of seconds in the future to expire the person after. This requires us to run the Redis <a href="/docs/latest/commands/expire/"> <code> EXPIRE </code> </a> command against the person's key. To do this, we need to access the Redis connection from the <code> Person </code> model like so: </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">person_to_expire</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="n">Person</span><span class="o">.</span><span class="n">db</span><span class="p">()</span><span class="o">.</span><span class="n">expire</span><span class="p">(</span><span class="n">person_to_expire</span><span class="o">.</span><span class="n">key</span><span class="p">(),</span> <span class="n">seconds</span><span class="p">)</span> </span></span></code></pre> </div> <p> Let's set the person with ID <code> 01FX8RMR82D091TC37B45RCWY3 </code> to expire in 600 seconds: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://localhost:5000/person/01FX8RMR82D091TC37B45RCWY3/expire/600'</span> </span></span></code></pre> </div> <p> Using <code> redis-cli </code> , you can check that the person now has a TTL set with the Redis <code> expire </code> command: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379&gt; ttl :person.Person:01FX8RMR82D091TC37B45RCWY3 </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">584</span> </span></span></code></pre> </div> <p> This shows that Redis will expire the key 584 seconds from now. </p> <p> You can use the <code> .db() </code> function on your model class to get at the underlying redis-py connection whenever you want to run lower level Redis commands. For more details, see the <a href="https://redis-py.readthedocs.io/en/stable/"> redis-py documentation </a> . </p> <h2 id="shutting-down-redis-docker"> Shutting Down Redis (Docker) </h2> <p> If you're using Docker, and want to shut down the Redis container when you are finished with the application, use <code> docker-compose down </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ docker-compose down </span></span><span class="line"><span class="cl">Stopping redis_om_python_flask_starter ... <span class="k">done</span> </span></span><span class="line"><span class="cl">Removing redis_om_python_flask_starter ... <span class="k">done</span> </span></span><span class="line"><span class="cl">Removing network redis-om-python-flask-skeleton-app_default </span></span></code></pre> </div> <nav> </nav> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redisom-for-python/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>
https://redis.io/docs/latest/operate/rs/databases/active-active/develop/data-types/lists/.html
<section class="prose w-full py-12 max-w-none"> <h1> Lists in Active-Active databases </h1> <p class="text-lg -mt-5 mb-10"> Information about using list with an Active-Active database. </p> <p> Redis lists are simply lists of strings, sorted by insertion order. It is possible to add elements to a Redis List that push new elements to the head (on the left) or to the tail (on the right) of the list. Redis lists can be used to easily implement queues (using LPUSH and RPOP, for example) and stacks (using LPUSH and LPOP, for example). </p> <p> Lists in Active-Active databases are just the same as regular Redis Lists. See the following examples to get familiar with Lists' behavior in an Active-Active database. </p> <p> Simple Lists example: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> LPUSH mylist “hello” </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> </td> <td style="text-align:center"> LPUSH mylist “world” </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> LRANGE mylist 0 -1 =&gt;“world” “hello” </td> <td style="text-align:center"> LRANGE mylist 0 -1 =&gt; “world” “hello” </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : The final list contains both the "world" and "hello" elements, in that order (Instance 2 observed "hello" when it added "world"). </p> <p> Example of Lists with Concurrent Insertions: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> LPUSH L x </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> LINSERT L AFTER x y1 </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> </td> <td style="text-align:center"> LINSERT L AFTER x y2 </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; x y1 </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; x y2 </td> </tr> <tr> <td style="text-align:right"> t6 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t7 </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; x y1 y2 </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; x y1 y2 </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : Instance 1 added an element y1 after x, and then Instance 2 added element y2 after x. The final List contains all three elements: x is the first element, after it y1 and then y2. The Active-Active database resolves the conflict arbitrarily but applies the resolution consistently across all Active-Active database instances. </p> <p> Example of Deleting a List while Pushing a New Element: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> LPUSH L x </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; x </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; x </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> LPUSH L y </td> <td style="text-align:center"> DEL L </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t6 </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; y </td> <td style="text-align:center"> LRANGE L 0 -1 =&gt; y </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> At t4 - t6, DEL deletes only observed elements. This is why L still contains y. </p> <p> Example of Popping Elements from a List: </p> <table> <thead> <tr> <th style="text-align:right"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 1 </strong> </th> <th style="text-align:center"> <strong> CRDB Instance 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:right"> t1 </td> <td style="text-align:center"> LPUSH L x y z </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t2 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t3 </td> <td style="text-align:center"> </td> <td style="text-align:center"> RPOP L =&gt; x </td> </tr> <tr> <td style="text-align:right"> t4 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t5 </td> <td style="text-align:center"> RPOP L =&gt; y </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:right"> t6 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:right"> t7 </td> <td style="text-align:center"> RPOP L =&gt; z </td> <td style="text-align:center"> RPOP L =&gt; z </td> </tr> </tbody> </table> <p> <strong> Explanation </strong> : At t1, the operation pushes elements x, y, z to List L. At t3, the sequential pops behave as expected from a queue. At t7, the concurrent pop in both instances might show the same result. The instance was not able to sync regarding the z removal so, from the point of view of each instance, z is located in the List and can be popped. After syncing, both lists are empty. </p> <p> Be aware of the behavior of Lists in Active-Active databases when using List as a stack or queue. As seen in the above example, two parallel RPOP operations performed by two different Active-Active database instances can get the same element in the case of a concurrent operation. Lists in Active-Active databases guarantee that each element is POP-ed at least once, but cannot guarantee that each element is POP-ed only once. Such behavior should be taken into account when, for example, using Lists in Active-Active databases as building blocks for inter-process communication systems. </p> <p> In that case, if the same element cannot be handled twice by the applications, it's recommended that the POP operations be performed by one Active-Active database instance, whereas the PUSH operations can be performed by multiple instances. </p> <form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback"> <input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/databases/active-active/develop/data-types/lists/"/> <div class="flex flex-row justify-between"> <div class="grid justify-center"> <span class="font-mono"> RATE THIS PAGE </span> <div class="star-rating"> <input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/> <label class="star" for="5-stars"> ★ </label> <input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/> <label class="star" for="4-stars"> ★ </label> <input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/> <label class="star" for="3-stars"> ★ </label> <input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/> <label class="star" for="2-stars"> ★ </label> <input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/> <label class="star" for="1-stars"> ★ </label> </div> </div> <a class="font-mono no-underline" href="#"> Back to top ↑ </a> </div> <div class="hidden" id="feedback-form"> <div class="grid gap-2"> <textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea> <button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit"> Submit </button> </div> </div> </form> <script> document.addEventListener("DOMContentLoaded", function() { const form = document.querySelector("#page-feedback"); form.addEventListener("submit", function(event) { event.preventDefault(); var xhr = new XMLHttpRequest(); var url = "\/docusight\/api\/rate"; var params = new URLSearchParams(new FormData(form)); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { const responseData = JSON.parse(xhr.responseText); const responseMessage = responseData.response; const newText = document.createTextNode(responseMessage); form.parentNode.replaceChild(newText, form); } }; xhr.send(params); }); }); </script> </section>