url
stringlengths
38
157
content
stringlengths
72
15.1M
https://redis.io/docs/latest/operate/rs/7.4/clusters/.html
<section class="prose w-full py-12 max-w-none"> <h1> Manage clusters </h1> <p class="text-lg -mt-5 mb-10"> Administrative tasks and information related to the 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/7.4/references/cli-utilities/rladmin/"> rladmin </a> , <a href="/docs/latest/develop/tools/cli/"> redis-cli </a> , <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/"> crdb-cli </a> ) </li> <li> <a href="/docs/latest/operate/rs/7.4/references/rest-api/"> REST API </a> </li> </ul> <nav> <a href="/docs/latest/operate/rs/7.4/clusters/new-cluster-setup/"> Set up a new cluster </a> <p> How to set up a new cluster using the management UI. </p> <a href="/docs/latest/operate/rs/7.4/clusters/add-node/"> Add a cluster node </a> <p> Add a node to your existing Redis Enterprise cluster. </p> <a href="/docs/latest/operate/rs/7.4/clusters/configure/"> Configure clusters </a> <p> Configuration options for your Redis Enterprise cluster. </p> <a href="/docs/latest/operate/rs/7.4/clusters/optimize/"> Optimize clusters </a> <p> Configuration changes and information you can use to optimize your performance and memory usage. </p> <a href="/docs/latest/operate/rs/7.4/clusters/maintenance-mode/"> Maintenance mode for cluster nodes </a> <p> Prepare a cluster node for maintenance. </p> <a href="/docs/latest/operate/rs/clusters/change-node-role/"> Change node roles </a> <p> Change node roles to demote the primary node to a secondary node or promote a secondary node to become the primary node. </p> <a href="/docs/latest/operate/rs/7.4/clusters/cluster-recovery/"> Recover a failed cluster </a> <p> How to use the cluster configuration file and database data to recover a failed cluster. </p> <a href="/docs/latest/operate/rs/7.4/clusters/remove-node/"> Remove a cluster node </a> <p> Remove a node from your Redis Enterprise cluster. </p> <a href="/docs/latest/operate/rs/7.4/clusters/replace-node/"> Replace a cluster node </a> <p> Replace a node in your cluster that is down. </p> <a href="/docs/latest/operate/rs/7.4/clusters/logging/"> Logging events </a> <p> Management actions performed with Redis Enterprise are logged to make sure system management tasks are appropriately performed or monitored by administrators and for compliance with regulatory standards. </p> <a href="/docs/latest/operate/rs/7.4/clusters/monitoring/"> Monitoring with metrics and alerts </a> <p> Use the metrics that measure the performance of your Redis Enterprise Software clusters, nodes, databases, and shards to track the performance of your databases. </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/7.4/clusters/"/> <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/ts.del/.html
<section class="prose w-full py-12"> <h1 class="command-name"> TS.DEL </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">TS.DEL key fromTimestamp toTimestamp </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/timeseries"> TimeSeries 1.6.0 </a> </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 data points that will be removed </dd> </dl> <p> Delete all samples between two timestamps for a given time series </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 name for the time series. </p> </details> <details open=""> <summary> <code> fromTimestamp </code> </summary> <p> is start timestamp for the range deletion. </p> </details> <details open=""> <summary> <code> toTimestamp </code> </summary> <p> is end timestamp for the range deletion. </p> <p> The given timestamp interval is closed (inclusive), meaning that samples whose timestamp eqauls the <code> fromTimestamp </code> or <code> toTimestamp </code> are also deleted. </p> <p> <note> <b> Notes: </b> </note> </p> <ul> <li> If fromTimestamp is older than the retention period compared to the maximum existing timestamp, the deletion is discarded and an error is returned. </li> <li> When deleting a sample from a time series for which compaction rules are defined: <ul> <li> If all the original samples for an affected compaction bucket are available, the compacted value is recalculated based on the remaining original samples, or removed if all original samples within the compaction bucket were deleted. </li> <li> If original samples for an affected compaction bucket were expired, the deletion is discarded and an error is returned. </li> </ul> </li> <li> Explicitly deleting samples from a compacted time series may result in inconsistencies between the raw and the compacted data. The compaction process may override such samples. That being said, it is safe to explicitly delete samples from a compacted time series beyond the retention period of the original time series. </li> </ul> <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> - the number of samples that were deleted </li> <li> [] on error (invalid arguments, wrong key type, etc.), when <code> timestamp </code> is older than the retention period compared to the maximum existing timestamp, or when an affected compaction bucket cannot be recalculated </li> </ul> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Delete range of data points </b> </summary> <p> Create time series for temperature in Tel Aviv and Jerusalem, then add different temperature samples. </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; TS.CREATE temp:TLV LABELS <span class="nb">type</span> temp location TLV </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.CREATE temp:JLM LABELS <span class="nb">type</span> temp location JLM </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.MADD temp:TLV <span class="m">1000</span> <span class="m">30</span> temp:TLV <span class="m">1010</span> <span class="m">35</span> temp:TLV <span class="m">1020</span> <span class="m">9999</span> temp:TLV <span class="m">1030</span> <span class="m">40</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">1000</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">1010</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1020</span> </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">1030</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; TS.MADD temp:JLM <span class="m">1005</span> <span class="m">30</span> temp:JLM <span class="m">1015</span> <span class="m">35</span> temp:JLM <span class="m">1025</span> <span class="m">9999</span> temp:JLM <span class="m">1035</span> <span class="m">40</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">1005</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">1015</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1025</span> </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">1035</span></span></span></code></pre> </div> <p> Delete the range of data points for temperature in Tel Aviv. </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; TS.DEL temp:TLV <span class="m">1000</span> <span class="m">1030</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">4</span></span></span></code></pre> </div> </details> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/ts.add/"> <code> TS.ADD </code> </a> </p> <h2 id="related-topics"> Related topics </h2> <p> <a href="/docs/latest/develop/data-types/timeseries/"> RedisTimeSeries </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/ts.del/"/> <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/commands/cf.info.html
<section class="prose w-full py-12"> <h1 class="command-name"> CF.INFO </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CF.INFO 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 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 about a cuckoo filter. </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> <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> with argument name ( <a href="/docs/latest/develop/reference/protocol-spec/#simple-strings"> Simple string reply </a> ) and value ( <a href="/docs/latest/develop/reference/protocol-spec/#integers"> Integer reply </a> ) pairs </li> <li> [] on error (invalid arguments, key does not exist, 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.INFO cf </span></span><span class="line"><span class="cl"> 1<span class="o">)</span> Size </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">1080</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Number of buckets </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">512</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Number of filter </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">1</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Number of items inserted </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"> 9<span class="o">)</span> Number of items deleted </span></span><span class="line"><span class="cl">10<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">11<span class="o">)</span> Bucket size </span></span><span class="line"><span class="cl">12<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span> </span></span><span class="line"><span class="cl">13<span class="o">)</span> Expansion rate </span></span><span class="line"><span class="cl">14<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">15<span class="o">)</span> Max iteration </span></span><span class="line"><span class="cl">16<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">20</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.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/operate/rs/release-notes/rs-7-4-2-releases/rs-7-4-2-104/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software release notes 7.4.2-104 (March 2024) </h1> <p class="text-lg -mt-5 mb-10"> New Cluster Manager UI enhancements to change passwords from the sign-in screen, view locked user accounts, and unlock user accounts with password reset. </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.2 </a> . </p> <h2 id="highlights"> Highlights </h2> <p> This version offers: </p> <ul> <li> New Cluster Manager UI enhancements for password management and identifying locked user accounts </li> </ul> <h2 id="new-in-this-release"> New in this release </h2> <h3 id="enhancements"> Enhancements </h3> <ul> <li> <p> New Cluster Manager UI enhancements: </p> <ul> <li> <p> You can change your password from the sign-in screen. </p> </li> <li> <p> Added a “User is locked out” label to the <strong> Access Control &gt; Users </strong> screen to help administrators identify and manage locked users. </p> </li> </ul> </li> </ul> <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.11 </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.9 </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.11 </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.11 </a> </p> </li> <li> <p> <a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.17-m18"> RedisGears 2.0.17 </a> </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.15 </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.8 </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.12 </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.8 </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> </p> </li> </ul> <h3 id="resolved-issues"> Resolved issues </h3> <ul> <li> <p> RS112165: <code> metrics_exporter </code> now reports the <code> bdb_crdt_syncer_status </code> metric during database out-of-memory events. </p> </li> <li> <p> RS115577: Changed <code> connect_timeout </code> and <code> read_timeout </code> values for S3 from 30 to 60 seconds. </p> </li> <li> <p> RS98042: The master node now logs all <code> replace_node </code> errors. </p> </li> <li> <p> RS118147: Dynamically allocate buffer size for OSS cluster port mapping configuration. </p> </li> <li> <p> RS114971: Update <code> endpoint </code> when <code> oss_cluster_api_preferred_ip_type </code> changes. </p> </li> <li> <p> RS121248: Fixed a known issue that prevented creating Active-Active databases that use Redis version 6.0 or 6.2 with modules. </p> </li> </ul> <h2 id="version-changes"> Version changes </h2> <ul> <li> <p> Removed the restriction that prevented adding nodes to a cluster with an expired cluster license, which sometimes caused issues for Kubernetes deployments. </p> <p> To avoid issues due to an expired cluster license, we recommend replacing the license before the expiration date. See <a href="/docs/latest/operate/rs/clusters/configure/license-keys/#update-cluster-license"> Update cluster license </a> for Cluster Manager UI instructions or use a <a href="/docs/latest/operate/rs/references/rest-api/requests/license/#put-license"> <code> PUT /v1/license </code> </a> REST API request. </p> </li> </ul> <h3 id="breaking-changes"> Breaking changes </h3> <ul> <li> <a href="https://github.com/RedisJSON/RedisJSON/issues/1131"> #1131 </a> , <a href="https://github.com/RedisJSON/RedisJSON/pull/1143"> #1143 </a> : RedisJSON v2.6.9 reverts JSONPath default path value from <code> $ </code> to <code> . </code> under RESP3. </li> </ul> <h3 id="deprecations"> Deprecations </h3> <h4 id="api-deprecations"> API deprecations </h4> <ul> <li> The BDB REST API object's <code> background_op </code> field is deprecated. Use <a href="/docs/latest/operate/rs/references/rest-api/requests/actions/bdb/"> <code> GET v1/actions/bdb/&lt;bdb_uid&gt; </code> </a> instead. </li> </ul> <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 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"> July 2025 </td> <td style="text-align:center"> Feb 2025 </td> <td style="text-align:center"> Aug 2024 </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 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 title="Deprecated"> ⚠️ </span> </td> <td style="text-align:center"> <span 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 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 MD5 checksums for the available packages: </p> <table> <thead> <tr> <th> Package </th> <th> MD5 checksum (7.4.2-104 March release) </th> </tr> </thead> <tbody> <tr> <td> Ubuntu 18 </td> <td> a65c8505f5e0e1bdff63fb778b010856 </td> </tr> <tr> <td> Ubuntu 20 </td> <td> 7c3e0aef16147c26fd5f1089e6f68dc2 </td> </tr> <tr> <td> Red Hat Enterprise Linux (RHEL) 8 </td> <td> 31df503bafdf43330be74267075401e3 </td> </tr> <tr> <td> Red Hat Enterprise Linux (RHEL) 9 </td> <td> 52199b917ebaab05352227c4c9c008ac </td> </tr> <tr> <td> Amazon Linux 2 </td> <td> 3823405fe934ce590aa6a9c71001168e </td> </tr> </tbody> </table> <h2 id="known-issues"> Known issues </h2> <ul> <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> due to excessive RocksDB log files. </p> </li> <li> <p> RS122570: REST API <code> POST /crdbs </code> responds with a confusing error message if the cluster does not have the requested CRDB-compatible module that complies with the requested featureset. </p> </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <h4 id="firewalld-configuration-fails-on-rhel-9-due-to-file-permissions"> Firewalld configuration fails on RHEL 9 due to file permissions </h4> <p> When you install Redis Enterprise Software version 7.4.2 on RHEL 9, <code> firewalld </code> configuration fails to add the <code> redislabs </code> service if <code> /etc/firewalld/services/redislabs-clients.xml </code> and <code> /etc/firewalld/services/redislabs.xml </code> are owned by <code> redislabs </code> instead of <code> root </code> . </p> <p> As a workaround: </p> <ol> <li> <p> Change the files' owner and group to <code> root </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ chown root:root /etc/firewalld/services/redislabs-clients.xml </span></span><span class="line"><span class="cl">$ chown root:root /etc/firewalld/services/redislabs.xml </span></span></code></pre> </div> </li> <li> <p> Add the <code> redislabs </code> service to <code> firewalld </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ systemctl daemon-reload </span></span><span class="line"><span class="cl">$ systemctl restart firewalls </span></span><span class="line"><span class="cl">$ /bin/firewall-cmd --add-service<span class="o">=</span>redislabs </span></span></code></pre> </div> </li> </ol> <p> This limitation will be fixed in a future maintenance release. </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.2-104 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-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-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> command 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, causing 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-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, causing 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, causing 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-2-104/"/> <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/slowlog/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SLOWLOG </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SLOWLOG</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.12 </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> The Redis Slow Log is a system to log queries that exceeded a specified execution time. The execution time does not include I/O operations like talking with the client, just the time needed to execute the command (this is the only stage of command execution where the thread is blocked and cannot serve other requests). </p> <p> A new entry is added to the slow log whenever a command exceeds the execution time threshold defined by the <code> slowlog-log-slower-than </code> configuration directive. </p> <p> The maximum number of entries in the slow log is governed by the <code> slowlog-max-len </code> configuration directive. This is a container command for slow log management commands. </p> <p> See <a href="/docs/latest/commands/slowlog-get/"> <code> SLOWLOG GET </code> </a> for a description of what's stored in the Redis slow log. To see the list of available commands use the <a href="/docs/latest/commands/slowlog-help/"> <code> SLOWLOG HELP </code> </a> command. </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/slowlog/"/> <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/triggers-and-functions/configuration/.html
<section class="prose w-full py-12 max-w-none"> <h1> Configuration </h1> <p class="text-lg -mt-5 mb-10"> Configure the operation parameters </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 provides configuration options to control its operation. These options can be set when the module is bootstrapped and, in some cases, at runtime. </p> <p> The following sections describe the configuration options and how to set them. </p> <h2 id="bootstrap-configuration"> Bootstrap configuration </h2> <p> You can set your configuration options when the module is loaded. When the module is loaded at start time, the module configuration can be defined in the Redis configuration file. When loading the module at runtime the configuration can be given to the <a href="/docs/latest/commands/module-loadex/"> <code> MODULE LOADEX </code> </a> command. Each configuration must be prefixed with the module name, <code> redisgears_2.&lt;configuration name&gt; </code> . </p> <h2 id="runtime-configuration"> Runtime configuration </h2> <p> You may set certain configuration options at runtime. Setting a configuration at runtime is done using <a href="/docs/latest/commands/config-set/"> <code> CONFIG SET </code> </a> command. Here each configuration must be prefixed with the module name, <code> redisgears_2.&lt;configuration name&gt; </code> . </p> <p> Example: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">&gt; config <span class="nb">set</span> redisgears_2.lock-redis-timeout <span class="m">1000</span> </span></span><span class="line"><span class="cl">OK </span></span></code></pre> </div> <h2 id="configurations"> Configurations </h2> <h3 id="execution-threads"> execution-threads </h3> <p> The <code> execution-threads </code> configuration option controls the number of background threads that run JS code. <strong> Note that libraries are considered single threaded </strong> . This configuration allows Redis to parallelize the invocation of multiple libraries. </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 1 </p> <p> <em> Minimum Value </em> </p> <p> 1 </p> <p> <em> Maximum Value </em> </p> <p> 32 </p> <p> <em> Runtime Configurability </em> </p> <p> No </p> <h3 id="library-fatal-failure-policy"> library-fatal-failure-policy </h3> <p> The <code> library-fatal-failure-policy </code> configuration option controls how to handle a fatal error. A fatal error is consider one of the following: </p> <ul> <li> Block timeout - The function blocks the Redis processes for too long (configurable using the <a href="#lock-redis-timeout"> lock-redis-timeout </a> configuration value) </li> <li> OOM - The function consumes too much memory (configurable using the <a href="#v8-maxmemory"> v8-maxmemory </a> configuration value). </li> </ul> <p> This configuration basically allows choosing between two options: </p> <ul> <li> Do not break atomicity property, even at the cost of killing the Redis processes. </li> <li> Keep my Redis processes alive, even at the cost of losing atomicity. </li> </ul> <p> <em> Expected Value </em> </p> <ul> <li> kill - Save the atomicity property. Risk of killing the Redis processes. </li> <li> abort - Abort the invocation of the function and keep the Redis processes alive. Risk of losing the atomicity property. </li> </ul> <p> <em> Default </em> </p> <p> abort </p> <p> <em> Runtime Configurability </em> </p> <p> Yes </p> <h3 id="v8-maxmemory"> v8-maxmemory </h3> <p> The <code> v8-maxmemory </code> configuration option controls the maximum amount of memory used by all V8 libraries. Exceeding this limit is considered a fatal error and will be handled base on the <a href="#library-fatal-failure-policy"> library-fatal-failure-policy </a> configuration value. </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 200M </p> <p> <em> Minimum Value </em> </p> <p> 50M </p> <p> <em> Maximum Value </em> </p> <p> 1G </p> <p> <em> Runtime Configurability </em> </p> <p> No </p> <h3 id="v8-library-initial-memory-usage"> v8-library-initial-memory-usage </h3> <p> The <code> v8-library-initial-memory-usage </code> configuration option controls the initial memory given to a single V8 library. This value can not be greater then <a href="#v8-library-initial-memory-limit"> <code> v8-library-initial-memory-limit </code> </a> or <a href="#v8-maxmemory"> v8-maxmemory </a> . </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 2M </p> <p> <em> Minimum Value </em> </p> <p> 1M </p> <p> <em> Maximum Value </em> </p> <p> 10M </p> <p> <em> Runtime Configurability </em> </p> <p> No </p> <h3 id="v8-library-initial-memory-limit"> v8-library-initial-memory-limit </h3> <p> The <code> v8-library-initial-memory-limit </code> configuration option controls the initial memory limit on a single V8 library. This value can not be greater then <a href="#v8-maxmemory"> v8-maxmemory </a> . </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 3M </p> <p> <em> Minimum Value </em> </p> <p> 2M </p> <p> <em> Maximum Value </em> </p> <p> 20M </p> <p> <em> Runtime Configurability </em> </p> <p> No </p> <h3 id="v8-library-memory-usage-delta"> v8-library-memory-usage-delta </h3> <p> The <code> v8-library-memory-usage-delta </code> configuration option controls the delta by which we will increase the V8 library memory limit once the limit reached. This value can not be greater then <a href="#v8-maxmemory"> v8-maxmemory </a> . </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 1M </p> <p> <em> Minimum Value </em> </p> <p> 1M </p> <p> <em> Maximum Value </em> </p> <p> 10M </p> <p> <em> Runtime Configurability </em> </p> <p> No </p> <h3 id="lock-redis-timeout"> lock-redis-timeout </h3> <p> The <code> lock-redis-timeout </code> configuration option controls the maximum amount of time (in MS) a library can lock Redis. Exceeding this limit is considered a fatal error and will be handled based on the <a href="#library-fatal-failure-policy"> library-fatal-failure-policy </a> configuration value. This configuration only affects library loading at runtime with <code> TFUNCTION LOAD </code> . The timeout for loading a library from RDB is set separately via <a href="#db-loading-lock-redis-timeout"> db-loading-lock-redis-timeout </a> . </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 500 MS </p> <p> <em> Minimum Value </em> </p> <p> 100 MS </p> <p> <em> Maximum Value </em> </p> <p> Unlimited </p> <p> <em> Runtime Configurability </em> </p> <p> Yes </p> <h4 id="side-effects"> Side effects </h4> <p> When setting <code> lock-redis-timeout </code> , if the new value is higher than the <code> db-loading-lock-redis-timeout </code> , the <code> db-loading-lock-redis-timeout </code> is also updated to this value. </p> <h3 id="db-loading-lock-redis-timeout"> db-loading-lock-redis-timeout </h3> <p> This timeout configuration is used for setting the upper time limit (in milliseconds) for the library loading from RDB. </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 30000 MS </p> <p> <em> Minimum Value </em> </p> <p> 100 MS </p> <p> <em> Maximum Value </em> </p> <p> Unlimited </p> <p> <em> Runtime Configurability </em> </p> <p> Yes </p> <h4 id="notes"> Notes </h4> <p> The value cannot be lower than the value of <code> lock-redis-timeout </code> . </p> <h3 id="remote-task-default-timeout"> remote-task-default-timeout </h3> <p> The <code> remote-task-default-timeout </code> configuration option controls the timeout when waiting for a remote task to finish. If the timeout is reached an error will result. </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 500 MS </p> <p> <em> Minimum Value </em> </p> <p> 1 MS </p> <p> <em> Maximum Value </em> </p> <p> Unlimited </p> <p> <em> Runtime Configurability </em> </p> <p> Yes </p> <h3 id="error-verbosity"> error-verbosity </h3> <p> The <code> error-verbosity </code> configuration option controls the verbosity of error messages that will be provided by triggers and functions. The higher the value the more verbose the error messages will be (for example, including stack traces and extra information for better analysis and debugging). </p> <p> <em> Expected Value </em> </p> <p> Integer </p> <p> <em> Default </em> </p> <p> 1 </p> <p> <em> Minimum Value </em> </p> <p> 1 </p> <p> <em> Maximum Value </em> </p> <p> 2 </p> <p> <em> Runtime Configurability </em> </p> <p> Yes </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/configuration/"/> <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/search-and-query/query/geo-spatial/.html
<section class="prose w-full py-12"> <h1> Geospatial queries </h1> <p class="text-lg -mt-5 mb-10"> Query based on geographic data </p> <p> Redis Stack's geospatial feature allows you to query for data associated with geographic locations. You can either query for locations within a specific radius or based on geometric shapes, such as polygons. A polygon shape could, for instance, represent a lake or the layout of a building. </p> <p> The examples in this article use the following schema: </p> <table> <thead> <tr> <th> Field name </th> <th> Field type </th> </tr> </thead> <tbody> <tr> <td> <code> store_location </code> </td> <td> <code> GEO </code> </td> </tr> <tr> <td> <code> pickup_zone </code> </td> <td> <code> GEOSHAPE </code> </td> </tr> </tbody> </table> <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> Redis Stack version 7.2.0 or higher is required to use the <code> GEOSHAPE </code> field type. </div> </div> <h2 id="radius"> Radius </h2> <p> You can construct a radius query by passing the center coordinates (longitude, latitude), the radius, and the distance unit to the <a href="/docs/latest/commands/ft.search"> FT.SEARCH </a> command. </p> <pre tabindex="0"><code>FT.SEARCH index "@geo_field:[lon lat radius unit]" </code></pre> <p> Allowed units are <code> m </code> , <code> km </code> , <code> mi </code> , and <code> ft </code> . </p> <p> The following query finds all bicycle stores within a radius of 20 miles around London: </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="query_geo-stepgeo1"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_geo-stepgeo1" name="query_geo-stepgeo1" 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_query_geo-stepgeo1" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-query_geo-stepgeo1" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_geo-stepgeo1" 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.SEARCH idx:bicycle "@store_location:[-0.1778 51.5524 20 mi]"</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_query_geo-stepgeo1')" 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_query_geo-stepgeo1" name="query_geo-stepgeo1" 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_query_geo-stepgeo1" title="Open example"> Python </label> <div aria-labelledby="tab-query_geo-stepgeo1" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_query_geo-stepgeo1" 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="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</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.json.path</span> <span class="kn">import</span> <span class="n">Path</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="n">GeoField</span><span class="p">,</span> <span class="n">GeoShapeField</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></span><span class="line"><span class="cl"><span class="n">r</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">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="c1"># create index</span> </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">GeoField</span><span class="p">(</span><span class="s2">"$.store_location"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"store_location"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoShapeField</span><span class="p">(</span><span class="s2">"$.pickup_zone"</span><span class="p">,</span> <span class="n">coord_system</span><span class="o">=</span><span class="n">GeoShapeField</span><span class="o">.</span><span class="n">FLAT</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"pickup_zone"</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">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><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">"bicycle:"</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="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data</span> </span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_em.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</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">r</span><span class="o">.</span><span class="n">pipeline</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</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="sa">f</span><span class="s1">'bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s1">'</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</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></span><span class="line hl"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"lon"</span><span class="p">:</span> <span class="o">-</span><span class="mf">0.1778</span><span class="p">,</span> <span class="s2">"lat"</span><span class="p">:</span> <span class="mf">51.5524</span><span class="p">,</span> <span class="s2">"radius"</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="s2">"units"</span><span class="p">:</span> <span class="s2">"mi"</span><span class="p">}</span> </span></span><span class="line hl"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@store_location:[$lon $lat $radius $units]"</span><span class="p">)</span><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="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [Document {'id': 'bicycle:5', ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"bike"</span><span class="p">:</span> <span class="s2">"POINT(-0.1278 51.5074)"</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@pickup_zone:[CONTAINS $bike]"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">3</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; 1</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"europe"</span><span class="p">:</span> <span class="s2">"POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))"</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@pickup_zone:[WITHIN $europe]"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">3</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; 5</span> </span></span><span class="line"><span class="cl"> </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_query_geo-stepgeo1')" 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_query_geo-stepgeo1" 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/query_geo.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> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_query_geo-stepgeo1" name="query_geo-stepgeo1" 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="Nodejs_query_geo-stepgeo1" title="Open example"> Node.js </label> <div aria-labelledby="tab-query_geo-stepgeo1" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_geo-stepgeo1" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">SchemaFieldTypes</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'@redis/search'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1">// create index </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.store_location'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">GEO</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'store_location'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.pickup_zone'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">GEOSHAPE</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'pickup_zone'</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="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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">// load data </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_em.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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 hl"><span class="cl"><span class="kr">const</span> <span class="nx">res1</span><span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'@store_location:[-0.1778 51.5524 20 mi]'</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; {total: 1, documents: [ { id: 'bicycle:5', value: [Object: null prototype] } ]} </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">params_dict_geo2</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">bike</span><span class="o">:</span> <span class="s1">'POINT(-0.1278 51.5074)'</span> <span class="p">};</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">q_geo2</span> <span class="o">=</span> <span class="s1">'@pickup_zone:[CONTAINS $bike]'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="nx">q_geo2</span><span class="p">,</span> <span class="p">{</span> <span class="nx">PARAMS</span><span class="o">:</span> <span class="nx">params_dict_geo2</span><span class="p">,</span> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">3</span> <span class="p">});</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; {total: 1, documents: [ { id: 'bicycle:5', value: [Object: null prototype] } ]} </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">params_dict_geo3</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">europe</span><span class="o">:</span> <span class="s1">'POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))'</span> <span class="p">};</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">q_geo3</span> <span class="o">=</span> <span class="s1">'@pickup_zone:[WITHIN $europe]'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="nx">q_geo3</span><span class="p">,</span> <span class="p">{</span> <span class="nx">PARAMS</span><span class="o">:</span> <span class="nx">params_dict_geo3</span><span class="p">,</span> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">3</span> <span class="p">});</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">);</span> <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">// total: 5, </span></span></span><span class="line"><span class="cl"><span class="c1">// documents: [ </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:5', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:6', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:7', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:8', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:9', value: [Object: null prototype] } </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></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_Nodejs_query_geo-stepgeo1')" 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_Nodejs_query_geo-stepgeo1" 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/nodejs/" tabindex="1" title="Quick-Start"> Node.js 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/node-redis/tree/emb-examples/doctests/query-geo.js" 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> <input class="radiotab w-0 h-0" data-lang="java" id="Java_query_geo-stepgeo1" name="query_geo-stepgeo1" 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="Java_query_geo-stepgeo1" title="Open example"> Java </label> <div aria-labelledby="tab-query_geo-stepgeo1" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_query_geo-stepgeo1" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.stream.Stream</span><span class="o">;</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">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.GeoShapeField.CoordinateSystem</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.JedisDataException</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.json.Path2</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">QueryGeoExample</span> <span class="o">{</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="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</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">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.store_location"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"store_location"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoShapeField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.pickup_zone"</span><span class="o">,</span> <span class="n">CoordinateSystem</span><span class="o">.</span><span class="na">FLAT</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"pickup_zone"</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></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">bicycleJsons</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-74.0610 40.6678, -74.0610 40.7578))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-74.0060,40.7128\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Velorim\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Jigger\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 270,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"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="o">+</span> <span class="s">"This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"is the vehicle of choice for the rare tenacious little rider raring to go.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-118.2887 33.9872, -118.2887 34.0972))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-118.2437,34.0522\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Bicyk\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Hillcraft\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Kids want to ride with as little weight as possible. Especially "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"off a 24'' bike. The Hillcraft 26 is just the solution they need!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-87.6848 41.8231, -87.6848 41.9331))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-87.6298,41.8781\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Nord\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Chook air 5\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The Chook Air 5 gives kids aged six years and older a durable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and uberlight mountain bike for their first experience on tracks and easy cruising through "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"forests and fields. The lower top tube makes it easy to mount and dismount in any "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"situation, giving your kids greater safety on the trails.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-80.2433 25.6967, -80.2433 25.8067))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-80.1918,25.7617\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Eva\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Eva 291\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3400,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The sister company to Nord, Eva launched in 2005 as the first "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"are optimized for the feminine physique using analytics from a body metrics database. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"full-suspension, cross-country ride has been designed for velocity. The 291 has "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"100mm of front and rear travel, a superlight aluminum frame and fast-rolling "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"29-inch wheels. Yippee!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-122.4644 37.7099, -122.4644 37.8199))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-122.4194,37.7749\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Noka Bikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Kahuna\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Whether you want to try your hand at XC racing or are looking "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"for a lively trail bike that's just as inspiring on the climbs as it is over rougher "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ground, the Wilder is one heck of a bike built specifically for short women. Both the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"frames and components have been tweaked to include a women’s saddle, different bars "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and unique colourway.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-0.1778 51.4024, -0.1778 51.5524))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-0.1278,51.5074\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Breakout\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"XBN 2.1 Alloy\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 810,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The XBN 2.1 Alloy is our entry-level road bike – but that’s "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"not to say that it’s a basic machine. With an internal weld aluminium frame, a full "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"doesn’t break the bank and delivers craved performance.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"2.1767 48.5516, 2.1767 48.9016))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.3522,48.8566\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"ScramBikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"WattBike\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 2300,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The WattBike is the best e-bike for people who still "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"charge. It’s great for tackling hilly terrain or if you just fancy a more "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"leisurely ride. With three working modes, you can choose between E-bike, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"assisted bicycle, and normal bike modes.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"13.3260 52.2700, 13.3260 52.5700))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"13.4050,52.5200\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Peaknetic\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Secto\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 430,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"If you struggle with stiff fingers or a kinked neck or "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"back after a few minutes on the road, this lightweight, aluminum bike alleviates "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"those issues and allows you to enjoy the ride. From the ergonomic grips to the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The rear-inclined seat tube facilitates stability by allowing you to put a foot "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on the ground to balance at a stop, and the low step-over frame makes it "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"accessible for all ability and mobility levels. The saddle is very soft, with "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"a wide back to support your hip joints and a cutout in the center to redistribute "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"facilitate setting up the Roll Low-Entry as your preferred commuter, and the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"1.9450 41.1987, 1.9450 41.4301))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.1734, 41.3851\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"nHill\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Summit\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"This budget mountain bike from nHill performs well both "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on bike paths and on the trail. The fork with 100mm of travel absorbs rough "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The Shimano Tourney drivetrain offered enough gears for finding a comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Whether you want an affordable bike that you can take to work, but also take "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"trail in mountains on the weekends or you’re just after a stable, comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ride for the bike path, the Summit gives a good value for money.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((12.4464 42.1028, 12.5464 42.1028, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"12.4964,41.9028\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"ThrillCycle\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"BikeShind\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"An artsy, retro-inspired bicycle that’s as "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"suggest taking it to the mountains. Fenders protect you from mud, and a rear "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"basket lets you transport groceries, flowers and books. The ThrillCycle comes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"with a limited lifetime warranty, so this little guy will last you long "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"past graduation.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"refurbished\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycleJsons</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSet</span><span class="o">(</span><span class="s">"bicycle:"</span> <span class="o">+</span> <span class="n">i</span><span class="o">,</span> <span class="n">Path2</span><span class="o">.</span><span class="na">ROOT_PATH</span><span class="o">,</span> <span class="n">bicycleJsons</span><span class="o">[</span><span class="n">i</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></span><span class="line hl"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"@store_location:[$lon $lat $radius $units]"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"lon"</span><span class="o">,</span> <span class="o">-</span><span class="mf">0.1778</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"lat"</span><span class="o">,</span> <span class="mf">51.5524</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"radius"</span><span class="o">,</span> <span class="mi">20</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"units"</span><span class="o">,</span> <span class="s">"mi"</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">2</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 1 </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="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs1</span> <span class="o">=</span> <span class="n">res1</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs1</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo1' step. </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">SearchResult</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@pickup_zone:[CONTAINS $bike]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"bike"</span><span class="o">,</span> <span class="s">"POINT(-0.1278 51.5074)"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">3</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs2</span> <span class="o">=</span> <span class="n">res2</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs2</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</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="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo2' step. </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">SearchResult</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@pickup_zone:[WITHIN $europe]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"europe"</span><span class="o">,</span> <span class="s">"POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">3</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs3</span> <span class="o">=</span> <span class="n">res3</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs3</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</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="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:6 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:8 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo3' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</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></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_Java_query_geo-stepgeo1')" 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_Java_query_geo-stepgeo1" 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/java/jedis/" tabindex="1" title="Quick-Start"> Java 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/jedis/tree/master/src/test/java/io/redis/examples/QueryGeoExample.java" 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="shape"> Shape </h2> <p> The only supported shapes are points and polygons. You can query for polygons or points that either contain or are within a given geometric shape. </p> <pre tabindex="0"><code>FT.SEARCH index "@geo_shape_field:[{WITHIN|CONTAINS|INTERSECTS|DISJOINT} $shape] PARAMS 2 shape "shape_as_wkt" DIALECT 3 </code></pre> <p> Here is a more detailed explanation of this query: </p> <ol> <li> <strong> Field name </strong> : you need to replace <code> geo_shape_field </code> with the <code> GEOSHAPE </code> field's name on which you want to query. </li> <li> <strong> Spatial operator </strong> : spatial operators define the relationship between the shapes in the database and the shape you are searching for. You can either use <code> WITHIN </code> , <code> CONTAINS </code> , <code> INTERSECTS </code> , or <code> DISJOINT </code> . <code> WITHIN </code> finds any shape in the database that is inside the given shape. <code> CONTAINS </code> queries for any shape that surrounds the given shape. <code> INTERSECTS </code> finds any shape that has coordinates in common with the provided shape. <code> DISJOINT </code> finds any shapes that have nothing in common with the provided shape. <code> INTERSECTS </code> and <code> DISJOINT </code> were introduced in v2.10. </li> <li> <strong> Parameter </strong> : the query refers to a parameter named <code> shape </code> . You can use any parameter name here. You need to use the <code> PARAMS </code> clause to set the parameter value. The value follows the <a href="https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry"> well-known text representation of a geometry </a> . Supported types are <code> POINT(x y) </code> and <code> POLYGON((x1 y1, x2 y2, ...)) </code> . </li> <li> <strong> Dialect </strong> : Shape-based queries have been available since version three of the query dialect. </li> </ol> <p> The following example query verifies if a bicycle is within a pickup zone: </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="query_geo-stepgeo2"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_geo-stepgeo2" name="query_geo-stepgeo2" 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_query_geo-stepgeo2" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-query_geo-stepgeo2" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_geo-stepgeo2" 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.SEARCH idx:bicycle "@pickup_zone:[CONTAINS $bike]" PARAMS 2 bike "POINT(-0.1278 51.5074)" DIALECT 3</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_query_geo-stepgeo2')" 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_query_geo-stepgeo2" name="query_geo-stepgeo2" 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_query_geo-stepgeo2" title="Open example"> Python </label> <div aria-labelledby="tab-query_geo-stepgeo2" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_query_geo-stepgeo2" 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="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</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.json.path</span> <span class="kn">import</span> <span class="n">Path</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="n">GeoField</span><span class="p">,</span> <span class="n">GeoShapeField</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></span><span class="line"><span class="cl"><span class="n">r</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">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="c1"># create index</span> </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">GeoField</span><span class="p">(</span><span class="s2">"$.store_location"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"store_location"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoShapeField</span><span class="p">(</span><span class="s2">"$.pickup_zone"</span><span class="p">,</span> <span class="n">coord_system</span><span class="o">=</span><span class="n">GeoShapeField</span><span class="o">.</span><span class="n">FLAT</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"pickup_zone"</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">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><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">"bicycle:"</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="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data</span> </span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_em.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</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">r</span><span class="o">.</span><span class="n">pipeline</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</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="sa">f</span><span class="s1">'bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s1">'</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</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></span><span class="line"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"lon"</span><span class="p">:</span> <span class="o">-</span><span class="mf">0.1778</span><span class="p">,</span> <span class="s2">"lat"</span><span class="p">:</span> <span class="mf">51.5524</span><span class="p">,</span> <span class="s2">"radius"</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="s2">"units"</span><span class="p">:</span> <span class="s2">"mi"</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@store_location:[$lon $lat $radius $units]"</span><span class="p">)</span><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="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [Document {'id': 'bicycle:5', ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"bike"</span><span class="p">:</span> <span class="s2">"POINT(-0.1278 51.5074)"</span><span class="p">}</span> </span></span><span class="line hl"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@pickup_zone:[CONTAINS $bike]"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">3</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; 1</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"europe"</span><span class="p">:</span> <span class="s2">"POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))"</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@pickup_zone:[WITHIN $europe]"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">3</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; 5</span> </span></span><span class="line"><span class="cl"> </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_query_geo-stepgeo2')" 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_query_geo-stepgeo2" 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/query_geo.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> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_query_geo-stepgeo2" name="query_geo-stepgeo2" 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="Nodejs_query_geo-stepgeo2" title="Open example"> Node.js </label> <div aria-labelledby="tab-query_geo-stepgeo2" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_geo-stepgeo2" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">SchemaFieldTypes</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'@redis/search'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1">// create index </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.store_location'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">GEO</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'store_location'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.pickup_zone'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">GEOSHAPE</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'pickup_zone'</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="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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">// load data </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_em.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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="kr">const</span> <span class="nx">res1</span><span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'@store_location:[-0.1778 51.5524 20 mi]'</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; {total: 1, documents: [ { id: 'bicycle:5', value: [Object: null prototype] } ]} </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">params_dict_geo2</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">bike</span><span class="o">:</span> <span class="s1">'POINT(-0.1278 51.5074)'</span> <span class="p">};</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">q_geo2</span> <span class="o">=</span> <span class="s1">'@pickup_zone:[CONTAINS $bike]'</span><span class="p">;</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="nx">q_geo2</span><span class="p">,</span> <span class="p">{</span> <span class="nx">PARAMS</span><span class="o">:</span> <span class="nx">params_dict_geo2</span><span class="p">,</span> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">3</span> <span class="p">});</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; {total: 1, documents: [ { id: 'bicycle:5', value: [Object: null prototype] } ]} </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">params_dict_geo3</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">europe</span><span class="o">:</span> <span class="s1">'POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))'</span> <span class="p">};</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">q_geo3</span> <span class="o">=</span> <span class="s1">'@pickup_zone:[WITHIN $europe]'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="nx">q_geo3</span><span class="p">,</span> <span class="p">{</span> <span class="nx">PARAMS</span><span class="o">:</span> <span class="nx">params_dict_geo3</span><span class="p">,</span> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">3</span> <span class="p">});</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">);</span> <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">// total: 5, </span></span></span><span class="line"><span class="cl"><span class="c1">// documents: [ </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:5', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:6', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:7', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:8', value: [Object: null prototype] }, </span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:9', value: [Object: null prototype] } </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></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_Nodejs_query_geo-stepgeo2')" 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_Nodejs_query_geo-stepgeo2" 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/nodejs/" tabindex="1" title="Quick-Start"> Node.js 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/node-redis/tree/emb-examples/doctests/query-geo.js" 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> <input class="radiotab w-0 h-0" data-lang="java" id="Java_query_geo-stepgeo2" name="query_geo-stepgeo2" 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="Java_query_geo-stepgeo2" title="Open example"> Java </label> <div aria-labelledby="tab-query_geo-stepgeo2" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_query_geo-stepgeo2" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.stream.Stream</span><span class="o">;</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">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.GeoShapeField.CoordinateSystem</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.JedisDataException</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.json.Path2</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">QueryGeoExample</span> <span class="o">{</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="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</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">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.store_location"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"store_location"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoShapeField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.pickup_zone"</span><span class="o">,</span> <span class="n">CoordinateSystem</span><span class="o">.</span><span class="na">FLAT</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"pickup_zone"</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></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">bicycleJsons</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-74.0610 40.6678, -74.0610 40.7578))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-74.0060,40.7128\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Velorim\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Jigger\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 270,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"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="o">+</span> <span class="s">"This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"is the vehicle of choice for the rare tenacious little rider raring to go.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-118.2887 33.9872, -118.2887 34.0972))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-118.2437,34.0522\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Bicyk\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Hillcraft\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Kids want to ride with as little weight as possible. Especially "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"off a 24'' bike. The Hillcraft 26 is just the solution they need!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-87.6848 41.8231, -87.6848 41.9331))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-87.6298,41.8781\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Nord\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Chook air 5\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The Chook Air 5 gives kids aged six years and older a durable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and uberlight mountain bike for their first experience on tracks and easy cruising through "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"forests and fields. The lower top tube makes it easy to mount and dismount in any "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"situation, giving your kids greater safety on the trails.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-80.2433 25.6967, -80.2433 25.8067))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-80.1918,25.7617\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Eva\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Eva 291\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3400,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The sister company to Nord, Eva launched in 2005 as the first "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"are optimized for the feminine physique using analytics from a body metrics database. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"full-suspension, cross-country ride has been designed for velocity. The 291 has "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"100mm of front and rear travel, a superlight aluminum frame and fast-rolling "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"29-inch wheels. Yippee!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-122.4644 37.7099, -122.4644 37.8199))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-122.4194,37.7749\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Noka Bikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Kahuna\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Whether you want to try your hand at XC racing or are looking "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"for a lively trail bike that's just as inspiring on the climbs as it is over rougher "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ground, the Wilder is one heck of a bike built specifically for short women. Both the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"frames and components have been tweaked to include a women’s saddle, different bars "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and unique colourway.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-0.1778 51.4024, -0.1778 51.5524))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-0.1278,51.5074\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Breakout\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"XBN 2.1 Alloy\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 810,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The XBN 2.1 Alloy is our entry-level road bike – but that’s "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"not to say that it’s a basic machine. With an internal weld aluminium frame, a full "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"doesn’t break the bank and delivers craved performance.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"2.1767 48.5516, 2.1767 48.9016))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.3522,48.8566\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"ScramBikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"WattBike\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 2300,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The WattBike is the best e-bike for people who still "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"charge. It’s great for tackling hilly terrain or if you just fancy a more "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"leisurely ride. With three working modes, you can choose between E-bike, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"assisted bicycle, and normal bike modes.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"13.3260 52.2700, 13.3260 52.5700))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"13.4050,52.5200\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Peaknetic\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Secto\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 430,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"If you struggle with stiff fingers or a kinked neck or "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"back after a few minutes on the road, this lightweight, aluminum bike alleviates "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"those issues and allows you to enjoy the ride. From the ergonomic grips to the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The rear-inclined seat tube facilitates stability by allowing you to put a foot "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on the ground to balance at a stop, and the low step-over frame makes it "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"accessible for all ability and mobility levels. The saddle is very soft, with "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"a wide back to support your hip joints and a cutout in the center to redistribute "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"facilitate setting up the Roll Low-Entry as your preferred commuter, and the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"1.9450 41.1987, 1.9450 41.4301))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.1734, 41.3851\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"nHill\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Summit\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"This budget mountain bike from nHill performs well both "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on bike paths and on the trail. The fork with 100mm of travel absorbs rough "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The Shimano Tourney drivetrain offered enough gears for finding a comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Whether you want an affordable bike that you can take to work, but also take "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"trail in mountains on the weekends or you’re just after a stable, comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ride for the bike path, the Summit gives a good value for money.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((12.4464 42.1028, 12.5464 42.1028, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"12.4964,41.9028\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"ThrillCycle\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"BikeShind\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"An artsy, retro-inspired bicycle that’s as "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"suggest taking it to the mountains. Fenders protect you from mud, and a rear "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"basket lets you transport groceries, flowers and books. The ThrillCycle comes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"with a limited lifetime warranty, so this little guy will last you long "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"past graduation.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"refurbished\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycleJsons</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSet</span><span class="o">(</span><span class="s">"bicycle:"</span> <span class="o">+</span> <span class="n">i</span><span class="o">,</span> <span class="n">Path2</span><span class="o">.</span><span class="na">ROOT_PATH</span><span class="o">,</span> <span class="n">bicycleJsons</span><span class="o">[</span><span class="n">i</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></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@store_location:[$lon $lat $radius $units]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"lon"</span><span class="o">,</span> <span class="o">-</span><span class="mf">0.1778</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"lat"</span><span class="o">,</span> <span class="mf">51.5524</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"radius"</span><span class="o">,</span> <span class="mi">20</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"units"</span><span class="o">,</span> <span class="s">"mi"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">2</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs1</span> <span class="o">=</span> <span class="n">res1</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs1</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</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="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo1' step. </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">SearchResult</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"@pickup_zone:[CONTAINS $bike]"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"bike"</span><span class="o">,</span> <span class="s">"POINT(-0.1278 51.5074)"</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">3</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 1 </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="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs2</span> <span class="o">=</span> <span class="n">res2</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs2</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo2' step. </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">SearchResult</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@pickup_zone:[WITHIN $europe]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"europe"</span><span class="o">,</span> <span class="s">"POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">3</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs3</span> <span class="o">=</span> <span class="n">res3</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs3</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</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="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:6 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:8 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo3' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</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></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_Java_query_geo-stepgeo2')" 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_Java_query_geo-stepgeo2" 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/java/jedis/" tabindex="1" title="Quick-Start"> Java 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/jedis/tree/master/src/test/java/io/redis/examples/QueryGeoExample.java" 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> If you want to find all pickup zones that are approximately within Europe, then you can use the following query: </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="query_geo-stepgeo3"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_geo-stepgeo3" name="query_geo-stepgeo3" 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_query_geo-stepgeo3" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-query_geo-stepgeo3" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_geo-stepgeo3" 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.SEARCH idx:bicycle "@pickup_zone:[WITHIN $europe]" PARAMS 2 europe "POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))" DIALECT 3</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_query_geo-stepgeo3')" 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_query_geo-stepgeo3" name="query_geo-stepgeo3" 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_query_geo-stepgeo3" title="Open example"> Python </label> <div aria-labelledby="tab-query_geo-stepgeo3" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_query_geo-stepgeo3" 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="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</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.json.path</span> <span class="kn">import</span> <span class="n">Path</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="n">GeoField</span><span class="p">,</span> <span class="n">GeoShapeField</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></span><span class="line"><span class="cl"><span class="n">r</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">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="c1"># create index</span> </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">GeoField</span><span class="p">(</span><span class="s2">"$.store_location"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"store_location"</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoShapeField</span><span class="p">(</span><span class="s2">"$.pickup_zone"</span><span class="p">,</span> <span class="n">coord_system</span><span class="o">=</span><span class="n">GeoShapeField</span><span class="o">.</span><span class="n">FLAT</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"pickup_zone"</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">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><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">"bicycle:"</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="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data</span> </span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_em.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</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">r</span><span class="o">.</span><span class="n">pipeline</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</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="sa">f</span><span class="s1">'bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s1">'</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</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></span><span class="line"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"lon"</span><span class="p">:</span> <span class="o">-</span><span class="mf">0.1778</span><span class="p">,</span> <span class="s2">"lat"</span><span class="p">:</span> <span class="mf">51.5524</span><span class="p">,</span> <span class="s2">"radius"</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="s2">"units"</span><span class="p">:</span> <span class="s2">"mi"</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@store_location:[$lon $lat $radius $units]"</span><span class="p">)</span><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="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{1 total, docs: [Document {'id': 'bicycle:5', ...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"bike"</span><span class="p">:</span> <span class="s2">"POINT(-0.1278 51.5074)"</span><span class="p">}</span> </span></span><span class="line"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@pickup_zone:[CONTAINS $bike]"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">3</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; 1</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"><span class="n">params_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"europe"</span><span class="p">:</span> <span class="s2">"POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))"</span><span class="p">}</span> </span></span><span class="line hl"><span class="cl"><span class="n">q</span> <span class="o">=</span> <span class="n">Query</span><span class="p">(</span><span class="s2">"@pickup_zone:[WITHIN $europe]"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">3</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">q</span><span class="p">,</span> <span class="n">query_params</span><span class="o">=</span><span class="n">params_dict</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> <span class="c1"># &gt;&gt;&gt; 5</span> </span></span><span class="line"><span class="cl"> </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_query_geo-stepgeo3')" 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_query_geo-stepgeo3" 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/query_geo.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> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_query_geo-stepgeo3" name="query_geo-stepgeo3" 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="Nodejs_query_geo-stepgeo3" title="Open example"> Node.js </label> <div aria-labelledby="tab-query_geo-stepgeo3" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_geo-stepgeo3" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">SchemaFieldTypes</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'@redis/search'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1">// create index </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.store_location'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">GEO</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'store_location'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.pickup_zone'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">GEOSHAPE</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'pickup_zone'</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="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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">// load data </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_em.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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="kr">const</span> <span class="nx">res1</span><span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'@store_location:[-0.1778 51.5524 20 mi]'</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; {total: 1, documents: [ { id: 'bicycle:5', value: [Object: null prototype] } ]} </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">params_dict_geo2</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">bike</span><span class="o">:</span> <span class="s1">'POINT(-0.1278 51.5074)'</span> <span class="p">};</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">q_geo2</span> <span class="o">=</span> <span class="s1">'@pickup_zone:[CONTAINS $bike]'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="nx">q_geo2</span><span class="p">,</span> <span class="p">{</span> <span class="nx">PARAMS</span><span class="o">:</span> <span class="nx">params_dict_geo2</span><span class="p">,</span> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">3</span> <span class="p">});</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; {total: 1, documents: [ { id: 'bicycle:5', value: [Object: null prototype] } ]} </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">params_dict_geo3</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">europe</span><span class="o">:</span> <span class="s1">'POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))'</span> <span class="p">};</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">q_geo3</span> <span class="o">=</span> <span class="s1">'@pickup_zone:[WITHIN $europe]'</span><span class="p">;</span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="nx">q_geo3</span><span class="p">,</span> <span class="p">{</span> <span class="nx">PARAMS</span><span class="o">:</span> <span class="nx">params_dict_geo3</span><span class="p">,</span> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">3</span> <span class="p">});</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res3</span><span class="p">);</span> <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">// total: 5, </span></span></span><span class="line hl"><span class="cl"><span class="c1">// documents: [ </span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:5', value: [Object: null prototype] }, </span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:6', value: [Object: null prototype] }, </span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:7', value: [Object: null prototype] }, </span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:8', value: [Object: null prototype] }, </span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:9', value: [Object: null prototype] } </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 class="c1"></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_Nodejs_query_geo-stepgeo3')" 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_Nodejs_query_geo-stepgeo3" 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/nodejs/" tabindex="1" title="Quick-Start"> Node.js 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/node-redis/tree/emb-examples/doctests/query-geo.js" 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> <input class="radiotab w-0 h-0" data-lang="java" id="Java_query_geo-stepgeo3" name="query_geo-stepgeo3" 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="Java_query_geo-stepgeo3" title="Open example"> Java </label> <div aria-labelledby="tab-query_geo-stepgeo3" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_query_geo-stepgeo3" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.stream.Stream</span><span class="o">;</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">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.GeoShapeField.CoordinateSystem</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.JedisDataException</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.json.Path2</span><span class="o">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">QueryGeoExample</span> <span class="o">{</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="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</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">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.store_location"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"store_location"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">GeoShapeField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.pickup_zone"</span><span class="o">,</span> <span class="n">CoordinateSystem</span><span class="o">.</span><span class="na">FLAT</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"pickup_zone"</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></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">bicycleJsons</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-74.0610 40.6678, -74.0610 40.7578))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-74.0060,40.7128\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Velorim\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Jigger\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 270,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"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="o">+</span> <span class="s">"This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"is the vehicle of choice for the rare tenacious little rider raring to go.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-118.2887 33.9872, -118.2887 34.0972))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-118.2437,34.0522\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Bicyk\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Hillcraft\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Kids want to ride with as little weight as possible. Especially "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"off a 24'' bike. The Hillcraft 26 is just the solution they need!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-87.6848 41.8231, -87.6848 41.9331))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-87.6298,41.8781\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Nord\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Chook air 5\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The Chook Air 5 gives kids aged six years and older a durable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and uberlight mountain bike for their first experience on tracks and easy cruising through "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"forests and fields. The lower top tube makes it easy to mount and dismount in any "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"situation, giving your kids greater safety on the trails.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-80.2433 25.6967, -80.2433 25.8067))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-80.1918,25.7617\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Eva\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Eva 291\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3400,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The sister company to Nord, Eva launched in 2005 as the first "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"are optimized for the feminine physique using analytics from a body metrics database. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"full-suspension, cross-country ride has been designed for velocity. The 291 has "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"100mm of front and rear travel, a superlight aluminum frame and fast-rolling "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"29-inch wheels. Yippee!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-122.4644 37.7099, -122.4644 37.8199))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-122.4194,37.7749\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Noka Bikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Kahuna\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Whether you want to try your hand at XC racing or are looking "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"for a lively trail bike that's just as inspiring on the climbs as it is over rougher "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ground, the Wilder is one heck of a bike built specifically for short women. Both the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"frames and components have been tweaked to include a women’s saddle, different bars "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and unique colourway.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-0.1778 51.4024, -0.1778 51.5524))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-0.1278,51.5074\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Breakout\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"XBN 2.1 Alloy\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 810,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The XBN 2.1 Alloy is our entry-level road bike – but that’s "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"not to say that it’s a basic machine. With an internal weld aluminium frame, a full "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"doesn’t break the bank and delivers craved performance.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"2.1767 48.5516, 2.1767 48.9016))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.3522,48.8566\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"ScramBikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"WattBike\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 2300,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The WattBike is the best e-bike for people who still "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"charge. It’s great for tackling hilly terrain or if you just fancy a more "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"leisurely ride. With three working modes, you can choose between E-bike, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"assisted bicycle, and normal bike modes.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"13.3260 52.2700, 13.3260 52.5700))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"13.4050,52.5200\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Peaknetic\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Secto\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 430,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"If you struggle with stiff fingers or a kinked neck or "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"back after a few minutes on the road, this lightweight, aluminum bike alleviates "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"those issues and allows you to enjoy the ride. From the ergonomic grips to the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The rear-inclined seat tube facilitates stability by allowing you to put a foot "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on the ground to balance at a stop, and the low step-over frame makes it "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"accessible for all ability and mobility levels. The saddle is very soft, with "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"a wide back to support your hip joints and a cutout in the center to redistribute "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"facilitate setting up the Roll Low-Entry as your preferred commuter, and the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"1.9450 41.1987, 1.9450 41.4301))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.1734, 41.3851\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"nHill\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Summit\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"This budget mountain bike from nHill performs well both "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on bike paths and on the trail. The fork with 100mm of travel absorbs rough "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The Shimano Tourney drivetrain offered enough gears for finding a comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Whether you want an affordable bike that you can take to work, but also take "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"trail in mountains on the weekends or you’re just after a stable, comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ride for the bike path, the Summit gives a good value for money.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((12.4464 42.1028, 12.5464 42.1028, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"12.4964,41.9028\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"ThrillCycle\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"BikeShind\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"An artsy, retro-inspired bicycle that’s as "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"suggest taking it to the mountains. Fenders protect you from mud, and a rear "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"basket lets you transport groceries, flowers and books. The ThrillCycle comes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"with a limited lifetime warranty, so this little guy will last you long "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"past graduation.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"refurbished\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycleJsons</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSet</span><span class="o">(</span><span class="s">"bicycle:"</span> <span class="o">+</span> <span class="n">i</span><span class="o">,</span> <span class="n">Path2</span><span class="o">.</span><span class="na">ROOT_PATH</span><span class="o">,</span> <span class="n">bicycleJsons</span><span class="o">[</span><span class="n">i</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></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@store_location:[$lon $lat $radius $units]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"lon"</span><span class="o">,</span> <span class="o">-</span><span class="mf">0.1778</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"lat"</span><span class="o">,</span> <span class="mf">51.5524</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"radius"</span><span class="o">,</span> <span class="mi">20</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"units"</span><span class="o">,</span> <span class="s">"mi"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">2</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs1</span> <span class="o">=</span> <span class="n">res1</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs1</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</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="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo1' step. </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">SearchResult</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@pickup_zone:[CONTAINS $bike]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"bike"</span><span class="o">,</span> <span class="s">"POINT(-0.1278 51.5074)"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">3</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 1 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs2</span> <span class="o">=</span> <span class="n">res2</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs2</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</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="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo2' step. </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">SearchResult</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"@pickup_zone:[WITHIN $europe]"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">addParam</span><span class="o">(</span><span class="s">"europe"</span><span class="o">,</span> <span class="s">"POLYGON((-25 35, 40 35, 40 70, -25 70, -25 35))"</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">dialect</span><span class="o">(</span><span class="mi">3</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 5 </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="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs3</span> <span class="o">=</span> <span class="n">res3</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs3</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; bicycle:5 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:6 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:7 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:8 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'geo3' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</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></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_Java_query_geo-stepgeo3')" 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_Java_query_geo-stepgeo3" 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/java/jedis/" tabindex="1" title="Quick-Start"> Java 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/jedis/tree/master/src/test/java/io/redis/examples/QueryGeoExample.java" 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> <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/search-and-query/query/geo-spatial/"/> <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/security/add-client-certificates/.html
<section class="prose w-full py-12 max-w-none"> <h1> Add client certificates </h1> <p class="text-lg -mt-5 mb-10"> Add client certificates to your REDB custom resource. </p> <p> For each client certificate you want to use with your database, you need to create a Kubernetes secret to hold it. You can then reference that secret in your Redis Enterprise database (REDB) custom resource spec. </p> <h2 id="create-a-secret-to-hold-the-new-certificate"> Create a secret to hold the new certificate </h2> <ol> <li> <p> <a href="https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-config-file/"> Create the secret config file </a> with the required fields shown below. </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l">v1</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l">Secret</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">Opaque</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">metadata</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">&lt;client-cert-secret&gt;</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">namespace</span><span class="p">:</span><span class="w"> </span><span class="l">&lt;your-rec-namespace&gt;</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">data</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">cert</span><span class="p">:</span><span class="w"> </span><span class="l">&lt;client-certificate&gt;</span><span class="w"> </span></span></span></code></pre> </div> </li> <li> <p> Apply the file to create the secret resource. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">kubectl apply -f &lt;client-cert-secret&gt;.yaml </span></span></code></pre> </div> </li> </ol> <h2 id="edit-the-redb-resource"> Edit the REDB resource </h2> <ol> <li> Add the secret name to the REDB custom resource ( <code> redb.yaml </code> ) with the <code> clientAuthenticationCertificates </code> property in the <code> spec </code> section. </li> </ol> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="w"> </span><span class="nt">spec</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">clientAuthenticationCertificates</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">&lt;client-cert-secret&gt;</span><span class="w"> </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/kubernetes/security/add-client-certificates/"/> <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/install/install-stack/.html
<section class="prose w-full py-12 max-w-none"> <h1> <svg class="stack-logo-inline" fill="none" viewbox="0 0 39 31"> <title> This capability is a part of Redis Stack </title> <path d="M21.7371 15.2903C21.5759 15.2895 21.4198 15.2337 21.2947 15.1321 21.1695 15.0305 21.0828 14.8892 21.049 14.7316S21.0362 14.4096 21.1086 14.2655C21.1811 14.1215 21.3005 14.0066 21.4472 13.9397L35.7199 7.47338 21.4578 1.34289C21.2943 1.26329 21.1678 1.12377 21.1045.953307 21.0412.78285 21.046.594558 21.1179.427547 21.1898.260535 21.3233.127641 21.4906.0564719 21.6579-.0146977 21.8462-.0186728 22.0164.045373L37.7492 6.80518C37.8747 6.8605 37.9814 6.95112 38.0563 7.06599S38.171 7.31503 38.171 7.45216 38.1312 7.72347 38.0563 7.83834C37.9814 7.95321 37.8747 8.04383 37.7492 8.09915L22.0306 15.2266C21.9388 15.2698 21.8385 15.2916 21.7371 15.2903z" fill="#db2e2e"> </path> <path d="M16.4339 15.2903C16.3379 15.2906 16.2429 15.2714 16.1546 15.2337L.421813 8.47393C.296339 8.41861.18966 8.32799.114767 8.21312.0398745 8.09825.0 7.96407.0 7.82694.0 7.68981.0398745 7.55564.114767 7.44077.18966 7.3259.296339 7.23528.421813 7.17995L16.1546.052465C16.3235-.0111265 16.5104-.00772359 16.6768.0619772 16.8433.131678 16.9768.2624 17.0501.427363 17.1233.592325 17.1306.779042 17.0706.949259 17.0106 1.11948 16.8878 1.26031 16.7274 1.34291L2.44763 7.80573 16.7132 13.9362C16.8612 14.0015 16.9823 14.1154 17.0565 14.2592 17.1306 14.4029 17.1532 14.5677 17.1205 14.7261 17.0878 14.8845 17.0019 15.0269 16.8769 15.1295 16.752 15.2322 16.5956 15.2889 16.4339 15.2903z" fill="#db2e2e"> </path> <path clip-rule="evenodd" d="M29.1651 17.4328c3.1288-1.2763 6.2047-2.5279 7.1875-3.0617L37.1163 13.9539C37.3908 13.8108 37.6564 13.6514 37.9118 13.4766 37.972 13.8833 37.972 14.2967 37.9118 14.7034 37.8022 15.1312 37.4875 15.4847 36.289 16.061 35.4617 16.4605 33.1531 17.408 30.5792 18.4687c-3.6167 1.4884-7.778 3.1819-9.0826 3.889C19.2587 23.4183 18.0284 23.4183 16.3137 22.644 15.4864 22.2021 12.4918 20.9117 9.39476 19.5611c-3.3198-1.446-6.75627-2.945-7.77802-3.4753C.22377 15.3575.153061 15.1948.160132 14.8271V13.8655L.513678 14.0564c1.311652.6647 7.219412 3.1819 11.486722 5.0204 2.1142.898 3.8112 1.6298 4.3769 1.8844C18.092 21.7319 19.3082 21.8733 21.5603 20.6748 22.7022 20.0808 25.9619 18.7409 29.1651 17.4328z" fill="#494c4d" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.1651 24.5037c3.1288-1.2763 6.2047-2.5279 7.1875-3.0617L37.1163 21.0248C37.3908 20.8817 37.6564 20.7223 37.9118 20.5475 37.972 20.9542 37.972 21.3676 37.9118 21.7743 37.8022 22.2021 37.4875 22.5557 36.289 23.1319 35.4617 23.5314 33.1531 24.4789 30.5792 25.5396c-3.6167 1.4884-7.778 3.1819-9.0826 3.889-2.2379 1.0606-3.4682 1.0606-5.1829.2864C15.4864 29.2801 12.4918 27.9755 9.39476 26.625c-3.3198-1.446-6.75627-2.9451-7.77802-3.4754C.22377 22.4213.153061 22.2587.160132 21.891V20.9364L.513678 21.1273C1.82533 21.792 7.73309 24.3092 12.0004 26.1477c2.1001.898 3.8006 1.6298 4.3663 1.8844C18.0814 28.8028 19.2976 28.9442 21.5497 27.7457 22.7022 27.1518 25.9619 25.8118 29.1651 24.5037z" fill="#494c4d" fill-rule="evenodd"> </path> </svg> Install Redis Stack </h1> <p class="text-lg -mt-5 mb-10"> Install Redis Stack on Linux, macOS, and Windows </p> <p> While you can install Redis Stack on any of the platforms listed below, you might also consider using Redis Cloud by creating 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> <hr/> <nav> <a href="/docs/latest/operate/oss_and_stack/install/install-stack/linux/"> Install Redis Stack on Linux </a> <p> How to install Redis Stack on Linux </p> <a href="/docs/latest/operate/oss_and_stack/install/install-stack/mac-os/"> Install Redis Stack on macOS </a> <p> How to install Redis Stack on macOS </p> <a href="/docs/latest/operate/oss_and_stack/install/install-stack/windows/"> Install Redis Stack on Windows </a> <p> How to install Redis Stack on Windows </p> <a href="/docs/latest/operate/oss_and_stack/install/install-stack/docker/"> Run Redis Stack on Docker </a> <p> How to install Redis Stack using Docker </p> <a href="/docs/latest/operate/oss_and_stack/install/install-stack/binaries/"> Install Redis Stack from binaries </a> <p> How to install Redis Stack using tarballs </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/oss_and_stack/install/install-stack/"/> <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/search-and-query/advanced-concepts/chinese/.html
<section class="prose w-full py-12"> <h1> Chinese support </h1> <p class="text-lg -mt-5 mb-10"> Chinese support for searching and querying in Redis Stack </p> <p> Support for adding documents in Chinese is available starting at version 0.99.0. </p> <p> Chinese support allows Chinese documents to be added and tokenized using segmentation rather than simple tokenization using whitespace and/or punctuation. </p> <p> Indexing a Chinese document is different than indexing a document in most other languages because of how tokens are extracted. While most languages can have their tokens distinguished by separation characters and whitespace, this is not common in Chinese. </p> <p> Chinese tokenization is done by scanning the input text and checking every character or sequence of characters against a dictionary of predefined terms, and determining the most likely match based on the surrounding terms and characters. </p> <p> Redis Stack makes use of the <a href="https://github.com/lionsoul2014/friso"> Friso </a> Chinese tokenization library for this purpose. This is largely transparent to the user and often no additional configuration is required. </p> <h2 id="example-using-chinese-in-queries"> Example: using chinese in queries </h2> <p> In pseudo-code: </p> <pre tabindex="0"><code>FT.CREATE idx ON HASH SCHEMA txt TEXT HSET docCn txt "Redis支持主从同步。数据可以从主服务器向任意数量的从服务器上同步,从服务器可以是关联其他从服务器的主服务器。这使得Redis可执行单层树复制。从盘可以有意无意的对数据进行写操作。由于完全实现了发布/订阅机制,使得从数据库在任何地方同步树时,可订阅一个频道并接收主服务器完整的消息发布记录。同步对读取操作的可扩展性和数据冗余很有帮助。[8]" FT.SEARCH idx "数据" LANGUAGE chinese HIGHLIGHT SUMMARIZE # Outputs: # &lt;b&gt;数据&lt;/b&gt;?... &lt;b&gt;数据&lt;/b&gt;进行写操作。由于完全实现了发布... &lt;b&gt;数据&lt;/b&gt;冗余很有帮助。[8... </code></pre> <p> Using the Python client: </p> <pre tabindex="0"><code># -*- coding: utf-8 -*- from redisearch.client import Client, Query from redisearch import TextField client = Client('idx') try: client.drop_index() except: pass client.create_index([TextField('txt')]) # Add a document client.add_document('docCn1', txt='Redis支持主从同步。数据可以从主服务器向任意数量的从服务器上同步从服务器可以是关联其他从服务器的主服务器。这使得Redis可执行单层树复制。从盘可以有意无意的对数据进行写操作。由于完全实现了发布/订阅机制,使得从数据库在任何地方同步树时,可订阅一个频道并接收主服务器完整的消息发布记录。同步对读取操作的可扩展性和数据冗余很有帮助。[8]', language='chinese') print client.search(Query('数据').summarize().highlight().language('chinese')).docs[0].txt # Outputs: # &lt;b&gt;数据&lt;/b&gt;?... &lt;b&gt;数据&lt;/b&gt;进行写操作。由于完全实现了发布... &lt;b&gt;数据&lt;/b&gt;冗余很有帮助。[8... </code></pre> <h2 id="using-custom-dictionaries"> Using custom dictionaries </h2> <p> If you wish to use a custom dictionary, you can do so at the module level when loading the module. The <code> FRISOINI </code> setting can point to the location of a <code> friso.ini </code> file that contains the relevant settings and paths to the dictionary files. </p> <p> Note that there is no default <code> friso.ini </code> file location. RediSearch comes with its own <code> friso.ini </code> and dictionary files, which are compiled into the module binary at build-time. </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/search-and-query/advanced-concepts/chinese/"/> <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/release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> Release notes </h1> <p> Here's what changed recently in Redis Enterprise Software: </p> <table> <thead> <tr> <th style="text-align:left"> Version (Release date) </th> <th style="text-align:left"> Major changes </th> <th style="text-align:left"> OSS Redis compatibility </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-8-releases/"> 7.8.2 releases </a> </td> <td style="text-align:left"> Redis Community Edition 7.4 features. Hash field expiration. Client-side caching support. Metrics stream engine preview. New APIs to check database availability, rebalance shards, fail over shards, and control database traffic. Cluster Manager UI enhancements for node actions, database tags, and database configuration. User manager role. Log rotation based on both size and time. Module management enhancements. Configurable minimum password length. Configurable license expiration alert threshold. </td> <td style="text-align:left"> Redis 7.4.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/"> 7.4.x releases </a> </td> <td style="text-align:left"> New Cluster Manager UI enhancements, including Active-Active database management. Full TLS 1.3 support. Automatic recovery configuration. Full IPv6 support, including for internal traffic. Maintenance mode enhancements. Module management enhancements. RHEL 9 support. </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/"> 7.2.4 releases </a> </td> <td style="text-align:left"> Redis 7.0 and 7.2 features. Auto Tiering (enhanced successor to Redis on Flash). RESP3 support. Sharded pub/sub. Preview of the new Cluster Manager UI. Redis Stack 7.2 features. Three Redis database versions. License file structure updates. Redis ACL selectors and enhanced key-based permissions. New INFO fields. Log rotation enhancements. Multi-OS upgrade support for clusters with modules. </td> <td style="text-align:left"> Redis 7.2.0 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/"> 6.4.2 releases </a> </td> <td style="text-align:left"> Pub/sub ACLs &amp; default permissions. Validate client certificates by subject attributes. Ubuntu 20.04 support. </td> <td style="text-align:left"> Redis 6.2.10 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-2-18-releases/"> 6.2.18 releases </a> </td> <td style="text-align:left"> Database auditing. Private key encryption. Active-Active database support for MEMORY USAGE command. </td> <td style="text-align:left"> Redis 6.2.6 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-2-12/"> 6.2.12 (August 2022) </a> </td> <td style="text-align:left"> OCSP Support. Password &amp; session configuration changes. RHEL 8.6 support. </td> <td style="text-align:left"> Redis 6.2.6 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-2-10-february-2022/"> 6.2.10 (February 2022) </a> </td> <td style="text-align:left"> Python 3 support. RHEL 8.5 support. </td> <td style="text-align:left"> Redis 6.2.5 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-2-8-october-2021/"> 6.2.8 (October 2021) </a> </td> <td style="text-align:left"> RHEL 8 support. Set backup start time. </td> <td style="text-align:left"> Redis 6.2.3 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-2-4-august-2021/"> 6.2.4 (August 2021) </a> </td> <td style="text-align:left"> Internode encryption. Nginx replaced by envoy. New upgrade policies/behavior. </td> <td style="text-align:left"> Redis 6.2 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-0-20-april-2021/"> 6.0.20 (April 2021) </a> </td> <td style="text-align:left"> Role-based LDAP integration. Enhanced client mutual authentication. Active-Active improvements for eviction policies, migration, and the BITFIELD data type. </td> <td style="text-align:left"> Redis 6.0.9 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-0-12-january-2021/"> 6.0.12 (January 2021) </a> </td> <td style="text-align:left"> Distribute synchronization across nodes for Active-Active and Active-Passive databases. Disable internal services to free memory. User accounts support password rotation. Module depdencies automatically installed. Syncer process recovery. </td> <td style="text-align:left"> Redis 6.0.6 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-0-8-september-2020/"> 6.0.8 (September 2020) </a> </td> <td style="text-align:left"> RediSearch 2.0 support. Improved rladmin support for module upgrades. </td> <td style="text-align:left"> Redis 6.0.5 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/release-notes/rs-6-0-may-2020/"> 6.0 (May 2020) </a> </td> <td style="text-align:left"> ACL and RBAC improvements for database access. Active-Active databases support Redis Streams. </td> <td style="text-align:left"> Redis 6 </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/7.4/release-notes/legacy-release-notes/"> Previous releases </a> </td> <td style="text-align:left"> Release notes for Redis Enterprise Software 5.6.0 (April 2020) and earlier versions. </td> <td style="text-align:left"> </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/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/kubernetes/security/internode-encryption/.html
<section class="prose w-full py-12 max-w-none"> <h1> Enable internode encryption </h1> <p class="text-lg -mt-5 mb-10"> Enable encryption for communication between REC nodes in your K8s cluster. </p> <p> Internode encryption provides added security by encrypting communication between nodes in your Redis Enterprise cluster (REC). </p> <p> Enable internode encryption in the <code> spec </code> section of your REC custom resource file. </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">spec</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">dataInternodeEncryption</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span></span></span></code></pre> </div> <p> This change will apply to all databases created in the REC. You can override the cluster-wide setting for individual databases. </p> <p> Edit your Redis Enterprise database (REDB) custom resource file to disable internode encryption for only that database. </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">spec</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">dataInternodeEncryption</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span></span></span></code></pre> </div> <p> To learn more about internode encryption, see <a href="/docs/latest/operate/rs/security/encryption/internode-encryption/"> Internode encryption for Redis Enterprise Software </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/kubernetes/security/internode-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/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgears/redisgears-1.2-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisGears 1.2 release notes </h1> <p class="text-lg -mt-5 mb-10"> Plugins and JVM support. Python async await. Override commands API. Register functions on key miss events. Tracks new statistics. Python profiler support. Extended RedisAI integration. </p> <h2 id="requirements"> Requirements </h2> <p> RedisGears v1.2.10 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 6.0.0 </li> <li> Minimum Redis Enterprise Software version (cluster): 6.0.12 </li> </ul> <h2 id="1210-october-2024"> 1.2.10 (October 2024) </h2> <p> This is a maintenance release for RedisGears 1.2 </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features or fixes. </p> <p> Details </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/redisgears/redisgears/pull/1114"> #1114 </a> (REPLICAOF and Redis Enterprise A-A only) Cross slot violation. Avoid using <code> RM_Call </code> + <code> SCAN </code> command which might replicate multiple keys deletion inside a <code> MULTI EXEC </code> block when a lazy expire takes place </li> </ul> </li> <li> <p> Notes: </p> <ul> <li> RHEL7 is no longer supported </li> </ul> </li> </ul> <h2 id="129-march-2024"> 1.2.9 (March 2024) </h2> <p> This is a maintenance release for RedisGears 1.2 </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features or fixes. </p> <p> Details </p> <ul> <li> <p> Features: </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/pull/1087"> #1087 </a> Support for RHEL9 </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/986"> #986 </a> Added execution mode parameter to <code> run </code> function: allows choosing the execution mode: <code> sync </code> / <code> async </code> / <code> async_local </code> - same as when used with register </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/pull/1097"> #1097 </a> Fix stream reader missing notification due to wrong key name comparison (comparing using case sensitive) </li> </ul> </li> </ul> <h2 id="127-july-2023"> 1.2.7 (July 2023) </h2> <p> This is a maintenance release for RedisGears 1.2 </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features or fixes. </p> <p> Details </p> <ul> <li> <p> Features: </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/pull/972"> #972 </a> Upgrade JVM to 17.0.7 </li> </ul> </li> </ul> <h2 id="126-march-2023"> 1.2.6 (March 2023) </h2> <p> This is a maintenance release for RedisGears 1.2. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features or fixes. </p> <p> Details </p> <ul> <li> <p> Features: </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/pull/832"> #832 </a> , <a href="https://github.com/RedisGears/RedisGears/pull/844"> #844 </a> Added IPV6 support </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/841"> #841 </a> Generate artifacts with dependencies included </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/pull/810"> #810 </a> Fix invalid memory access when checking if a trigger is already registered </li> </ul> </li> </ul> <h2 id="v125-july-2022"> v1.2.5 (July 2022) </h2> <p> This is a maintenance release for RedisGears 1.2. </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/RedisGears/RedisGears/issues/792"> #792 </a> , <a href="https://github.com/RedisGears/RedisGears/pull/798"> #798 </a> Execution was triggered infinitely when trimming is turned off. </li> <li> <a href="https://github.com/RedisGears/RedisGears/issues/791"> #791 </a> , <a href="https://github.com/RedisGears/RedisGears/pull/796"> #796 </a> Stop triggering executions during pause even on failure. </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/794"> #794 </a> , <a href="https://github.com/RedisGears/RedisGears/pull/797"> #797 </a> Use <code> PythonInstallationDir </code> configuration to find the virtual environment location on Redis Enterprise. (MOD-1734) </li> </ul> </li> </ul> <h2 id="v124-may-2022"> v1.2.4 (May 2022) </h2> <p> This is a maintenance release for RedisGears 1.2. </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/RedisGears/RedisGears/pull/772"> #772 </a> Added the ability to upgrade a dependency at runtime with <code> FORCE_REQUIREMENTS_REINSTALLATION </code> on <code> RG.PYEXECUTE </code> . </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/765"> #765 </a> Allow deactivating override Python allocators for performance improvements. </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/issues/761"> #761 </a> , <a href="https://github.com/RedisGears/RedisGears/issues/760"> #760 </a> , <a href="https://github.com/RedisGears/RedisGears/pull/778"> #778 </a> <code> StreamReader </code> fixes to pause and unregister stream processing. </li> </ul> </li> </ul> <h2 id="v123-april-2022"> v1.2.3 (April 2022) </h2> <p> This is a maintenance release for RedisGears 1.2. </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/RedisGears/RedisGears/pull/739"> #739 </a> Added TLS support </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/734"> #734 </a> Pause/Unpause registrations </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/741"> #741 </a> Added build for Python-only artifacts </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/pull/740"> #740 </a> Fix -nan value on registration stats </li> </ul> </li> </ul> <h2 id="v122-february-2022"> v1.2.2 (February 2022) </h2> <p> This is the General Availability release of RedisGears 1.2. </p> <h3 id="headlines"> Headlines </h3> <h4 id="plugins-and-jvm-support"> Plugins and JVM support </h4> <p> RedisGears 1.2 comes with a new plugin mechanism that allows you to decide which languages you want to load into RedisGears. Currently, we support two languages: Python and Java (JVM languages). You can decide which language you want to use using the new <code> Plugin </code> configuration. </p> <p> Full documentation for JVM support can be found on the <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/"> Redis documentation website </a> . </p> <h4 id="python-async-await-support"> Python async await support </h4> <p> RedisGears provides support for Python coroutines. Each step of your gears function can now be a Python coroutine that will take the execution to the background or will wait for some event to happen. Refer to the following links for more information: </p> <ul> <li> Async Await Support </li> <li> Async Await Advanced Topics </li> </ul> <h4 id="override-commands-api"> Override commands API </h4> <p> You can override Redis vanilla commands with a function. For more information, refer to the RedisGears command hooks documentation. </p> <h4 id="key-miss-event-for-read-through-pattern"> Key miss event for read-through pattern </h4> <p> Requested by many users, RedisGears 1.2 allows you to register functions on key miss event. One use case for this is to implement a read-through caching pattern. For more information about this topic, refer to the following links: </p> <ul> <li> Key Miss Event in the RedisGears documentation. </li> <li> <a href="https://github.com/RedisGears/rghibernate"> rghibernate </a> recipe that leverages the key miss event to implement read-through from external databases. </li> </ul> <h4 id="better-visibility-and-analyzing-tools"> Better visibility and analyzing tools </h4> <p> We improved the experience during the development phase by enabling better debugging and troubleshooting. There is still room for improvement but RedisGears 1.2 makes the first steps toward a simpler API that is easier to use. This new version allows you to name your code and upgrade it with a single Redis command. For more information, refer to the upgrade section of the RedisGears introduction documentation. </p> <p> RedisGears now tracks the following new statistics to better analyze your registrations: </p> <ul> <li> <code> lastRunDurationMS </code> - duration in milliseconds of the last execution </li> <li> <code> totalRunDurationMS </code> - total runtime of all executions in milliseconds </li> <li> <code> avgRunDurationMS </code> - average execution runtime in milliseconds </li> </ul> <p> For streams, RedisGears also tracks the following data: </p> <ul> <li> <code> lastEstimatedLagMS </code> - gives the last batch lag (the time difference between the first batch entry in the stream and the time the entire batch finished processing) </li> <li> <code> avgEstimatedLagMS </code> - average of the <code> lastEstimatedLagMS </code> field. </li> </ul> <p> The <code> RG.DUMPREGISTRATIONS </code> command exposes these new statistics. </p> <p> RedisGears 1.2 also adds support for a Python profiler, specifically <a href="https://docs.python.org/3.7/library/profile.html#module-cProfile"> <code> cProfile </code> </a> . For more information, refer to the documentation for the following commands: </p> <ul> <li> <code> RG.PYPROFILE STATS </code> </li> <li> <code> RG.PYPROFILE RESET </code> </li> </ul> <h4 id="redisai-integration"> RedisAI integration </h4> <p> Although RedisAI integration was already supported in v1.0, RedisGears 1.2 adds official support for all capabilities in RedisAI v1.2. The API was extended to support RedisAI DAG and was combined with the new async await API to achieve the best performance possible. </p> <h3 id="details"> Details </h3> <p> Bug fixes (since 1.0.9): </p> <ul> <li> <a href="https://github.com/RedisGears/RedisGears/pull/557"> #557 </a> , <a href="https://github.com/RedisGears/RedisGears/issues/554"> #554 </a> <code> RG.CONFIGGET </code> returns user-defined configuration </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/572"> #572 </a> Lock Redis GIL when creating RedisAI DAG </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/661"> #661 </a> , <a href="https://github.com/RedisGears/RedisGears/issues/536"> #536 </a> Added <code> RG.TRIGGERONKEY </code> </li> <li> <a href="https://github.com/RedisGears/RedisGears/issues/650"> #650 </a> Do not propagate <code> MULTI EXEC </code> on Redis 7 </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/671"> #671 </a> , <a href="https://github.com/RedisGears/RedisGears/issues/558"> #558 </a> Wait for cluster to be initialized when reading stream data </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/656"> #656 </a> Stream reader creates more than one execution on a stream </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/676"> #676 </a> Globals dictionary not set correctly after deserialization </li> <li> <a href="https://github.com/RedisGears/RedisGears/issues/665"> #665 </a> , <a href="https://github.com/RedisGears/RedisGears/pull/679"> #679 </a> Allow case-insensitive event type on command reader </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/697"> #697 </a> <code> hashtag() </code> function for Redis Enterprise </li> <li> <a href="https://github.com/RedisGears/RedisGears/pull/688"> #688 </a> , <a href="https://github.com/RedisGears/RedisGears/issues/545"> #545 </a> Check <code> REDISMODULE_CTX_FLAGS_DENY_BLOCKING </code> flag before blocking the client </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> This is the first GA version of 1.2. The version inside Redis is 1.2.2 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a GA flag. </p> </li> <li> <p> Minimum Redis version: 6.0.0 </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/redisgears/redisgears-1.2-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/commands/function-list/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FUNCTION LIST </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FUNCTION LIST [LIBRARYNAME library-name-pattern] [WITHCODE]</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) where N is the number of functions </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> Return information about the functions and libraries. </p> <p> You can use the optional <code> LIBRARYNAME </code> argument to specify a pattern for matching library names. The optional <code> WITHCODE </code> modifier will cause the server to include the libraries source implementation in the reply. </p> <p> The following information is provided for each of the libraries in the response: </p> <ul> <li> <strong> library_name: </strong> the name of the library. </li> <li> <strong> engine: </strong> the engine of the library. </li> <li> <strong> functions: </strong> the list of functions in the library. Each function has the following fields: <ul> <li> <strong> name: </strong> the name of the function. </li> <li> <strong> description: </strong> the function's description. </li> <li> <strong> flags: </strong> an array of <a href="/docs/latest/develop/interact/programmability/functions-intro#function-flags"> function flags </a> . </li> </ul> </li> <li> <strong> library_code: </strong> the library's source code (when given the <code> WITHCODE </code> modifier). </li> </ul> <p> For more information please refer to <a href="/docs/latest/develop/interact/programmability/functions-intro/"> Introduction to Redis Functions </a> . </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : information about functions and libraries. <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/function-list/"/> <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/migrate/.html
<section class="prose w-full py-12"> <h1 class="command-name"> MIGRATE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">MIGRATE host port &lt;key | ""&gt; destination-db timeout [COPY] [REPLACE] [AUTH password | AUTH2 username password] [KEYS 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"> 2.6.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed. </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> Atomically transfer a key from a source Redis instance to a destination Redis instance. On success the key is deleted from the original instance and is guaranteed to exist in the target instance. </p> <p> The command is atomic and blocks the two instances for the time required to transfer the key, at any given time the key will appear to exist in a given instance or in the other instance, unless a timeout error occurs. In 3.2 and above, multiple keys can be pipelined in a single call to <code> MIGRATE </code> by passing the empty string ("") as key and adding the <code> KEYS </code> clause. </p> <p> The command internally uses <a href="/docs/latest/commands/dump/"> <code> DUMP </code> </a> to generate the serialized version of the key value, and <a href="/docs/latest/commands/restore/"> <code> RESTORE </code> </a> in order to synthesize the key in the target instance. The source instance acts as a client for the target instance. If the target instance returns OK to the <a href="/docs/latest/commands/restore/"> <code> RESTORE </code> </a> command, the source instance deletes the key using <a href="/docs/latest/commands/del/"> <code> DEL </code> </a> . </p> <p> The timeout specifies the maximum idle time in any moment of the communication with the destination instance in milliseconds. This means that the operation does not need to be completed within the specified amount of milliseconds, but that the transfer should make progresses without blocking for more than the specified amount of milliseconds. </p> <p> <code> MIGRATE </code> needs to perform I/O operations and to honor the specified timeout. When there is an I/O error during the transfer or if the timeout is reached the operation is aborted and the special error - <code> IOERR </code> returned. When this happens the following two cases are possible: </p> <ul> <li> The key may be on both the instances. </li> <li> The key may be only in the source instance. </li> </ul> <p> It is not possible for the key to get lost in the event of a timeout, but the client calling <code> MIGRATE </code> , in the event of a timeout error, should check if the key is <em> also </em> present in the target instance and act accordingly. </p> <p> When any other error is returned (starting with <code> ERR </code> ) <code> MIGRATE </code> guarantees that the key is still only present in the originating instance (unless a key with the same name was also <em> already </em> present on the target instance). </p> <p> If there are no keys to migrate in the source instance <code> NOKEY </code> is returned. Because missing keys are possible in normal conditions, from expiry for example, <code> NOKEY </code> isn't an error. </p> <h2 id="migrating-multiple-keys-with-a-single-command-call"> Migrating multiple keys with a single command call </h2> <p> Starting with Redis 3.0.6 <code> MIGRATE </code> supports a new bulk-migration mode that uses pipelining in order to migrate multiple keys between instances without incurring in the round trip time latency and other overheads that there are when moving each key with a single <code> MIGRATE </code> call. </p> <p> In order to enable this form, the <code> KEYS </code> option is used, and the normal <em> key </em> argument is set to an empty string. The actual key names will be provided after the <code> KEYS </code> argument itself, like in the following example: </p> <pre><code>MIGRATE 192.168.1.34 6379 "" 0 5000 KEYS key1 key2 key3 </code></pre> <p> When this form is used the <code> NOKEY </code> status code is only returned when none of the keys is present in the instance, otherwise the command is executed, even if just a single key exists. </p> <h2 id="options"> Options </h2> <ul> <li> <code> COPY </code> -- Do not remove the key from the local instance. </li> <li> <code> REPLACE </code> -- Replace existing key on the remote instance. </li> <li> <code> KEYS </code> -- If the key argument is an empty string, the command will instead migrate all the keys that follow the <code> KEYS </code> option (see the above section for more info). </li> <li> <code> AUTH </code> -- Authenticate with the given password to the remote instance. </li> <li> <code> AUTH2 </code> -- Authenticate with the given username and password pair (Redis 6 or greater ACL auth style). </li> </ul> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <p> One of the following: </p> <ul> <li> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> on success. </li> <li> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> NOKEY </code> when no keys were found in the source instance. </li> </ul> <br/> <h2> History </h2> <ul> <li> Starting with Redis version 3.0.0: Added the <code> COPY </code> and <code> REPLACE </code> options. </li> <li> Starting with Redis version 3.0.6: Added the <code> KEYS </code> option. </li> <li> Starting with Redis version 4.0.7: Added the <code> AUTH </code> option. </li> <li> Starting with Redis version 6.0.0: Added the <code> AUTH2 </code> option. </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/migrate/"/> <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.resp.html
<section class="prose w-full py-12"> <h1 class="command-name"> JSON.RESP <span class="text-base"> (deprecated) </span> </h1> <div class="border-l-8 pl-4"> <p> As of JSON version 2.6, this command is regarded as deprecated. </p> </div> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">JSON.RESP 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> Return the JSON in <code> key </code> in <a href="/docs/latest/develop/reference/protocol-spec/"> Redis serialization protocol specification </a> 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> . This command uses the following mapping from JSON to RESP: </p> <ul> <li> JSON <code> null </code> maps to the bulk string reply. </li> <li> JSON <code> false </code> and <code> true </code> values map to the simple string reply. </li> <li> JSON number maps to the integer reply or bulk string reply, depending on type. </li> <li> JSON string maps to the bulk string reply. </li> <li> JSON array is represented as an array reply in which the first element is the simple string reply <code> [ </code> , followed by the array's elements. </li> <li> JSON object is represented as an array reply in which the first element is the simple string reply <code> { </code> . Each successive entry represents a key-value pair as a two-entry array reply of the bulk string reply. </li> </ul> <p> For more information about replies, see <a href="/docs/latest/develop/reference/protocol-spec/"> Redis serialization protocol specification </a> . </p> </details> <h2 id="return"> Return </h2> <p> JSON.RESP returns an array reply specified as the JSON's RESP form detailed in <a href="/docs/latest/develop/reference/protocol-spec/"> Redis serialization protocol specification </a> . </p> <h2 id="examples"> Examples </h2> <details open=""> <summary> <b> Return an array of RESP details about a document </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 all RESP details about the document. </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis&gt; JSON.RESP item:2 </span></span><span class="line"><span class="cl"> 1<span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"name"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"Wireless earbuds"</span> </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"description"</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="s2">"Wireless Bluetooth in-ear headphones"</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"connection"</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> 1<span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"wireless"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="nb">true</span> </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"type"</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="s2">"Bluetooth"</span> </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="s2">"price"</span> </span></span><span class="line"><span class="cl"> 9<span class="o">)</span> <span class="s2">"64.989999999999995"</span> </span></span><span class="line"><span class="cl">10<span class="o">)</span> <span class="s2">"stock"</span> </span></span><span class="line"><span class="cl">11<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">17</span> </span></span><span class="line"><span class="cl">12<span class="o">)</span> <span class="s2">"colors"</span> </span></span><span class="line"><span class="cl">13<span class="o">)</span> 1<span class="o">)</span> <span class="o">[</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"black"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"white"</span> </span></span><span class="line"><span class="cl">14<span class="o">)</span> <span class="s2">"max_level"</span> </span></span><span class="line"><span class="cl">15<span class="o">)</span> 1<span class="o">)</span> <span class="o">[</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">80</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">100</span> </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">120</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.resp/"/> <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/cluster-set-config-epoch/.html
<section class="prose w-full py-12"> <h1 class="command-name"> CLUSTER SET-CONFIG-EPOCH </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CLUSTER SET-CONFIG-EPOCH config-epoch</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) </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> This command sets a specific <em> config epoch </em> in a fresh node. It only works when: </p> <ol> <li> The nodes table of the node is empty. </li> <li> The node current <em> config epoch </em> is zero. </li> </ol> <p> These prerequisites are needed since usually, manually altering the configuration epoch of a node is unsafe, we want to be sure that the node with the higher configuration epoch value (that is the last that failed over) wins over other nodes in claiming the hash slots ownership. </p> <p> However there is an exception to this rule, and it is when a new cluster is created from scratch. Redis Cluster <em> config epoch collision resolution </em> algorithm can deal with new nodes all configured with the same configuration at startup, but this process is slow and should be the exception, only to make sure that whatever happens, two more nodes eventually always move away from the state of having the same configuration epoch. </p> <p> So, using <code> CLUSTER SET-CONFIG-EPOCH </code> , when a new cluster is created, we can assign a different progressive configuration epoch to each node before joining the cluster together. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#simple-strings"> Simple string reply </a> : <code> OK </code> if the command was successful. 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/cluster-set-config-epoch/"/> <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/january-2023/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Cloud changelog (January 2023) </h1> <p class="text-lg -mt-5 mb-10"> New features, enhancements, and other changes added to Redis Cloud during January 2023. </p> <p> This changelog lists new features, enhancements, and other changes added to Redis Cloud during January 2023. </p> <h2 id="new-features-and-enhancements"> New features and enhancements </h2> <ul> <li> <p> <a href="/docs/latest/operate/rc/security/access-control/data-access-control/configure-acls/#pubsub-acl-rules"> Pub/sub ACLs </a> </p> </li> <li> <p> Add users with first name and last name </p> </li> <li> <p> Select multiple <a href="/docs/latest/operate/rc/databases/configuration/high-availability/#availability-zones"> availability zones </a> </p> </li> <li> <p> Additional enhancements </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/rc/changelog/2023/january-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/commands/tdigest.quantile.html
<section class="prose w-full py-12"> <h1 class="command-name"> TDIGEST.QUANTILE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">TDIGEST.QUANTILE key quantile [quantile ...]</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(N) where N is the number of quantiles specified. </dd> </dl> <p> Returns, for each input fraction, an estimation of the value (floating point) that is smaller than the given fraction of observations. </p> <p> Multiple quantiles can be retrieved in a single call. </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> <details open=""> <summary> <code> quantile </code> </summary> is the input fraction (between 0 and 1 inclusively) </details> <h2 id="return-value"> Return value </h2> <p> <a href="/docs/latest/develop/reference/protocol-spec/#arrays"> Array reply </a> - an array of estimates (floating-point) populated with value_1, value_2, ..., value_N. </p> <ul> <li> Return an accurate result when <code> quantile </code> is 0 (the value of the smallest observation) </li> <li> Return an accurate result when <code> quantile </code> is 1 (the value of the largest observation) </li> </ul> <p> All values are '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 COMPRESSION <span class="m">1000</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; TDIGEST.ADD t <span class="m">1</span> <span class="m">2</span> <span class="m">2</span> <span class="m">3</span> <span class="m">3</span> <span class="m">3</span> <span class="m">4</span> <span class="m">4</span> <span class="m">4</span> <span class="m">4</span> <span class="m">5</span> <span class="m">5</span> <span class="m">5</span> <span class="m">5</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.QUANTILE t <span class="m">0</span> 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 <span class="m">1</span> </span></span><span class="line"><span class="cl"> 1<span class="o">)</span> <span class="s2">"1"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"2"</span> </span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"3"</span> </span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"3"</span> </span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="s2">"4"</span> </span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"4"</span> </span></span><span class="line"><span class="cl"> 7<span class="o">)</span> <span class="s2">"4"</span> </span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="s2">"5"</span> </span></span><span class="line"><span class="cl"> 9<span class="o">)</span> <span class="s2">"5"</span> </span></span><span class="line"><span class="cl">10<span class="o">)</span> <span class="s2">"5"</span> </span></span><span class="line"><span class="cl">11<span class="o">)</span> <span class="s2">"5"</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.quantile/"/> <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/replace-node/.html
<section class="prose w-full py-12 max-w-none"> <h1> Replace a cluster node </h1> <p class="text-lg -mt-5 mb-10"> Replace a node in your cluster that is down. </p> <p> A failed node will appear as <code> Down </code> ( <a href="/docs/latest/images/rs/icons/node-down-icon.png#no-click" sdata-lightbox="/images/rs/icons/node-down-icon.png#no-click"> <img alt="Node down icon" class="inline" src="/docs/latest/images/rs/icons/node-down-icon.png#no-click"/> </a> ) in the <strong> Nodes </strong> list. </p> <p> To replace a failed node: </p> <ol> <li> <p> Prepare a new node identical to the old one. </p> </li> <li> <p> Install and configure Redis Enterprise Software on the node. See <a href="/docs/latest/operate/rs/7.4/installing-upgrading/"> Install and setup </a> for more information. </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 are using <a href="/docs/latest/operate/rs/7.4/databases/auto-tiering/"> Auto Tiering </a> , make sure the required flash storage is set up on this new node. </div> </div> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/clusters/add-node/"> Add the node </a> to the cluster. Make sure the new node has as much available memory as the faulty node. </p> <p> If the new node does not have enough memory, you will be prompted to add a node with enough memory. </p> </li> <li> <p> A message will appear informing you that the cluster has a faulty node and that the new node will replace the faulty node. </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> If there is a faulty node in the cluster to which you are adding a node, Redis Enterprise Software will use the new node to replace the faulty one. </li> <li> Any existing <a href="/docs/latest/operate/rs/7.4/networking/cluster-dns/"> DNS records </a> must be updated each time a node is added or replaced. </li> </ul> </div> </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/clusters/replace-node/"/> <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/modules/.html
<section class="prose w-full py-12 max-w-none"> <h1> Modules requests </h1> <p class="text-lg -mt-5 mb-10"> Redis modules requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#list-modules"> GET </a> </td> <td> <code> /v1/modules </code> </td> <td> List available modules </td> </tr> <tr> <td> <a href="#get-module"> GET </a> </td> <td> <code> /v1/modules/{uid} </code> </td> <td> Get a specific module </td> </tr> <tr> <td> <a href="#post-module"> POST </a> </td> <td> <code> /v1/modules </code> </td> <td> Upload a new module (deprecated) </td> </tr> <tr> <td> <a href="#post-module-v2"> POST </a> </td> <td> <code> /v2/modules </code> </td> <td> Upload a new module </td> </tr> <tr> <td> <a href="#delete-module"> DELETE </a> </td> <td> <code> /v1/modules/{uid} </code> </td> <td> Delete a module (deprecated) </td> </tr> <tr> <td> <a href="#delete-module-v2"> DELETE </a> </td> <td> <code> /v2/modules/{uid} </code> </td> <td> Delete a module </td> </tr> </tbody> </table> <h2 id="list-modules"> List modules </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/modules </span></span></code></pre> </div> <p> List available modules, i.e. modules stored within the CCS. </p> <h4 id="permissions"> 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_cluster_modules"> view_cluster_modules </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="list-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 /modules </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> 127.0.0.1:9443 </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> */* </td> <td> Accepted media type </td> </tr> </tbody> </table> <h3 id="list-response"> Response </h3> <p> Returns a JSON array of <a href="/docs/latest/operate/rs/references/rest-api/objects/module/"> module objects </a> . </p> <h4 id="list-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> </tbody> </table> <h2 id="get-module"> Get module </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/modules/<span class="o">{</span>string: uid<span class="o">}</span> </span></span></code></pre> </div> <p> Get specific available modules, i.e. modules stored within the CCS. </p> <h4 id="permissions-1"> 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_cluster_modules"> view_cluster_modules </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-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 /modules/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> 127.0.0.1:9443 </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> */* </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 module's unique ID. </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/references/rest-api/objects/module/"> module object </a> . </p> <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> Module does not exist. </td> </tr> </tbody> </table> <h2 id="post-module"> Upload module v1 </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/modules </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> <code> POST /v1/modules </code> is deprecated as of Redis Enterprise Software version 7.2. Use <a href="#post-module-v2"> <code> POST /v2/modules </code> </a> instead. </div> </div> <p> Uploads a new module to the cluster. </p> <p> The request must contain a Redis module, bundled using <a href="https://github.com/RedisLabs/RAMP"> RedisModule Packer </a> . For modules in Redis Stack, download the module from the <a href="https://redis.com/redis-enterprise-software/download-center/software/"> download center </a> . </p> <p> See <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster/#rest-api-method"> Install a module on a cluster </a> for more information. </p> <h4 id="permissions-2"> 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/#update_cluster"> update_cluster </a> </td> <td> admin </td> </tr> </tbody> </table> <h3 id="post-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">POST /v1/modules </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> string </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> */* </td> <td> Accepted media type </td> </tr> <tr> <td> Content-Length </td> <td> integer </td> <td> Length of the request body in octets </td> </tr> <tr> <td> Expect </td> <td> 100-continue </td> <td> Requires particular server behaviors </td> </tr> <tr> <td> Content-Type </td> <td> multipart/form-data </td> <td> Media type of request/response body </td> </tr> </tbody> </table> <h3 id="post-response"> Response </h3> <p> Returns a status code. If an error occurs, the response body may include an error code and message with more details. </p> <h4 id="post-error-codes"> Error codes </h4> <p> The server may return a JSON object with <code> error_code </code> and <code> message </code> fields that provide additional information. The following are possible <code> error_code </code> values: </p> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> no_module </td> <td> Module wasn't provided or could not be found </td> </tr> <tr> <td> invalid_module </td> <td> Module either corrupted or packaged files are wrong </td> </tr> <tr> <td> module_exists </td> <td> Module already in system </td> </tr> <tr> <td> min_redis_pack_version </td> <td> Module isn't supported yet in this Redis pack </td> </tr> <tr> <td> unsupported_module_capabilities </td> <td> The module does not support required capabilities </td> </tr> <tr> <td> os_not_supported </td> <td> This module is not supported for this operating system </td> </tr> <tr> <td> dependencies_not_supported </td> <td> This endpoint does not support dependencies, see v2 </td> </tr> </tbody> </table> <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.4.1"> 400 Bad Request </a> </td> <td> Either missing module file or an invalid module file. </td> </tr> </tbody> </table> <h3 id="examples"> Examples </h3> <h4 id="curl"> cURL </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ curl -k -u <span class="s2">"[username]:[password]"</span> -X POST </span></span><span class="line"><span class="cl"> -F <span class="s2">"module=@/tmp/rejson.Linux-ubuntu18.04-x86_64.2.0.8.zip"</span> </span></span><span class="line"><span class="cl"> https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/modules </span></span></code></pre> </div> <h4 id="python"> Python </h4> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><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></span><span class="line"><span class="cl"><span class="n">url</span> <span class="o">=</span> <span class="s2">"https://[host][:port]/v1/modules"</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">files</span><span class="o">=</span><span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="s1">'module'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="s1">'rejson.Linux-ubuntu18.04-x86_64.2.0.8.zip'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nb">open</span><span class="p">(</span><span class="s1">'/tmp/rejson.Linux-ubuntu18.04-x86_64.2.0.8.zip'</span><span class="p">,</span><span class="s1">'rb'</span><span class="p">),</span> </span></span><span class="line"><span class="cl"> <span class="s1">'application/zip'</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">auth</span><span class="o">=</span><span class="p">(</span><span class="s2">"[username]"</span><span class="p">,</span> <span class="s2">"[password]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </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">request</span><span class="p">(</span><span class="s2">"POST"</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">auth</span><span class="o">=</span><span class="n">auth</span><span class="p">,</span> <span class="n">files</span><span class="o">=</span><span class="n">files</span><span class="p">,</span> <span class="n">verify</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 class="nb">print</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> </span></span></code></pre> </div> <h2 id="post-module-v2"> Upload module v2 </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v2/modules </span></span></code></pre> </div> <p> Asynchronously uploads a new module to the cluster. </p> <p> The request must contain a Redis module bundled using <a href="https://github.com/RedisLabs/RAMP"> RedisModule Packer </a> . </p> <p> For modules in Redis Stack, download the module from the <a href="https://redis.com/redis-enterprise-software/download-center/software/"> download center </a> . See <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster/#rest-api-method"> Install a module on a cluster </a> for more information. </p> <h4 id="permissions-3"> 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/#update_cluster"> update_cluster </a> </td> <td> admin </td> </tr> </tbody> </table> <h3 id="post-request-v2"> 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 /v2/modules </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> string </td> <td> Domain name </td> </tr> <tr> <td> Accept </td> <td> */* </td> <td> Accepted media type </td> </tr> <tr> <td> Content-Length </td> <td> integer </td> <td> Length of the request body in octets </td> </tr> <tr> <td> Expect </td> <td> 100-continue </td> <td> Requires particular server behaviors </td> </tr> <tr> <td> Content-Type </td> <td> multipart/form-data; </td> <td> Media type of request/response body </td> </tr> </tbody> </table> <h3 id="post-response-v2"> Response </h3> <p> Returns a <a href="/docs/latest/operate/rs/references/rest-api/objects/module/"> module object </a> with an additional <code> action_uid </code> field. </p> <p> You can use the <code> action_uid </code> to track the progress of the module upload. </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">"action_uid"</span><span class="p">:</span><span class="s2">"dfc0152c-8449-4b1c-9184-480ea7cb526c"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"author"</span><span class="p">:</span><span class="s2">"RedisLabs"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"capabilities"</span><span class="p">:[</span> </span></span><span class="line"><span class="cl"> <span class="s2">"types"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"crdb"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"failover_migrate"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"persistence_aof"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"persistence_rdb"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"clustering"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"backup_restore"</span> </span></span><span class="line"><span class="cl"> <span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"command_line_args"</span><span class="p">:</span><span class="s2">"Plugin gears_python CreateVenv 1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"config_command"</span><span class="p">:</span><span class="s2">"RG.CONFIGSET"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"dependencies"</span><span class="p">:{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"gears_jvm"</span><span class="p">:{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"sha256"</span><span class="p">:</span><span class="s2">"b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"</span><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://example.com/redisgears_plugins/jvm_plugin/gears-jvm.linux-centos7-x64.0.1.0.tgz"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nt">"gears_python"</span><span class="p">:{</span> </span></span><span class="line"><span class="cl"> <span class="nt">"sha256"</span><span class="p">:</span><span class="s2">"22dca9cd75484cb15b8130db37f5284e22e3759002154361f72f6d2db46ee682"</span><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://example.com/redisgears-python.linux-centos7-x64.1.2.1.tgz"</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">"description"</span><span class="p">:</span><span class="s2">"Dynamic execution framework for your Redis data"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"display_name"</span><span class="p">:</span><span class="s2">"RedisGears"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"email"</span><span class="p">:</span><span class="s2">"[email protected]"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"homepage"</span><span class="p">:</span><span class="s2">"http://redisgears.io"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"is_bundled"</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">"license"</span><span class="p">:</span><span class="s2">"Redis Source Available License Agreement"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"min_redis_pack_version"</span><span class="p">:</span><span class="s2">"6.0.0"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"min_redis_version"</span><span class="p">:</span><span class="s2">"6.0.0"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"module_name"</span><span class="p">:</span><span class="s2">"rg"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"semantic_version"</span><span class="p">:</span><span class="s2">"1.2.1"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"sha256"</span><span class="p">:</span><span class="s2">"2935ea53611803c8acf0015253c5ae1cd81391bbacb23e14598841e1edd8d28b"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span><span class="s2">"98f255d5d33704c8e4e97897fd92e32d"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"version"</span><span class="p">:</span><span class="mi">10201</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h3 id="post-error-codes-v2"> Error codes </h3> <p> The server may return a JSON object with <code> error_code </code> and <code> message </code> fields that provide additional information. </p> <p> Possible <code> error_code </code> values include <a href="#post-error-codes"> <code> /v1/modules </code> error codes </a> and the following: </p> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> invalid_dependency_data </td> <td> Provided dependencies have an unexpected format </td> </tr> </tbody> </table> <h3 id="post-status-codes-v2"> 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> Success, scheduled module upload. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"> 400 Bad Request </a> </td> <td> Module name or version 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> Dependency not found. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> Failed to get dependency. </td> </tr> </tbody> </table> <h2 id="delete-module"> Delete module v1 </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /v1/modules/<span class="o">{</span>string: uid<span class="o">}</span> </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> <code> DELETE /v1/modules </code> is deprecated as of Redis Enterprise Software version 7.2. Use <a href="#delete-module-v2"> <code> DELETE /v2/modules </code> </a> instead. </div> </div> <p> Delete a module. </p> <h4 id="permissions-4"> 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/#update_cluster"> update_cluster </a> </td> <td> admin </td> </tr> </tbody> </table> <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 /v1/modules/1 </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> 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-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 module's unique ID. </td> </tr> </tbody> </table> <h3 id="delete-response"> Response </h3> <p> Returns a status code to indicate module deletion success or failure. </p> <h4 id="delete-error-codes"> Error codes </h4> <table> <thead> <tr> <th> Code </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> dependencies_not_supported </td> <td> You can use the following API endpoint to delete this module with its dependencies: <a href="#delete-module-v2"> <code> /v2/modules/&lt;uid&gt; </code> </a> </td> </tr> </tbody> </table> <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> Success, the module is 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> Attempting to delete a nonexistent module. </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 request is not acceptable. </td> </tr> </tbody> </table> <h2 id="delete-module-v2"> Delete module v2 </h2> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /v2/modules/<span class="o">{</span>string: uid<span class="o">}</span> </span></span></code></pre> </div> <p> Delete a module. </p> <h4 id="permissions-5"> 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/#update_cluster"> update_cluster </a> </td> <td> admin </td> </tr> </tbody> </table> <h3 id="delete-request-v2"> Request </h3> <h4 id="example-http-request-5"> Example HTTP request </h4> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /v2/modules/1 </span></span></code></pre> </div> <h4 id="headers-5"> 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-2"> 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 module's unique ID. </td> </tr> </tbody> </table> <h3 id="delete-response-v2"> Response </h3> <p> Returns a JSON object with an <code> action_uid </code> that allows you to track the progress of module deletion. </p> <h4 id="delete-status-codes-v2"> 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> Success, scheduled module deletion. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Attempting to delete a nonexistent module. </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/modules/"/> <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/asyncfilter/.html
<section class="prose w-full py-12 max-w-none"> <h1> AsyncFilter </h1> <p class="text-lg -mt-5 mb-10"> Asynchronously filters out records in the pipe based on a given condition. </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="n">GearsBuilder</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">asyncFilter</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">AsyncFilterOperation</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">filter</span><span class="o">)</span> </span></span></code></pre> </div> <p> The <code> asyncFilter </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 filter out records in the pipe based on a given condition. </p> <p> The filter operation should contain a conditional statement and return a boolean for each record: </p> <ul> <li> If <code> true </code> , the record will continue through the pipe. </li> <li> If <code> false </code> , it filters out the record. </li> </ul> <h2 id="parameters"> Parameters </h2> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> filter </td> <td> AsyncFilterOperation <t> </t> </td> <td> A function that checks a condition for each record in the pipe. Returns a boolean. </td> </tr> </tbody> </table> <h2 id="returns"> Returns </h2> <p> Returns a GearsBuilder object with the same template type as the input builder. </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 class="na">map</span><span class="o">(</span><span class="n">r</span><span class="o">-&gt;</span><span class="n">r</span><span class="o">.</span><span class="na">getKey</span><span class="o">()).</span> </span></span><span class="line"><span class="cl"> <span class="n">asyncFilter</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">Boolean</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">Boolean</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="n">r</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="s">"x"</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/asyncfilter/"/> <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/flushdb/.html
<section class="prose w-full py-12"> <h1 class="command-name"> FLUSHDB </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">FLUSHDB [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"> 1.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 keys in the selected database </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> Delete all the keys of the currently selected DB. This command never fails. </p> <p> By default, <code> FLUSHDB </code> will synchronously flush all keys from the database. 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 database asynchronously </li> <li> <code> SYNC </code> : flushes the database synchronously </li> </ul> <h2 id="notes"> Notes </h2> <ul> <li> An asynchronous <code> FLUSHDB </code> command only deletes keys that were present at the time the command was invoked. Keys created during an asynchronous flush will be unaffected. </li> <li> This command does not delete functions. </li> </ul> <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 4.0.0: Added the <code> ASYNC </code> flushing mode modifier. </li> <li> Starting with Redis version 6.2.0: Added the <code> SYNC </code> flushing mode modifier. </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/flushdb/"/> <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/flush/.html
<section class="prose w-full py-12 max-w-none"> <h1> Flush database data </h1> <p class="text-lg -mt-5 mb-10"> 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> <p> To delete the data in a database without deleting the database configuration, you can flush the data from the database. </p> <p> You can use the Cluster Manager UI to flush data from Active-Active databases. </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> The flush command deletes ALL in-memory and persistence data in the database. We recommend that you <a href="/docs/latest/operate/rs/databases/import-export/schedule-backups/"> back up your database </a> before you flush the data. </div> </div> <h2 id="flush-data-from-a-database"> Flush data from a database </h2> <p> From the command line, you can flush a database with the redis-cli command or with your favorite Redis client. </p> <p> To flush data from a database with the redis-cli, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">redis-cli -h &lt;hostname&gt; -p &lt;portnumber&gt; -a &lt;password&gt; flushall </span></span></code></pre> </div> <p> Example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">redis-cli -h redis-12345.cluster.local -p <span class="m">9443</span> -a xyz flushall </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> Port 9443 is the default <a href="/docs/latest/operate/rs/networking/port-configurations/#https://docs.redis.com/latest/rs/networking/port-configurations#ports-and-port-ranges-used-by-redis-enterprise-software"> port configuration </a> . </div> </div> <h2 id="flush-data-from-an-active-active-database"> Flush data from an Active-Active database </h2> <p> When you flush an Active-Active database (formerly known as CRDB), all of the replicas flush their data at the same time. </p> <p> To flush data from an Active-Active database, use one of the following methods: </p> <ul> <li> <p> Cluster Manager UI </p> <ol> <li> <p> On the <strong> Databases </strong> screen, select the database from the list, then click <strong> Configuration </strong> . </p> </li> <li> <p> Click <a href="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" sdata-lightbox="/images/rs/buttons/button-toggle-actions-vertical.png#no-click"> <img alt="Toggle actions button" class="inline" src="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" width="22px"/> </a> to open a list of additional actions. </p> </li> <li> <p> Select <strong> Flush database </strong> . </p> </li> <li> <p> Enter the name of the Active-Active database to confirm that you want to flush the data. </p> </li> <li> <p> Click <strong> Flush </strong> . </p> </li> </ol> </li> <li> <p> Command line </p> <ol> <li> <p> To find the ID of the Active-Active database, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb list </span></span></code></pre> </div> <p> For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ crdb-cli crdb list </span></span><span class="line"><span class="cl">CRDB-GUID NAME REPL-ID CLUSTER-FQDN </span></span><span class="line"><span class="cl">a16fe643-4a7b-4380-a5b2-96109d2e8bca crdb1 <span class="m">1</span> cluster1.local </span></span><span class="line"><span class="cl">a16fe643-4a7b-4380-a5b2-96109d2e8bca crdb1 <span class="m">2</span> cluster2.local </span></span><span class="line"><span class="cl">a16fe643-4a7b-4380-a5b2-96109d2e8bca crdb1 <span class="m">3</span> cluster3.local </span></span></code></pre> </div> </li> <li> <p> To flush the Active-Active database, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb flush --crdb-guid &lt;CRDB-GUID&gt; </span></span></code></pre> </div> <p> The command output contains the task ID of the flush task, for example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ crdb-cli crdb flush --crdb-guid a16fe643-4a7b-4380-a5b2-96109d2e8bca </span></span><span class="line"><span class="cl">Task 63239280-d060-4639-9bba-fc6a242c19fc created </span></span><span class="line"><span class="cl">---&gt; Status changed: queued -&gt; started </span></span></code></pre> </div> </li> <li> <p> To check the status of the flush task, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli task status --task-id &lt;Task-ID&gt; </span></span></code></pre> </div> <p> For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ crdb-cli task status --task-id 63239280-d060-4639-9bba-fc6a242c19fc </span></span><span class="line"><span class="cl">Task-ID: 63239280-d060-4639-9bba-fc6a242c19fc </span></span><span class="line"><span class="cl">CRDB-GUID: - </span></span><span class="line"><span class="cl">Status: finished </span></span></code></pre> </div> </li> </ol> </li> <li> <p> REST API </p> <ol> <li> <p> To find the ID of the Active-Active database, use <a href="/docs/latest/operate/rs/references/rest-api/requests/crdbs/#get-all-crdbs"> <code> GET /v1/crdbs </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/crdbs </span></span></code></pre> </div> </li> <li> <p> To flush the Active-Active database, use <a href="/docs/latest/operate/rs/references/rest-api/requests/crdbs/flush/#put-crdbs-flush"> <code> PUT /v1/crdbs/{guid}/flush </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/crdbs/&lt;guid&gt;/flush </span></span></code></pre> </div> <p> The command output contains the task ID of the flush task. </p> </li> <li> <p> To check the status of the flush task, use <a href="/docs/latest/operate/rs/references/rest-api/requests/crdb_tasks/#get-crdb_task"> <code> GET /v1/crdb_tasks </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/crdb_tasks/&lt;task-id&gt; </span></span></code></pre> </div> </li> </ol> </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/databases/import-export/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/rc/databases/monitor-performance/.html
<section class="prose w-full py-12 max-w-none"> <h1> Monitor database performance </h1> <p> Redis Cloud provides a variety of metrics to help you monitor database performance. You can view graphs of performance data at any time and receive emails when performance crosses defined thresholds. </p> <h2 id="view-database-metrics"> View database metrics </h2> <p> The <strong> Metrics </strong> tab of the <strong> View Database </strong> screen provides a series of graphs showing performance data for your database. </p> <a href="/docs/latest/images/rc/database-metrics-tab.png" sdata-lightbox="/images/rc/database-metrics-tab.png"> <img alt="The Metrics tab of the View Database screen." src="/docs/latest/images/rc/database-metrics-tab.png" width="75%"/> </a> <p> Performance data provides insight into how your database is being used and how well it is performing. </p> <p> The interval scrollbar controls the time period displayed in the graphs. </p> <a href="/docs/latest/images/rc/database-metrics-interval-scrollbar.png" sdata-lightbox="/images/rc/database-metrics-interval-scrollbar.png"> <img alt="The Metrics tab of the View Database screen." src="/docs/latest/images/rc/database-metrics-interval-scrollbar.png" width="75%"/> </a> <h2 id="promote-metric-graphs"> Promote metric graphs </h2> <p> The <strong> Metrics </strong> screen shows two primary graphs and a collection of smaller ones. You can promote any smaller graph to a primary position. </p> <p> When you use the mouse to point to a smaller graph, three things appear: </p> <ul> <li> A promotion icon pointing left </li> <li> A promotion icon pointing right </li> <li> A summary panel showing the minimum, average, maximum, and most recent values displayed in the graph. </li> </ul> <a href="/docs/latest/images/rc/metrics-promote-graphs.png" sdata-lightbox="/images/rc/metrics-promote-graphs.png"> <img alt="Promoting graphs to primary positions" src="/docs/latest/images/rc/metrics-promote-graphs.png" width="50%"/> </a> <p> Use the promotion icons to promote the smaller graph to one of the primary positions. The left icon promotes the smaller graph to the left position and the right icon promotes the smaller graph to the right position. </p> <h2 id="metric-definitions"> Metric definitions </h2> <p> Several metric graphs are available: </p> <table> <thead> <tr> <th> <strong> Metric </strong> </th> <th> <strong> Description </strong> </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#opssec"> Ops/sec </a> </td> <td> The number of overall operations per sec for all Redis commands </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#readssec"> Reads/sec </a> </td> <td> The number of read operations per second </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#writessec"> Writes/sec </a> </td> <td> The number of write operations per second </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#other-commandssec"> Other cmds/sec </a> </td> <td> The number of other Redis commands per second </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#latency"> Latency </a> </td> <td> Latency per operation, in milliseconds </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#reads-latency"> Reads latency </a> </td> <td> Latency per read operation, in milliseconds </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#writes-latency"> Writes latency </a> </td> <td> Latency per write operation, in milliseconds </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#other-commands-latency"> Other latency </a> </td> <td> Latency of other commands, in milliseconds </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/resource-usage/#used-memory"> Used memory </a> </td> <td> Amount of memory used by the database </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#total-keys"> Total keys </a> </td> <td> Total number of keys in the database </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/resource-usage/#connections"> Connections </a> </td> <td> Total number of connections to the endpoint </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#evicted-objectssec"> Evicted objects/sec </a> </td> <td> Number of objects evicted from the database per second. </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#expired-objectssec"> Expired objects/sec </a> </td> <td> Number of expired objects per second. An expired object is an object with expired TTL that was deleted from the database. </td> </tr> <tr> <td> <a href="/docs/latest/operate/rs/references/metrics/database-operations/#hit-ratio"> Hit ratio </a> </td> <td> Percent of operations on existing keys out of the total number database operations </td> </tr> </tbody> </table> <p> For more detailed analysis, consider using <a href="/docs/latest/develop/tools/insight/"> Redis Insight </a> or <a href="/docs/latest/integrate/prometheus-with-redis-cloud/"> Prometheus and Grafana </a> . </p> <h2 id="configure-metric-alerts"> Configure metric alerts </h2> <p> Depending on your subscription plan, you can enable alerts for several metrics for a given database. </p> <p> To do so, go to the <strong> Configuration </strong> tab of the database and then locate the <strong> Alerts </strong> section. For details, including a breakdown of alerts available for each subscription type, see <a href="/docs/latest/operate/rc/databases/view-edit-database/#alerts-section"> Alerts section </a> . </p> <p> Alert settings are specific to a given database. To receive alerts for multiple databases, make sure each is configured accordingly. </p> <h2 id="change-alert-recipients"> Change alert recipients </h2> <p> Any member of the account team can receive alert emails. </p> <p> To update alert settings for one or more team members, select <strong> Access Management </strong> from the Redis Cloud console menu and then select the <strong> Team </strong> tab. For details, see <a href="/docs/latest/operate/rc/security/access-control/access-management/"> Access management </a> . </p> <p> If you subscribe to Redis Cloud through a Platform-as-a-Service (PaaS) provider (such as Heroku), you will need to review your provider's documentation for help managing your team. </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/databases/monitor-performance/"/> <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/databases/active-active/connect/.html
<section class="prose w-full py-12 max-w-none"> <h1> Connect to your Active-Active databases </h1> <p class="text-lg -mt-5 mb-10"> How to connect to an Active-Active database using redis-cli or a sample Python application. </p> <p> With the Redis database created, you are ready to connect to your database to store data. You can use one of the following ways to test connectivity to your database: </p> <ul> <li> Connect with redis-cli, the built-in command-line tool </li> <li> Connect with a <em> Hello World </em> application written in Python </li> </ul> <p> Remember we have two member Active-Active databases that are available for connections and concurrent reads and writes. The member Active-Active databases are using bi-directional replication to for the global Active-Active database. </p> <a href="/docs/latest/images/rs/crdb-diagram.png" sdata-lightbox="/images/rs/crdb-diagram.png"> <img src="/docs/latest/images/rs/crdb-diagram.png"/> </a> <h3 id="connecting-using-rediscli"> Connecting using redis-cli </h3> <p> redis-cli is a simple command-line tool to interact with redis database. </p> <ol> <li> <p> To use redis-cli on port 12000 from the node 1 terminal, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">redis-cli -p <span class="m">12000</span> </span></span></code></pre> </div> </li> <li> <p> Store and retrieve a key in the database to test the connection with these commands: </p> <ul> <li> <code> set key1 123 </code> </li> <li> <code> get key1 </code> </li> </ul> <p> The output of the command looks like this: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">127.0.0.1:12000&gt; <span class="nb">set</span> key1 <span class="m">123</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">127.0.0.1:12000&gt; get key1 </span></span><span class="line"><span class="cl"><span class="s2">"123"</span> </span></span></code></pre> </div> </li> <li> <p> Enter the terminal of node 1 in cluster 2, run the redis-cli, and retrieve key1. </p> <p> The output of the commands looks like this: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ redis-cli -p <span class="m">12000</span> </span></span><span class="line"><span class="cl">127.0.0.1:12000&gt; get key1 </span></span><span class="line"><span class="cl"><span class="s2">"123"</span> </span></span></code></pre> </div> </li> </ol> <h3 id="connecting-using-_hello-world_-application-in-python"> Connecting using <em> Hello World </em> application in Python </h3> <p> A simple python application running on the host machine can also connect to the 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> Before you continue, you must have python and <a href="https://github.com/andymccurdy/redis-py#installation"> redis-py </a> (python library for connecting to Redis) configured on the host machine running the container. </div> </div> <ol> <li> <p> In the command-line terminal, create a new file called "redis_test.py" </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">vi redis_test.py </span></span></code></pre> </div> </li> <li> <p> Paste this code into the "redis_test.py" file. </p> <p> This application stores a value in key1 in cluster 1, gets that value from key1 in cluster 1, and gets the value from key1 in cluster 2. </p> <div class="highlight"> <pre class="chroma"><code class="language-py" data-lang="py"><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="n">rp1</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">StrictRedis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s1">'localhost'</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">12000</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">rp2</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">StrictRedis</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s1">'localhost'</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">12002</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span> <span class="p">(</span><span class="s2">"set key1 123 in cluster 1"</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">rp1</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">'key1'</span><span class="p">,</span> <span class="s1">'123'</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span> <span class="p">(</span><span class="s2">"get key1 cluster 1"</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">rp1</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'key1'</span><span class="p">))</span> </span></span><span class="line"><span class="cl"><span class="nb">print</span> <span class="p">(</span><span class="s2">"get key1 from cluster 2"</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">rp2</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'key1'</span><span class="p">))</span> </span></span></code></pre> </div> </li> <li> <p> To run the "redis_test.py" application, run: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">python redis_test.py </span></span></code></pre> </div> <p> If the connection is successful, the output of the application looks like: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="nb">set</span> key1 <span class="m">123</span> in cluster <span class="m">1</span> </span></span><span class="line"><span class="cl">True </span></span><span class="line"><span class="cl">get key1 cluster <span class="m">1</span> </span></span><span class="line"><span class="cl"><span class="s2">"123"</span> </span></span><span class="line"><span class="cl">get key1 from cluster <span class="m">2</span> </span></span><span class="line"><span class="cl"><span class="s2">"123"</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/databases/active-active/connect/"/> <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/quickstart/write-behind-guide/.html
<section class="prose w-full py-12 max-w-none"> <h1> Quickstart </h1> <p class="text-lg -mt-5 mb-10"> Get started creating a write-behind pipeline </p> <p> This guide takes you through the creation of a write-behind pipeline. </p> <h2 id="concepts"> Concepts </h2> <p> <strong> Write-behind </strong> is a processing pipeline used to synchronize data in a Redis database with a downstream data store. You can think about it as a pipeline that starts with change data capture (CDC) events for a Redis database and then filters, transforms, and maps the data to the target data store data structures. </p> <p> The <strong> target </strong> data store to which the write-behind pipeline connects and writes data. </p> <p> The write-behind pipeline is composed of one or more <strong> jobs </strong> . Each job is responsible for capturing change for one key pattern in Redis and mapping it to one or more tables in the downstream data store. Each job is defined in a YAML file. </p> <a href="/docs/latest/images/rdi/redis-di-write-behind.png" sdata-lightbox="/images/rdi/redis-di-write-behind.png"> <img src="/docs/latest/images/rdi/redis-di-write-behind.png"/> </a> <h2 id="supported-data-stores"> Supported data stores </h2> <p> Write-behind currently supports these target data stores: </p> <table> <thead> <tr> <th> Data Store </th> </tr> </thead> <tbody> <tr> <td> Cassandra </td> </tr> <tr> <td> MariaDB </td> </tr> <tr> <td> MySQL </td> </tr> <tr> <td> Oracle </td> </tr> <tr> <td> PostgreSQL </td> </tr> <tr> <td> Redis Enterprise </td> </tr> <tr> <td> SQL Server </td> </tr> </tbody> </table> <h2 id="prerequisites"> Prerequisites </h2> <p> The only prerequisite for running Write-behind is <a href="https://redis.com/modules/redis-gears/"> Redis Gears Python </a> &gt;= 1.2.6 installed on the Redis Enterprise Cluster and enabled for the database you want to mirror to the downstream data store. For more information, see <a href="/docs/latest/integrate/write-behind/installation/install-redis-gears/"> RedisGears installation </a> . </p> <h2 id="preparing-the-write-behind-pipeline"> Preparing the write-behind pipeline </h2> <ul> <li> <p> Install <a href="/docs/latest/integrate/write-behind/installation/install-rdi-cli/"> Write-behind CLI </a> on a Linux host that has connectivity to your Redis Enterprise Cluster. </p> </li> <li> <p> Run the <a href="/docs/latest/integrate/write-behind/reference/cli/redis-di-configure/"> <code> configure </code> </a> command to install the Write-behind Engine on your Redis database, if you have not used this Redis database with Write-behind before. </p> </li> <li> <p> Run the <a href="/docs/latest/integrate/write-behind/reference/cli/redis-di-scaffold/"> <code> scaffold </code> </a> command with the type of data store you want to use, for example: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di scaffold --strategy write_behind --dir . --db-type mysql </span></span></code></pre> </div> <p> This creates a template <code> config.yaml </code> file and a folder named <code> jobs </code> under the current directory. You can specify any folder name with <code> --dir </code> or use the <code> --preview config.yaml </code> option, if your Write-behind CLI is deployed inside a Kubernetes (K8s) pod, to get the <code> config.yaml </code> template to the terminal. </p> </li> <li> <p> Add the connections required for downstream targets in the <code> connections </code> section of <code> config.yaml </code> , for example: </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">connections</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">my-postgres</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">postgresql</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="m">172.17.0.3</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">port</span><span class="p">:</span><span class="w"> </span><span class="m">5432</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">database</span><span class="p">:</span><span class="w"> </span><span class="l">postgres</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">user</span><span class="p">:</span><span class="w"> </span><span class="l">postgres</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">password</span><span class="p">:</span><span class="w"> </span><span class="l">postgres</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c">#query_args:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c"># sslmode: verify-ca</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c"># sslrootcert: /opt/work/ssl/ca.crt</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c"># sslkey: /opt/work/ssl/client.key</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c"># sslcert: /opt/work/ssl/client.crt</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">my-mysql</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">mysql</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="m">172.17.0.4</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">port</span><span class="p">:</span><span class="w"> </span><span class="m">3306</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">database</span><span class="p">:</span><span class="w"> </span><span class="l">test</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">user</span><span class="p">:</span><span class="w"> </span><span class="l">test</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">password</span><span class="p">:</span><span class="w"> </span><span class="l">test</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c">#connect_args:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c"># ssl_ca: /opt/ssl/ca.crt</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c"># ssl_cert: /opt/ssl/client.crt</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="c"># ssl_key: /opt/ssl/client.key</span><span class="w"> </span></span></span></code></pre> </div> <p> This is the first section of the <code> config.yaml </code> file and typically the only one you'll need to edit. The <code> connections </code> section is designed to have many target connections. In the previous example, there are two downstream connections named <code> my-postgres </code> and <code> my-mysql </code> . </p> <p> To obtain a secured connection using TLS, you can add more <code> connect_args </code> or <code> query_args </code> , depending on the specific target database terminology, to the connection definition. </p> <p> The name can be any arbitrary name as long as it is: </p> <ul> <li> Unique for this Write-behind engine </li> <li> Referenced correctly by the jobs in the respective YAML files </li> </ul> </li> </ul> <p> In order to prepare the pipeline, fill in the correct information for the target data store. Secrets can be provided using a reference to a secret ( <a href="#how-to-provide-targets-secrets"> see below </a> ) or by specifying a path. </p> <p> The <code> applier </code> section has information about the batch size and frequency used to write data to the target. </p> <p> Some of the <code> applier </code> attributes such as <code> target_data_type </code> , <code> wait_enabled </code> , and <code> retry_on_replica_failure </code> are specific for the Write-behind ingest pipeline and can be ignored. </p> <h3 id="write-behind-jobs"> Write-behind jobs </h3> <p> Write-behind jobs are a mandatory part of the write-behind pipeline configuration. Under the <code> jobs </code> directory (parallel to <code> config.yaml </code> ) you should have a job definition in a YAML file for every key pattern you want to write to a downstream database table. </p> <p> The YAML file can be named using the destination table name or another naming convention, but it has to have a unique name. </p> <p> Job definition has the following structure: </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">source</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">redis</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">key_pattern</span><span class="p">:</span><span class="w"> </span><span class="l">emp:*</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">trigger</span><span class="p">:</span><span class="w"> </span><span class="l">write-behind</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">exclude_commands</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"json.del"</span><span class="p">]</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">transform</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">rename_field</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">from_field</span><span class="p">:</span><span class="w"> </span><span class="l">after.country</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">to_field</span><span class="p">:</span><span class="w"> </span><span class="l">after.my_country</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">output</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">relational.write</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">connection</span><span class="p">:</span><span class="w"> </span><span class="l">my-connection</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">schema</span><span class="p">:</span><span class="w"> </span><span class="l">my-schema</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">my-table</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">keys</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">first_name</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">last_name</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">mapping</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">first_name</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">last_name</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">address</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">gender</span><span class="w"> </span></span></span></code></pre> </div> <h3 id="source-section"> Source section </h3> <p> The <code> source </code> section describes the source of data in the pipeline. </p> <p> The <code> redis </code> section is common for every pipeline initiated by an event in Redis, such as applying changes to data. In the case of write-behind, it has the information required to activate a pipeline dealing with changes to data. It includes the following attributes: </p> <ul> <li> <p> The <code> key_pattern </code> attribute specifies the pattern of Redis keys to listen on. The pattern must correspond to keys that are of Hash or JSON type. </p> </li> <li> <p> The <code> exclude_commands </code> attribute specifies which commands to ignore. For example, if you listen on a key pattern with Hash values, you can exclude the <code> HDEL </code> command so no data deletions will propagate to the downstream database. If you don't specify this attribute, Write-behind acts on all relevant commands. </p> </li> <li> <p> The <code> trigger </code> attribute is mandatory and must be set to <code> write-behind </code> . </p> </li> <li> <p> The <code> row_format </code> attribute can be used with the value <code> full </code> to receive both the <code> before </code> and <code> after </code> sections of the payload. Note that for write-behind events the <code> before </code> value of the key is never provided. </p> </li> </ul> <blockquote> <p> Note: Write-behind does not support the <a href="/docs/latest/develop/use/keyspace-notifications/#events-generated-by-different-commands"> <code> expired </code> </a> event. Therefore, keys that are expired in Redis will not be deleted from the target database automatically. Notes: The <code> redis </code> attribute is a breaking change replacing the <code> keyspace </code> attribute. The <code> key_pattern </code> attribute replaces the <code> pattern </code> attribute. The <code> exclude_commands </code> attributes replaces the <code> exclude-commands </code> attribute. If you upgrade to version 0.105 and beyond, you must edit your existing jobs and redeploy them. </p> </blockquote> <h3 id="output-section"> Output section </h3> <p> The <code> output </code> section is critical. It specifies a reference to a connection from the <code> config.yaml </code> <code> connections </code> section: </p> <ul> <li> <p> The <code> uses </code> attribute specifies the type of <strong> writer </strong> Write-behind will use to prepare and write the data to the target. In this example, it is <code> relational.write </code> , a writer that translates the data into a SQL statement with the specific dialect of the downstream relational database. For a full list of supported writers, see <a href="/docs/latest/integrate/write-behind/reference/data-transformation-block-types/"> data transformation block types </a> . </p> </li> <li> <p> The <code> schema </code> attribute specifies the schema/database to use (different database have different names for schema in the object hierarchy). </p> </li> <li> <p> The <code> table </code> attribute specifies the downstream table to use. </p> </li> <li> <p> The <code> keys </code> section specifies the field(s) in the table that are the unique constraints in that table. </p> </li> <li> <p> The <code> mapping </code> section is used to map database columns to Redis fields with different names or to expressions. The mapping can be all Redis data fields or a subset of them. </p> </li> </ul> <blockquote> <p> Note: The columns used in <code> keys </code> will be automatically included, so there's no need to repeat them in the <code> mapping </code> section. </p> </blockquote> <h3 id="apply-filters-and-transformations-to-write-behind"> Apply filters and transformations to write-behind </h3> <p> The Write-behind jobs can apply filters and transformations to the data before it is written to the target. Specify the filters and transformations under the <code> transform </code> section. </p> <h4 id="filters"> Filters </h4> <p> Use filters to skip some of the data and not apply it to target. Filters can apply simple or complex expressions that take as arguments the Redis entry key, fields, and even the change op code (create, delete, update, etc.). See <a href="/docs/latest/integrate/write-behind/reference/data-transformation-block-types/filter/"> Filter </a> for more information. </p> <h4 id="transformations"> Transformations </h4> <p> Transformations manipulate the data in one of the following ways: </p> <ul> <li> Renaming a field </li> <li> Adding a field </li> <li> Removing a field </li> <li> Mapping source fields to use in output </li> </ul> <p> To learn more about transformations, see <a href="/docs/latest/integrate/write-behind/data-transformation/data-transformation-pipeline/"> data transformation pipeline </a> . </p> <h2 id="provide-targets-secrets"> Provide target's secrets </h2> <p> The target's secrets (such as TLS certificates) can be read from a path on the Redis node's file system. This allows the consumption of secrets injected from secret stores. </p> <h2 id="deploy-the-write-behind-pipeline"> Deploy the write-behind pipeline </h2> <p> To start the pipeline, run the <a href="/docs/latest/integrate/write-behind/reference/cli/redis-di-deploy/"> <code> deploy </code> </a> command: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di deploy </span></span></code></pre> </div> <p> You can check that the pipeline is running, receiving, and writing data using the <a href="/docs/latest/integrate/write-behind/reference/cli/redis-di-status/"> <code> status </code> </a> command: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di status </span></span></code></pre> </div> <h2 id="monitor-the-write-behind-pipeline"> Monitor the write-behind pipeline </h2> <p> The Write-behind pipeline collects the following metrics: </p> <table> <thead> <tr> <th> Metric Description </th> <th> Metric in <a href="https://prometheus.io/"> Prometheus </a> </th> </tr> </thead> <tbody> <tr> <td> Total incoming events by stream </td> <td> Calculated as a Prometheus DB query: <code> sum(pending, rejected, filtered, inserted, updated, deleted) </code> </td> </tr> <tr> <td> Created incoming events by stream </td> <td> <code> rdi_metrics_incoming_entries{data_source:"…",operation="inserted"} </code> </td> </tr> <tr> <td> Updated incoming events by stream </td> <td> <code> rdi_metrics_incoming_entries{data_source:"…",operation="updated"} </code> </td> </tr> <tr> <td> Deleted incoming events by stream </td> <td> <code> rdi_metrics_incoming_entries{data_source:"…",operation="deleted"} </code> </td> </tr> <tr> <td> Filtered incoming events by stream </td> <td> <code> rdi_metrics_incoming_entries{data_source:"…",operation="filtered"} </code> </td> </tr> <tr> <td> Malformed incoming events by stream </td> <td> <code> rdi_metrics_incoming_entries{data_source:"…",operation="rejected"} </code> </td> </tr> <tr> <td> Total events per stream (snapshot) </td> <td> <code> rdi_metrics_stream_size{data_source:""} </code> </td> </tr> <tr> <td> Time in stream (snapshot) </td> <td> <code> rdi_metrics_stream_last_latency_ms{data_source:"…"} </code> </td> </tr> </tbody> </table> <p> To use the metrics you can either: </p> <ul> <li> <p> Run the <a href="/docs/latest/integrate/write-behind/reference/cli/redis-di-status/"> <code> status </code> </a> command: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di status </span></span></code></pre> </div> </li> <li> <p> Scrape the metrics using Write-behind's Prometheus exporter </p> </li> </ul> <h2 id="upgrading"> Upgrading </h2> <p> If you need to upgrade Write-behind, you should use the <a href="/docs/latest/integrate/write-behind/reference/cli/redis-di-upgrade/"> <code> upgrade </code> </a> command that provides for a zero downtime upgrade: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di upgrade ... </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/integrate/write-behind/quickstart/write-behind-guide/"/> <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/cluster_settings/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster settings object </h1> <p class="text-lg -mt-5 mb-10"> An object for cluster resource management settings </p> <p> Cluster resources management policy </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> acl_pubsub_default </td> <td> <code> resetchannels </code> <br/> <code> allchannels </code> </td> <td> Default pub/sub ACL rule for all databases in the cluster: <br/> • <code> resetchannels </code> blocks access to all channels (restrictive) <br/> • <code> allchannels </code> allows access to all channels (permissive) </td> </tr> <tr> <td> auto_recovery </td> <td> boolean (default: false) </td> <td> Defines whether to use automatic recovery after shard failure </td> </tr> <tr> <td> automatic_node_offload </td> <td> boolean (default: true) </td> <td> Defines whether the cluster will automatically migrate shards from a node, in case the node is overbooked </td> </tr> <tr> <td> bigstore_migrate_node_threshold </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before automatic migration of shards from it to free more memory </td> </tr> <tr> <td> bigstore_migrate_node_threshold_p </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before automatic migration of shards from it to free more memory </td> </tr> <tr> <td> bigstore_provision_node_threshold </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before new shards can no longer be added to it </td> </tr> <tr> <td> bigstore_provision_node_threshold_p </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before new shards can no longer be added to it </td> </tr> <tr> <td> data_internode_encryption </td> <td> boolean </td> <td> Enable/deactivate encryption of the data plane internode communication </td> </tr> <tr> <td> db_conns_auditing </td> <td> boolean </td> <td> <a href="/docs/latest/operate/rs/security/audit-events/"> Audit connections </a> for new databases by default if set to true. </td> </tr> <tr> <td> default_concurrent_restore_actions </td> <td> integer </td> <td> Default number of restore actions allowed at the same time. Set to 0 to allow any number of simultaneous restore actions. </td> </tr> <tr> <td> default_fork_evict_ram </td> <td> boolean </td> <td> If true, the bdbs should evict data from RAM to ensure successful replication or persistence </td> </tr> <tr> <td> default_non_sharded_proxy_policy </td> <td> <code> single </code> <br/> <br/> <code> all-master-shards </code> <br/> <br/> <code> all-nodes </code> </td> <td> Default proxy_policy for newly created non-sharded databases' endpoints </td> </tr> <tr> <td> default_oss_sharding </td> <td> boolean (default: false) </td> <td> Default hashing policy to use for new databases. This field is for future use only and should not be changed. </td> </tr> <tr> <td> default_provisioned_redis_version </td> <td> string </td> <td> Default Redis version </td> </tr> <tr> <td> default_sharded_proxy_policy </td> <td> <code> single </code> <br/> <br/> <code> all-master-shards </code> <br/> <br/> <code> all-nodes </code> </td> <td> Default proxy_policy for newly created sharded databases' endpoints </td> </tr> <tr> <td> default_shards_placement </td> <td> <code> dense </code> <br/> <code> sparse </code> </td> <td> Default shards_placement for a newly created databases </td> </tr> <tr> <td> default_tracking_table_max_keys_policy </td> <td> integer (default: 1000000) </td> <td> Defines the default value of the client-side caching invalidation table size for new databases. 0 makes the cache unlimited. </td> </tr> <tr> <td> endpoint_rebind_propagation_grace_time </td> <td> integer </td> <td> Time to wait between the addition and removal of a proxy </td> </tr> <tr> <td> failure_detection_sensitivity </td> <td> <code> high </code> <br/> <code> low </code> </td> <td> Predefined thresholds and timeouts for failure detection (previously known as <span class="break-all"> <code> watchdog_profile </code> </span> ) <br/> • <code> high </code> (previously <code> local-network </code> ) – high failure detection sensitivity, lower thresholds, faster failure detection and failover <br/> • <code> low </code> (previously <code> cloud </code> ) – low failure detection sensitivity, higher tolerance for latency variance (also called network jitter) </td> </tr> <tr> <td> hide_user_data_from_log </td> <td> boolean (default: false) </td> <td> Set to <code> true </code> to enable the <code> hide-user-data-from-log </code> Redis configuration setting, which avoids logging user data </td> </tr> <tr> <td> login_lockout_counter_reset_after </td> <td> integer </td> <td> Number of seconds that must elapse between failed sign in attempts before the lockout counter is reset to 0. </td> </tr> <tr> <td> login_lockout_duration </td> <td> integer </td> <td> Duration (in secs) of account lockout. If set to 0, the account lockout will persist until released by an admin. </td> </tr> <tr> <td> login_lockout_threshold </td> <td> integer </td> <td> Number of failed sign in attempts allowed before locking a user account </td> </tr> <tr> <td> max_saved_events_per_type </td> <td> integer </td> <td> Maximum saved events per event type </td> </tr> <tr> <td> max_simultaneous_backups </td> <td> integer (default: 4) </td> <td> Maximum number of backup processes allowed at the same time </td> </tr> <tr> <td> parallel_shards_upgrade </td> <td> integer </td> <td> Maximum number of shards to upgrade in parallel </td> </tr> <tr> <td> persistence_cleanup_scan_interval </td> <td> string </td> <td> <a href="https://en.wikipedia.org/wiki/Cron#CRON_expression"> CRON expression </a> that defines the Redis cleanup schedule </td> </tr> <tr> <td> persistent_node_removal </td> <td> boolean </td> <td> When removing a node, wait for persistence files to be created for all migrated shards </td> </tr> <tr> <td> rack_aware </td> <td> boolean </td> <td> Cluster operates in a rack-aware mode </td> </tr> <tr> <td> redis_migrate_node_threshold </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before automatic migration of shards from it to free more memory </td> </tr> <tr> <td> redis_migrate_node_threshold_p </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before automatic migration of shards from it to free more memory </td> </tr> <tr> <td> redis_provision_node_threshold </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before new shards can no longer be added to it </td> </tr> <tr> <td> redis_provision_node_threshold_p </td> <td> integer </td> <td> Minimum free memory (excluding reserved memory) allowed on a node before new shards can no longer be added to it </td> </tr> <tr> <td> redis_upgrade_policy </td> <td> <strong> <code> major </code> </strong> <br/> <code> latest </code> </td> <td> Create/upgrade Redis Enterprise software on databases in the cluster by compatibility with major versions or latest versions of Redis Community Edition </td> </tr> <tr> <td> resp3_default </td> <td> boolean (default: true) </td> <td> Determines the default value of the <code> resp3 </code> option upon upgrading a database to version 7.2 </td> </tr> <tr> <td> shards_overbooking </td> <td> boolean </td> <td> If true, all databases' memory_size is ignored during shards placement </td> </tr> <tr> <td> show_internals </td> <td> boolean </td> <td> Show internal databases (and their shards and endpoints) REST APIs </td> </tr> <tr> <td> slave_ha </td> <td> boolean </td> <td> Enable the replica high-availability mechanism. Deprecated as of Redis Enterprise Software v7.2.4. </td> </tr> <tr> <td> slave_ha_bdb_cooldown_period </td> <td> integer </td> <td> Time in seconds between runs of the replica high-availability mechanism on different nodes on the same database </td> </tr> <tr> <td> slave_ha_cooldown_period </td> <td> integer </td> <td> Time in seconds between runs of the replica high-availability mechanism on different nodes on the same database </td> </tr> <tr> <td> slave_ha_grace_period </td> <td> integer </td> <td> Time in seconds between a node failure and when the replica high-availability mechanism starts relocating shards </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/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/operate/rs/clusters/remove-node/.html
<section class="prose w-full py-12 max-w-none"> <h1> Remove a node </h1> <p class="text-lg -mt-5 mb-10"> Remove a node from your Redis Enterprise cluster. </p> <p> You might want to remove a node from a Redis Enterprise cluster for one of the following reasons: </p> <ul> <li> To <a href="#permanently-remove-a-node"> permanently remove a node </a> if you no longer need the extra capacity. </li> <li> To <a href="#replace-a-faulty-node"> replace a faulty node </a> with a healthy node. </li> <li> To <a href="#replace-a-healthy-node"> replace a healthy node </a> with a different node. </li> </ul> <p> You can configure <a href="/docs/latest/operate/rs/clusters/monitoring/#cluster-alerts"> email alerts from the cluster </a> to notify you of cluster changes, including when a node is removed. </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> Read through these explanations thoroughly before taking any action. </div> </div> <h2 id="permanently-remove-a-node"> Permanently remove a node </h2> <p> Permanently removing a node means you are decreasing cluster capacity. Before trying to remove a node, make sure that the cluster has enough capacity for all resources without that node, otherwise you cannot remove the node. </p> <p> If there is not enough capacity in the cluster to facilitate removing the node, you can either delete databases or add another node instead of the one you would like to remove. </p> <p> During the removal process, the cluster migrates all resources from the node being removed to other nodes in the cluster. In order to ensure database connectivity, and database high availability (when replication is enabled), the cluster first creates replacement shards or endpoints on one of the other nodes in the cluster, initiates failover as needed, and only then removes the node. </p> <p> If a cluster has only two nodes (which is not recommended for production deployments) and some databases have replication enabled, you cannot remove a node. </p> <h2 id="replace-a-faulty-node"> Replace a faulty node </h2> <p> If the cluster has a faulty node that you would like to replace, you only need to add a new node to the cluster. The cluster recognizes the existence of a faulty node and automatically replaces the faulty node with the new node. </p> <p> For guidelines, refer to <a href="/docs/latest/operate/rs/clusters/replace-node/"> Replacing a faulty node </a> . </p> <h2 id="replace-a-healthy-node"> Replace a healthy node </h2> <p> If you would like to replace a healthy node with a different node, you must first add the new node to the cluster, migrate all the resources from the node you would like to remove, and only then remove the node. </p> <p> For further guidance, refer to <a href="/docs/latest/operate/rs/clusters/add-node/"> adding a new node to a cluster </a> . </p> <p> You can migrate resources by using the <code> rladmin </code> command-line interface (CLI). For guidelines, refer to <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/"> <code> rladmin </code> command-line interface (CLI) </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> The <a href="/docs/latest/operate/rs/networking/cluster-dns/"> DNS records </a> must be updated each time a node is added or replaced. </div> </div> <h2 id="remove-a-node"> Remove a node </h2> <p> To remove a node using the Cluster Manager UI: </p> <ol> <li> <p> On the <strong> Nodes </strong> screen, click <a href="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" sdata-lightbox="/images/rs/buttons/button-toggle-actions-vertical.png#no-click"> <img alt="More actions button" class="inline" src="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" width="22px"/> </a> for the node you want to remove. </p> <a href="/docs/latest/images/rs/screenshots/nodes/secondary-nodes-more-actions.png" sdata-lightbox="/images/rs/screenshots/nodes/secondary-nodes-more-actions.png"> <img alt="Click the more actions button for a node to access node actions." src="/docs/latest/images/rs/screenshots/nodes/secondary-nodes-more-actions.png"/> </a> </li> <li> <p> Select <strong> Remove node </strong> from the list. </p> </li> <li> <p> If there are shards on the node, select <strong> Confirm node removal </strong> . </p> <a href="/docs/latest/images/rs/screenshots/nodes/confirm-node-removal-selected.png" sdata-lightbox="/images/rs/screenshots/nodes/confirm-node-removal-selected.png"> <img alt="The Confirm node removal checkbox is selected, and the Remove button is clickable." src="/docs/latest/images/rs/screenshots/nodes/confirm-node-removal-selected.png"/> </a> <p> If the node has no shards, the <strong> Confirm node removal </strong> checkbox does not appear. </p> </li> <li> <p> Click <strong> Remove </strong> . </p> <p> Redis Enterprise Software examines the node and the cluster, then takes the actions required to remove the node, such as migrating shards to other nodes. After the process finishes, the node is no longer shown in the UI. </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> At any point, you can click the <strong> Cancel removal </strong> button to stop the process. When cancelled, the current internal action is completed, and then the process stops. </div> </div> </li> </ol> <p> To remove a node using the REST API, use <a href="/docs/latest/operate/rs/references/rest-api/requests/nodes/actions/#post-node-action"> <code> POST /v1/nodes/&lt;node_id&gt;/actions/remove </code> </a> . </p> <p> By default, the remove node action completes after all resources migrate off the removed node. Node removal does not wait for migrated shards' persistence files to be created on the new nodes. </p> <p> To change node removal to wait for the creation of new persistence files for all migrated shards, set <code> wait_for_persistence </code> to <code> true </code> in the request body or <a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/policy/#put-cluster-policy"> update the cluster policy </a> <code> persistent_node_removal </code> to <code> true </code> to change the cluster's default behavior. </p> <p> For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST https://&lt;hostname&gt;:9443/v1/nodes/&lt;node_id&gt;/actions/remove </span></span><span class="line"><span class="cl"><span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"wait_for_persistence"</span>: <span class="nb">true</span> </span></span><span class="line"><span class="cl"><span class="o">}</span> </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> If you need to add a removed node back to the cluster, you must <a href="/docs/latest/operate/rs/installing-upgrading/uninstalling/"> uninstall </a> and <a href="/docs/latest/operate/rs/installing-upgrading/"> reinstall </a> the software on that node. </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/clusters/remove-node/"/> <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/alert/.html
<section class="prose w-full py-12 max-w-none"> <h1> Alert object </h1> <p class="text-lg -mt-5 mb-10"> An object that contains alert info </p> <p> You can view, configure, and enable various alerts for the cluster. </p> <p> Alerts are bound to a cluster object (such as a <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/bdb/"> BDB </a> or <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/node/"> node </a> ), and the cluster's state determines whether the alerts turn on or off. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> <th> Writable </th> </tr> </thead> <tbody> <tr> <td> change_time </td> <td> string </td> <td> Timestamp when alert state last changed </td> <td> </td> </tr> <tr> <td> change_value </td> <td> object </td> <td> Contains data relevant to the evaluation time when the alert went on/off (thresholds, sampled values, etc.) </td> <td> </td> </tr> <tr> <td> enabled </td> <td> boolean </td> <td> If true, alert is enabled </td> <td> x </td> </tr> <tr> <td> severity </td> <td> 'DEBUG' <br/> 'INFO' <br/> 'WARNING' <br/> 'ERROR' <br/> 'CRITICAL' </td> <td> The alert's severity </td> <td> </td> </tr> <tr> <td> state </td> <td> boolean </td> <td> If true, alert is currently triggered </td> <td> </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Represents an alert threshold when applicable </td> <td> x </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/alert/"/> <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/cluster/stats/last/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster last stats requests </h1> <p class="text-lg -mt-5 mb-10"> Most recent cluster statistics requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-cluster-stats-last"> GET </a> </td> <td> <code> /v1/cluster/stats/last </code> </td> <td> Get most recent cluster stats </td> </tr> </tbody> </table> <h2 id="get-cluster-stats-last"> Get latest cluster stats </h2> <pre><code>GET /v1/cluster/stats/last </code></pre> <p> Get the most recent cluster statistics. </p> <h4 id="required-permissions"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/references/rest-api/permissions/#view_cluster_stats"> view_cluster_stats </a> </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>GET /cluster/stats/last?interval=1sec&amp;stime=2015-10-14T06:44:00Z </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> 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="query-parameters"> Query parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> interval </td> <td> string </td> <td> Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week. Default: 1sec. (optional) </td> </tr> <tr> <td> stime </td> <td> ISO_8601 </td> <td> Start time from which we want the stats. Should comply with the <a href="https://en.wikipedia.org/wiki/ISO_8601"> ISO_8601 </a> format (optional) </td> </tr> <tr> <td> etime </td> <td> ISO_8601 </td> <td> End time after which we don't want the stats. Should comply with the <a href="https://en.wikipedia.org/wiki/ISO_8601"> ISO_8601 </a> format (optional) </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns the most recent <a href="/docs/latest/operate/rs/references/rest-api/objects/statistics/"> statistics </a> for the cluster. </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">"conns"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"cpu_idle"</span><span class="p">:</span> <span class="mf">0.8424999999988358</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"cpu_system"</span><span class="p">:</span> <span class="mf">0.01749999999992724</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"cpu_user"</span><span class="p">:</span> <span class="mf">0.08374999999978172</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"egress_bytes"</span><span class="p">:</span> <span class="mf">7403.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ephemeral_storage_avail"</span><span class="p">:</span> <span class="mf">151638712320.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ephemeral_storage_free"</span><span class="p">:</span> <span class="mf">162375925760.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"etime"</span><span class="p">:</span> <span class="s2">"2015-10-14T06:44:01Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"free_memory"</span><span class="p">:</span> <span class="mf">5862400000.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes"</span><span class="p">:</span> <span class="mf">7469.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"1sec"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"persistent_storage_avail"</span><span class="p">:</span> <span class="mf">151638712320.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"persistent_storage_free"</span><span class="p">:</span> <span class="mf">162375925760.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2015-10-14T06:44:00Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"total_req"</span><span class="p">:</span> <span class="mf">0.0</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.5.1"> 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/cluster/stats/last/"/> <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/.html
<section class="prose w-full py-12 max-w-none"> <h1> Concepts </h1> <p class="text-lg -mt-5 mb-10"> Details about triggers, the JavaScript API, and advanced concepts </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> <nav> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/"> Triggers </a> <p> Different ways of executing JavaScript functions </p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/javascript_api/"> JavaScript API </a> <p> Overview of the JavaScript API </p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/sync_async/"> Sync and async </a> <p> Sync and async functions </p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/cluster_support/"> Cluster support </a> <p> Cluster support for triggers and functions </p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/function_flags/"> Function flags </a> <p> Function flags for JavaScript functions </p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/library_configuration/"> Library configuration </a> <p> How to use configuration in JavaScript functions </p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/resp_js_conversion/"> RESP &amp; JavaScript </a> <p> Converting RESP to and from JavaScript </p> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/binary_data/"> Binary data </a> <p> Working with binary data </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/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/"/> <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/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisGears JVM plugin </h1> <p class="text-lg -mt-5 mb-10"> The RedisGears JVM plugin allows you to run RedisGears functions in the Java virtual machine. </p> <p> With the <a href="https://github.com/RedisGears/JVMPlugin"> RedisGears JVM plugin </a> , you can write RedisGears functions in <a href="https://en.wikipedia.org/wiki/Java_(programming_language)"> Java </a> and run them on a <a href="/docs/latest/operate/rs/"> Redis Enterprise </a> cluster. It currently supports <a href="https://en.wikipedia.org/wiki/Java_virtual_machine"> JVM </a> version 11. </p> <p> Similar to the Python plugin, the JVM plugin allows both batch processing and event-driven processing. </p> <p> Before you can run RedisGears with Java, you will need to <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/installing-redisgears/#install-redisgears"> install the RedisGears module and the JVM plugin </a> on your Redis Enterprise cluster and <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/install/"> enable them for your database </a> . </p> <p> Once you have written your code, compile and package it into a <a href="https://en.wikipedia.org/wiki/JAR_(file_format)"> JAR </a> file and upload it to a node on your Redis Enterprise cluster. Use the <code> RG.JEXECUTE </code> command with the <code> redis-cli </code> command-line tool to run your code. </p> <h2 id="more-info"> More info </h2> <ul> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/quickstart/"> RedisGears JVM quick start </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/"> RedisGears Java classes and functions </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/recipes/"> RedisGears recipes </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/oss_and_stack/stack-with-enterprise/gears-v1/jvm/"/> <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/plan-deployment/supported-platforms/.html
<section class="prose w-full py-12 max-w-none"> <h1> Supported platforms </h1> <p class="text-lg -mt-5 mb-10"> Redis Enterprise Software is supported on several operating systems, cloud environments, and virtual environments. </p> <p> Redis Enterprise Software is supported on several operating systems, cloud environments, and virtual environments. </p> <h2 id="supported-platforms"> Supported platforms </h2> <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 Software <br/> major versions </th> <th style="text-align:center"> 7.8 </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"> Nov 2024 </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/7.4/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"> Nov 2026 </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> <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"> <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 9 <br/> FIPS mode <sup> <a href="#table-note-5"> 5 </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> <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> <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"> – </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"> <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"> – </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"> – </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"> <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"> – </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> <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> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> </tbody> </table> <ol> <li> <p> <a name="table-note-1"> </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"> </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"> </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"> </a> <a href="/docs/latest/operate/rs/7.4/installing-upgrading/quickstarts/docker-quickstart/"> Docker images </a> of Redis Enterprise Software are certified for development and testing only. </p> </li> <li> <p> <a name="table-note-5"> </a> Supported only if <a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/security_hardening/switching-rhel-to-fips-mode_security-hardening#proc_installing-the-system-with-fips-mode-enabled_switching-rhel-to-fips-mode"> FIPS was enabled during RHEL installation </a> to ensure FIPS compliance. </p> </li> </ol> <p> The following table shows which Redis Enterprise Software version first tested and added support for each RHEL version: </p> <table> <thead> <tr> <th> RHEL version </th> <th> Redis Enterprise version </th> </tr> </thead> <tbody> <tr> <td> 8.4 </td> <td> 6.2.8 </td> </tr> <tr> <td> 8.5 </td> <td> 6.2.10 </td> </tr> <tr> <td> 8.6 </td> <td> 6.2.10 </td> </tr> <tr> <td> 8.7 </td> <td> 6.4.2 </td> </tr> <tr> <td> 8.8 </td> <td> 6.4.2 </td> </tr> <tr> <td> 8.9 </td> <td> 7.2.4 </td> </tr> <tr> <td> 9.3 </td> <td> 7.4.2 </td> </tr> </tbody> </table> <h2 id="operating-system-compatibility-policy"> Operating system compatibility policy </h2> <p> Redis maintains a list of <a href="#supported-platforms"> supported operating systems </a> for each major version of Redis Enterprise Software and the specific OS versions tested with Redis Enterprise releases. Because the list is updated as new OS versions are introduced and old ones become obsolete, we encourage you to check the list and plan upgrades accordingly. We also suggest you keep Redis Enterprise and corresponding supported OS versions up to date. </p> <p> We thoroughly test the most recent minor version of each supported major OS to ensure the best compatibility and performance with every Redis Enterprise release. This process helps detect and address potential compatibility issues early on. </p> <p> Due to the vast array of minor updates and variations across operating systems, we cannot test compatibility with every minor OS version and each Redis Enterprise version. However, because OS vendors each have an Application Binary Interface (ABI) they support and avoid breaking, except to address severe security issues, newer minor OS versions are generally expected to work correctly. We will add a note to this document if specific OS minor versions have significant ABI or dependency changes. An earlier OS minor version also might work, although it is not guaranteed. </p> <p> Despite our rigorous testing, we recommend users test their Redis applications with any new OS update before deploying it in a production environment. This additional testing layer can help identify any unique issues in your setup. </p> <h3 id="red-hat-enterprise-linux-rhel"> Red Hat Enterprise Linux (RHEL) </h3> <p> Red Hat has a well-defined lifecycle for support. For details, see <a href="https://access.redhat.com/support/policy/updates/errata#RHEL8_and_9_Life_Cycle"> Red Hat Enterprise Linux Life Cycle </a> . </p> <p> Redis supports and tests RHEL 8 and 9 minor releases and extended update support timeframes. However, none of the longer Red Hat support cycles, such as SAP and EEUS, are supported. </p> <p> We only support what the vendor supports in accordance with their policies. When Red Hat no longer supports a particular release, it is no longer supported by Redis as well. If future Redis Enterprise releases will not support a major RHEL version, the release notes and the <a href="#supported-platforms"> supported platforms </a> table will include deprecation warnings. </p> <h3 id="rhel-clones-and-equivalent-enterprise-os"> RHEL clones and equivalent Enterprise OS </h3> <p> The <a href="#supported-platforms"> supported platforms </a> table lists the versions of Red Hat Enterprise Linux (RHEL) that Redis supports. This support extends to the ABI and package compatibility with RHEL of the same version. </p> <p> The RHEL-compatible distributions CentOS, CentOS Stream, Alma Linux, Rocky Linux, and Oracle Linux running the Red Hat Compatible Kernel (RHCK) are supported if they provide full RHEL compatibility. If Redis identifies or questions some incompatibility from a clone, you might be asked to test on another clone or RHEL directly. </p> <h2 id="operating-system-limitations"> Operating system limitations </h2> <h3 id="tls-10-and-tls-11"> TLS 1.0 and TLS 1.1 </h3> <p> Redis Enterprise Software version 6.2.8 removed support for TLS 1.0 and TLS 1.1 on Red Hat Enterprise Linux 8 (RHEL 8) because that operating system <a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening"> does not enable support </a> for these versions by default. </p> <h3 id="ubuntu-20-rejects-sha1-certificates"> Ubuntu 20 rejects SHA1 certificates </h3> <p> With Ubuntu 20.04, you cannot use the SHA1 hash algorithm because <a href="https://manpages.ubuntu.com/manpages/focal/man3/SSL_CTX_set_security_level.3ssl.html#notes"> OpenSSL's security level is set to 2 by default </a> . As a result, the operating system rejects SHA1 certificates, even if you enable the <code> mtls_allow_weak_hashing </code> option. </p> <p> To avoid issues with SHA1 certificates, replace them with new certificates that use SHA-256. Note that certificates provided by Redis Enterprise Software use SHA-256. </p> <h3 id="upgrade-rhel-when-using-modules"> Upgrade RHEL when using modules </h3> <p> RHEL 7 clusters cannot be directly upgraded to RHEL 8 when hosting databases using modules, due to binary differences in modules between the two operating systems. Instead, you need to create a new cluster on RHEL 8 and then migrate existing data from your RHEL 7 cluster. This does not apply to clusters that do not use modules. </p> <p> This limitation is fixed for clusters using Redis Enterprise Software version 7.2.4 and later. </p> <h3 id="modules-cannot-load-in-oracle-linux-7--8"> Modules cannot load in Oracle Linux 7 &amp; 8 </h3> <p> Databases hosted on Oracle Linux 7 &amp; 8 cannot load modules. </p> <p> As a temporary workaround, you can change the node's <code> os_name </code> in the Cluster Configuration Store (CCS): </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">ccs-cli hset node:&lt;ID&gt; os_name rhel </span></span></code></pre> </div> <p> This limitation was fixed in <a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-64/"> Redis Enterprise Software version 7.2.4-64 </a> . </p> <h3 id="openssl-compatibility-issue-for-742-modules-on-amazon-linux-2"> OpenSSL compatibility issue for 7.4.2 modules on Amazon Linux 2 </h3> <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> <h3 id="redisgraph-prevents-upgrade-to-rhel-9"> RedisGraph prevents upgrade to RHEL 9 </h3> <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="virtualization-platforms"> Virtualization platforms </h2> <p> Redis Enterprise Software is compatible with VMware and other similar virtualization platforms. Make sure to do the following: </p> <ul> <li> Configure your memory, CPU, network, and storage settings to allow for optimal Redis Enterprise performance. </li> <li> Pin each Redis Enterprise shard to a specific ESX or ESXi host by setting the appropriate affinity rules. </li> <li> If you must manually migrate a virtual machine to another host, follow the best practices for <a href="/docs/latest/operate/rs/7.4/clusters/maintenance-mode/"> shard maintenance </a> and contact support if you have questions. </li> <li> Turn off VMware VMotion because Redis Enterprise is not compatible with VMotion. </li> <li> Don't use snapshots because Redis Enterprise cluster manages states dynamically, so a snapshot might not have the correct node and cluster states. </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/plan-deployment/supported-platforms/"/> <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/bootstrap/.html
<section class="prose w-full py-12 max-w-none"> <h1> Bootstrap object </h1> <p class="text-lg -mt-5 mb-10"> An object for bootstrap configuration </p> <p> A bootstrap configuration object. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> action </td> <td> 'create_cluster' <br/> 'join_cluster' <br/> 'recover_cluster' </td> <td> Action to perform </td> </tr> <tr> <td> cluster </td> <td> <a href="/docs/latest/operate/rs/references/rest-api/objects/bootstrap/cluster_identity/"> cluster_identity </a> object </td> <td> Cluster to join or create </td> </tr> <tr> <td> cnm_https_port </td> <td> integer </td> <td> Port to join a cluster with non-default cnm_https 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> credentials </td> <td> <a href="/docs/latest/operate/rs/references/rest-api/objects/bootstrap/credentials/"> credentials </a> object </td> <td> Cluster admin credentials </td> </tr> <tr> <td> dns_suffixes </td> <td> <pre><code> [{ "name": string, "cluster_default": boolean, "use_aaaa_ns": boolean, "use_internal_addr": boolean, "slaves": array }, ...] </code></pre> </td> <td> Explicit configuration of DNS suffixes <br/> <strong> name </strong> : DNS suffix name <br/> <strong> cluster_default </strong> : Should this suffix be the default cluster suffix <br/> <strong> use_aaaa_ns </strong> : Should AAAA records be published for NS records <br/> <strong> use_internal_addr </strong> : Should internal cluster IPs be published for databases <br/> <strong> slaves </strong> : List of replica servers that should be published as NS and notified </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> license </td> <td> string </td> <td> License string. If not provided, a trial license is set by default. </td> </tr> <tr> <td> max_retries </td> <td> integer </td> <td> Max number of retries in case of recoverable errors </td> </tr> <tr> <td> node </td> <td> <a href="/docs/latest/operate/rs/references/rest-api/objects/bootstrap/node_identity/"> node_identity </a> object </td> <td> Node description </td> </tr> <tr> <td> policy </td> <td> <a href="/docs/latest/operate/rs/references/rest-api/objects/bootstrap/policy/"> policy </a> object </td> <td> Policy object </td> </tr> <tr> <td> recovery_filename </td> <td> string </td> <td> Name of backup file to recover from </td> </tr> <tr> <td> required_version </td> <td> string </td> <td> This node can only join the cluster if all nodes in the cluster have a version greater than the required_version </td> </tr> <tr> <td> retry_time </td> <td> integer </td> <td> Max waiting time between retries (in seconds) </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/bootstrap/"/> <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.objlen.html
<section class="prose w-full py-12"> <h1 class="command-name"> JSON.OBJLEN </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">JSON.OBJLEN 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(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key </dd> </dl> <p> Report the number of keys in the JSON object 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 parse. Returns <code> null </code> for nonexistent keys. </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> . Returns <code> null </code> for nonexistant path. </p> </details> <h2 id="return"> Return </h2> <p> JSON.OBJLEN returns an array of integer replies for each path specified as the number of keys in the object or <code> nil </code> , if the matching JSON value is not an object. 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> <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":[3], "nested": {"a": {"b":2, "c": 1}}}'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.OBJLEN doc $..a </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>nil<span class="o">)</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">2</span></span></span></code></pre> </div> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/json.arrindex/"> <code> JSON.ARRINDEX </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.objlen/"/> <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/transform-examples/redis-string-example/.html
<section class="prose w-full py-12 max-w-none"> <h1> Write to a Redis string </h1> <p> The string data type is useful for capturing a string representation of a single column from a source table. </p> <p> In the example job below, the <code> title </code> column is captured from the <code> invoice </code> table in the source. The <code> title </code> is then written to the Redis target database as a string under a custom key of the form <code> AlbumTitle:42 </code> , where the <code> 42 </code> is the primary key value of the table (the <code> albumid </code> column). </p> <p> The <code> connection </code> is an optional parameter that refers to the corresponding connection name defined in <a href="/docs/latest/integrate/redis-data-integration/data-pipelines/data-pipelines/#the-configyaml-file"> <code> config.yaml </code> </a> . When you specify the <code> data_type </code> parameter for the job, it overrides the system-wide setting <code> target_data_type </code> defined in <code> config.yaml </code> . Here, the <code> string </code> data type also requires an <code> args </code> subsection with a <code> value </code> argument that specifies the column you want to capture from the source table. </p> <p> The optional <code> expire </code> parameter sets the length of time, in seconds, that a new key will persist for after it is created (here, it is 86400 seconds, which equals one day). After this time, the key will be deleted automatically. If you don't supply an <code> expire </code> parameter, the keys will never expire. </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">source</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">server_name</span><span class="p">:</span><span class="w"> </span><span class="l">chinook</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">album</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">row_format</span><span class="p">:</span><span class="w"> </span><span class="l">full</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">output</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">redis.write</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">connection</span><span class="p">:</span><span class="w"> </span><span class="l">target</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">data_type</span><span class="p">:</span><span class="w"> </span><span class="l">string</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">key</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">expression</span><span class="p">:</span><span class="w"> </span><span class="l">concat(['AlbumTitle:', values(key)[0]])</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">language</span><span class="p">:</span><span class="w"> </span><span class="l">jmespath</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">args</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">value</span><span class="p">:</span><span class="w"> </span><span class="l">title</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">expire</span><span class="p">:</span><span class="w"> </span><span class="m">86400</span><span class="w"> </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/integrate/redis-data-integration/data-pipelines/transform-examples/redis-string-example/"/> <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/strings/.html
<section class="prose w-full py-12 max-w-none"> <h1> Strings and bitfields in Active-Active databases </h1> <p class="text-lg -mt-5 mb-10"> Information about using strings and bitfields with an Active-Active database. </p> <p> Active-Active databases support both strings and bitfields. </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> Active-Active <strong> bitfield </strong> support was added in RS version 6.0.20. </div> </div> <p> Changes to both of these data structures will be replicated across Active-Active member databases. </p> <h2 id="replication-semantics"> Replication semantics </h2> <p> Except in the case of <a href="#string-counter-support"> string counters </a> (see below), both strings and bitfields are replicated using a "last write wins" approach. The reason for this is that strings and bitfields are effectively binary objects. So, unlike with lists, sets, and hashes, the conflict resolution semantics of a given operation on a string or bitfield are undefined. </p> <h3 id="how-last-write-wins-works"> How "last write wins" works </h3> <p> A wall-clock timestamp (OS time) is stored in the metadata of every string and bitfield operation. If the replication syncer cannot determine the order of operations, the value with the latest timestamp wins. This is the only case with Active-Active databases where OS time is used to resolve a conflict. </p> <p> Here's an example where an update happening to the same key at a later time (t2) wins over the update at t1. </p> <table> <thead> <tr> <th style="text-align:center"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> Region 1 </strong> </th> <th style="text-align:center"> <strong> Region 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:center"> t1 </td> <td style="text-align:center"> SET text “a” </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:center"> t2 </td> <td style="text-align:center"> </td> <td style="text-align:center"> SET text “b” </td> </tr> <tr> <td style="text-align:center"> t3 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:center"> t4 </td> <td style="text-align:center"> SET text “c” </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:center"> t5 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:center"> t6 </td> <td style="text-align:center"> </td> <td style="text-align:center"> SET text “d” </td> </tr> </tbody> </table> <h3 id="string-counter-support"> String counter support </h3> <p> When you're using a string as counter (for instance, with the <a href="/docs/latest/commands/incr/"> INCR </a> or <a href="/docs/latest/commands/incrby/"> INCRBY </a> commands), then conflicts will be resolved semantically. </p> <p> On conflicting writes, counters accumulate the total counter operations across all member Active-Active databases in each sync. </p> <p> Here's an example of how counter values works when synced between two member Active-Active databases. With each sync, the counter value accumulates the private increment and decrements of each site and maintain an accurate counter across concurrent writes. </p> <table> <thead> <tr> <th style="text-align:center"> <strong> Time </strong> </th> <th style="text-align:center"> <strong> Region 1 </strong> </th> <th style="text-align:center"> <strong> Region 2 </strong> </th> </tr> </thead> <tbody> <tr> <td style="text-align:center"> t1 </td> <td style="text-align:center"> INCRBY counter 7 </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:center"> t2 </td> <td style="text-align:center"> </td> <td style="text-align:center"> INCRBY counter 3 </td> </tr> <tr> <td style="text-align:center"> t3 </td> <td style="text-align:center"> GET counter <br/> 7 </td> <td style="text-align:center"> GET counter <br/> 3 </td> </tr> <tr> <td style="text-align:center"> t4 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:center"> t5 </td> <td style="text-align:center"> GET counter <br/> 10 </td> <td style="text-align:center"> GET counter <br/> 10 </td> </tr> <tr> <td style="text-align:center"> t6 </td> <td style="text-align:center"> DECRBY counter 3 </td> <td style="text-align:center"> </td> </tr> <tr> <td style="text-align:center"> t7 </td> <td style="text-align:center"> </td> <td style="text-align:center"> INCRBY counter 6 </td> </tr> <tr> <td style="text-align:center"> t8 </td> <td style="text-align:center"> — Sync — </td> <td style="text-align:center"> — Sync — </td> </tr> <tr> <td style="text-align:center"> t9 </td> <td style="text-align:center"> GET counter <br/> 13 </td> <td style="text-align:center"> GET counter <br/> 13 </td> </tr> </tbody> </table> <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> Active-Active databases support 59-bit counters. This limitation is to protect from overflowing a counter in a concurrent operation. </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/active-active/develop/data-types/strings/"/> <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/api/get-started/use-rest-api/.html
<section class="prose w-full py-12 max-w-none"> <h1> Use the REST API </h1> <p class="text-lg -mt-5 mb-10"> How to use the API with various tools (especially <code> cURL </code> ) </p> <p> You can access and use the API endpoint URI ( <a href="https://api.redislabs.com/v1/"> <code> https://api.redislabs.com/v1 </code> </a> ) with any of the following tools: </p> <ul> <li> The Swagger user interface </li> <li> The cURL HTTP client </li> <li> An HTTP client in any programming language </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> For the Redis Cloud API, there is a request limit of 400 requests per minute per Account API key. If you go past this limit, your API requests will fail. </div> </div> <h2 id="swagger-user-interface"> Swagger user interface </h2> <p> The <a href="https://api.redislabs.com/v1/swagger-ui.html"> Swagger UI </a> is useful for initial introduction and for learning about API operations, models, and simulated usage. </p> <h3 id="authenticate-to-swagger"> Authenticate to Swagger </h3> <p> To authenticate to the Swagger UI: </p> <ol> <li> <p> Open the <a href="https://api.redislabs.com/v1/swagger-ui.html"> Swagger UI </a> page in a browser. </p> <a href="/docs/latest/images/rv/api/swagger-authorize-and-try-now.png" sdata-lightbox="/images/rv/api/swagger-authorize-and-try-now.png"> <img src="/docs/latest/images/rv/api/swagger-authorize-and-try-now.png"/> </a> </li> <li> <p> Select <code> Authorize </code> . </p> <p> The <strong> Available Authorizations </strong> box is shown with the headers and values that are used for authentication in all API interactions with Swagger. </p> <a href="/docs/latest/images/rv/api/swagger-authorizations.png" sdata-lightbox="/images/rv/api/swagger-authorizations.png"> <img src="/docs/latest/images/rv/api/swagger-authorizations.png"/> </a> </li> <li> <p> Insert the API Key values: </p> <ol> <li> Enter the <a href="/docs/latest/operate/rc/api/get-started/enable-the-api/"> Account Key </a> as the <code> x-api-key </code> value and then choose <strong> Authorize </strong> . </li> <li> Enter the <a href="/docs/latest/operate/rc/api/get-started/manage-api-keys/"> Secret Key </a> as the <code> x-api-secret-key </code> value and then choose <strong> Authorize </strong> . </li> <li> Select <strong> Close </strong> . </li> </ol> </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> The key values are not saved when you refresh the page. </div> </div> <p> When authorization is successful, the lock icon displays a closed lock. </p> <a href="/docs/latest/images/rv/api/swagger-closed-lock.png" sdata-lightbox="/images/rv/api/swagger-closed-lock.png"> <img src="/docs/latest/images/rv/api/swagger-closed-lock.png"/> </a> <h3 id="make-api-requests"> Make API requests </h3> <p> After you complete the authorization in the Swagger UI, you can make an API request: </p> <ol> <li> <p> Open an action category and select an API operation. </p> <p> For example, in the <code> Account </code> category select the <code> GET /payment-methods </code> operation. </p> <a href="/docs/latest/images/rv/api/swagger-payment-methods-try-it-now.png" sdata-lightbox="/images/rv/api/swagger-payment-methods-try-it-now.png"> <img src="/docs/latest/images/rv/api/swagger-payment-methods-try-it-now.png"/> </a> </li> <li> <p> Select <strong> Try it out </strong> and then select <strong> Execute </strong> . </p> <p> The API response is shown in the <strong> Responses </strong> section of the API operation. The results include an example of how to execute the same operation in a standard command-line utility using <code> cURL </code> . </p> <a href="/docs/latest/images/rv/api/swagger-query-results.png" sdata-lightbox="/images/rv/api/swagger-query-results.png"> <img src="/docs/latest/images/rv/api/swagger-query-results.png"/> </a> </li> </ol> <h4 id="inputs-for-operations-in-swagger"> Inputs for operations in Swagger </h4> <p> Some API operations require input, such as: </p> <ul> <li> <p> <strong> Parameters </strong> - When an API operation requires URI parameters, such as "get subscription by subscription id", you can enter the values for the parameters. </p> <a href="/docs/latest/images/rv/api/swagger-parameters.png" sdata-lightbox="/images/rv/api/swagger-parameters.png"> <img src="/docs/latest/images/rv/api/swagger-parameters.png"/> </a> </li> <li> <p> <strong> JSON Request Body </strong> - For API operations that require a JSON request body, you can either: </p> <ul> <li> <p> Use the <strong> model display </strong> to write the request based on the expected JSON structure and parameters. </p> <a href="/docs/latest/images/rv/api/swagger-post-body-model.png" sdata-lightbox="/images/rv/api/swagger-post-body-model.png"> <img src="/docs/latest/images/rv/api/swagger-post-body-model.png"/> </a> </li> <li> <p> Use the <strong> Try it now </strong> sample JSON created by Swagger as a base template that you can edit and execute. </p> <a href="/docs/latest/images/rv/api/swagger-post-edit-body.png" sdata-lightbox="/images/rv/api/swagger-post-edit-body.png"> <img src="/docs/latest/images/rv/api/swagger-post-edit-body.png"/> </a> </li> </ul> </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"> Warning: </div> The Swagger UI generates default JSON examples for <code> POST </code> and <code> PUT </code> operations. You should modify these examples to suit your specific needs and account settings. The examples will fail if used as-is. <br/> <br/> For more examples showing how to use specific endpoints, see <a href="/docs/latest/operate/rc/api/examples/"> REST API examples </a> . </div> </div> <h2 id="use-the-curl-http-client"> Use the <code> cURL </code> HTTP client </h2> <p> <code> cURL </code> is a popular command line tool used to perform HTTP requests, either as individual commands or within shell scripts (such as bash and zsh). For an introduction, see <a href="https://www.freecodecamp.org/news/how-to-start-using-curl-and-why-a-hands-on-introduction-ea1c913caaaa/"> How to start using cURL and why: a hands-on introduction </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"> Info: </div> Our examples use <code> cURL </code> and Linux shell scripts to demonstrate the API; you can use any standard REST client or library. <br/> <br/> Our examples also use <code> jq </code> , <a href="https://stedolan.github.io/jq/"> a JSON parser </a> . Use your package manager to install it (Example: <code> sudo apt install jq </code> ) </div> </div> <p> For example, a standard API call to get System Log information looks like this in <code> cURL </code> : </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -s -X GET <span class="s2">"https://</span><span class="nv">$HOST</span><span class="s2">/logs"</span> <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> -H <span class="s2">"accept: application/json"</span> <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> -H <span class="s2">"x-api-key: </span><span class="nv">$ACCOUNT_KEY</span><span class="s2">"</span> <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> -H <span class="s2">"x-api-secret-key: </span><span class="nv">$SECRET_KEY</span><span class="s2">"</span> <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> <span class="p">|</span> jq -r . </span></span></code></pre> </div> <ul> <li> <p> The example expects several variables to be set in the Linux shell: </p> <ul> <li> <strong> $HOST </strong> - The URI of the REST API host ( <code> api.redislabs.com/v1 </code> ) </li> <li> <strong> $ACCOUNT_KEY </strong> - The <a href="/docs/latest/operate/rc/api/get-started/enable-the-api/"> account key value </a> </li> <li> <strong> $SECRET_KEY </strong> - The personal <a href="/docs/latest/operate/rc/api/get-started/manage-api-keys/"> secret key value </a> </li> </ul> </li> <li> <p> The line " <code> | jq -r . </code> " means that the HTTP response will be piped (forwarded) to the <code> jq </code> JSON parser, and it will display only the raw output (" <code> -r </code> ") of the root element (" <code> . </code> ") </p> </li> <li> <p> You can set the variables using shell commands like the following: </p> </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">HOST</span><span class="o">=</span>api.redislabs.com/v1 </span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">ACCOUNT_KEY</span><span class="o">={</span>replace-with-your-account-key<span class="o">}</span> </span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">SECRET_KEY</span><span class="o">={</span>replace-with-your-secret-key<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/rc/api/get-started/use-rest-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/develop/clients/go/connect/.html
<section class="prose w-full py-12"> <h1> Connect to the server </h1> <p class="text-lg -mt-5 mb-10"> Connect your Go application to a Redis database </p> <h2 id="basic-connection"> Basic connection </h2> <p> The following example shows the simplest way to connect to a Redis server: </p> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="kn">import</span> <span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"context"</span> </span></span><span class="line"><span class="cl"> <span class="s">"fmt"</span> </span></span><span class="line"><span class="cl"> <span class="s">"github.com/redis/go-redis/v9"</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="kd">func</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">client</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// No password set </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// Use default DB </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">Protocol</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="c1">// Connection protocol </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> <p> You can also connect using a connection string: </p> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">opt</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">ParseURL</span><span class="p">(</span><span class="s">"redis://&lt;user&gt;:&lt;pass&gt;@localhost:6379/&lt;db&gt;"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</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="nx">client</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="nx">opt</span><span class="p">)</span> </span></span></code></pre> </div> <p> After connecting, you can test the connection by storing and retrieving a simple <a href="/docs/latest/develop/data-types/strings/"> string </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">err</span> <span class="o">:=</span> <span class="nx">client</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"foo"</span><span class="p">,</span> <span class="s">"bar"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Err</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</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="nx">val</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">client</span><span class="p">.</span><span class="nf">Get</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"foo"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</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="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="s">"foo"</span><span class="p">,</span> <span class="nx">val</span><span class="p">)</span> </span></span></code></pre> </div> <h2 id="connect-to-a-redis-cluster"> Connect to a Redis cluster </h2> <p> To connect to a Redis cluster, use <code> NewClusterClient() </code> . You can specify one or more cluster endpoints with the <code> Addrs </code> option: </p> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">client</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClusterClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">ClusterOptions</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addrs</span><span class="p">:</span> <span class="p">[]</span><span class="kt">string</span><span class="p">{</span><span class="s">":16379"</span><span class="p">,</span> <span class="s">":16380"</span><span class="p">,</span> <span class="s">":16381"</span><span class="p">,</span> <span class="s">":16382"</span><span class="p">,</span> <span class="s">":16383"</span><span class="p">,</span> <span class="s">":16384"</span><span class="p">},</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// To route commands by latency or randomly, enable one of the following. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">//RouteByLatency: true, </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">//RouteRandomly: true, </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="p">})</span> </span></span></code></pre> </div> <h2 id="connect-to-your-production-redis-with-tls"> Connect to your production Redis with TLS </h2> <p> When you deploy your application, use TLS and follow the <a href="/docs/latest/operate/oss_and_stack/management/security/"> Redis security </a> guidelines. </p> <p> Establish a secure connection with your Redis database: </p> <div class="highlight"> <pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="c1">// Load client cert </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">cert</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">tls</span><span class="p">.</span><span class="nf">LoadX509KeyPair</span><span class="p">(</span><span class="s">"redis_user.crt"</span><span class="p">,</span> <span class="s">"redis_user_private.key"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">log</span><span class="p">.</span><span class="nf">Fatal</span><span class="p">(</span><span class="nx">err</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="c1">// Load CA cert </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">caCert</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">os</span><span class="p">.</span><span class="nf">ReadFile</span><span class="p">(</span><span class="s">"redis_ca.pem"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">log</span><span class="p">.</span><span class="nf">Fatal</span><span class="p">(</span><span class="nx">err</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="nx">caCertPool</span> <span class="o">:=</span> <span class="nx">x509</span><span class="p">.</span><span class="nf">NewCertPool</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="nx">caCertPool</span><span class="p">.</span><span class="nf">AppendCertsFromPEM</span><span class="p">(</span><span class="nx">caCert</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nx">client</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"my-redis.cloud.redislabs.com:6379"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Username</span><span class="p">:</span> <span class="s">"default"</span><span class="p">,</span> <span class="c1">// use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">Password</span><span class="p">:</span> <span class="s">"secret"</span><span class="p">,</span> <span class="c1">// use your Redis password </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">TLSConfig</span><span class="p">:</span> <span class="o">&amp;</span><span class="nx">tls</span><span class="p">.</span><span class="nx">Config</span><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">MinVersion</span><span class="p">:</span> <span class="nx">tls</span><span class="p">.</span><span class="nx">VersionTLS12</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">Certificates</span><span class="p">:</span> <span class="p">[]</span><span class="nx">tls</span><span class="p">.</span><span class="nx">Certificate</span><span class="p">{</span><span class="nx">cert</span><span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="nx">RootCAs</span><span class="p">:</span> <span class="nx">caCertPool</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">//send SET command </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">err</span> <span class="p">=</span> <span class="nx">client</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"foo"</span><span class="p">,</span> <span class="s">"bar"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Err</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</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="c1">//send GET command and print the value </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">val</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">client</span><span class="p">.</span><span class="nf">Get</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"foo"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</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="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="s">"foo"</span><span class="p">,</span> <span class="nx">val</span><span class="p">)</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/develop/clients/go/connect/"/> <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/redisbloom/redisbloom-2.2-release-notes.md.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisBloom 2.2 release notes </h1> <p class="text-lg -mt-5 mb-10"> BF.INFO returns bloom filter details. CF.INFO returns cuckoo filter details. Scalable bloom and cuckoo filters. Configurable bucket size for cuckoo filters. CMS.INCRBY returns count. </p> <h2 id="requirements"> Requirements </h2> <p> RedisBloom v2.2.18 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 4.0.0 </li> <li> Minimum Redis Enterprise Software version (cluster): 5.0.0 </li> </ul> <h2 id="v2218-july-2022"> v2.2.18 (July 2022) </h2> <p> This is a maintenance release for RedisBloom 2.2. </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/RedisBloom/RedisBloom/issues/481"> #481 </a> CF crashes on expansion 0 </li> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/478"> #478 </a> <a href="/docs/latest/commands/bf.info"> <code> BF.INFO </code> </a> reports an inaccurate result about the memory footprint </li> </ul> </li> </ul> <h2 id="v2217-june-2022"> v2.2.17 (June 2022) </h2> <p> This is a maintenance release for RedisBloom 2.2. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/451"> #451 </a> <a href="/docs/latest/commands/topk.incrby"> <code> TOPK.INCRBY </code> </a> : fix calculation when old fingerprint count is reduced to 0 </li> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/462"> #462 </a> <a href="/docs/latest/commands/cf.reserve"> <code> CF.RESERVE </code> </a> : fix potential crash on incorrect number of parameters </li> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/434"> #434 </a> <a href="/docs/latest/commands/cf.insert"> <code> CF.INSERT </code> </a> : fix crash when capacity is negative </li> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/450"> #450 </a> <a href="/docs/latest/commands/topk.incrby"> <code> TOPK.INCRBY </code> </a> : limit increment to 100,000 to prevent potential long freezes </li> </ul> </li> </ul> <h2 id="v2215-may-2022"> v2.2.15 (May 2022) </h2> <p> This is a maintenance release for RedisBloom 2.2. </p> <p> Update urgency: None. </p> <p> Details: </p> <ul> <li> <p> Enhancements: </p> <ul> <li> Added support for RedisBloom for AArch64 Linux </li> </ul> </li> </ul> <h2 id="v2214-march-2022"> v2.2.14 (March 2022) </h2> <p> This is a maintenance release for RedisBloom 2.2. </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/RedisBloom/RedisBloom/pull/419"> #419 </a> <code> CMS.INCRBY </code> now returns an error on overflow </li> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/412"> #412 </a> Fixed macOS build </li> </ul> </li> </ul> <h2 id="v2212-february-2022"> v2.2.12 (February 2022) </h2> <p> This is a maintenance release for RedisBloom 2.2. </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/RedisBloom/RedisBloom/pull/392"> #392 </a> Fixed a potential crash on Bloom filter expansion when loading from <a href="/docs/latest/operate/oss_and_stack/management/persistence/"> AOF </a> </li> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/404"> #404 </a> Fixed a potential crash on Cuckoo filter when calling <code> CF.LOADCHUNK </code> on a filter with <code> EXPANSION </code> greater than 1 </li> </ul> </li> </ul> <h2 id="v229-november-2021"> v2.2.9 (November 2021) </h2> <p> This is a maintenance release for RedisBloom 2.2. </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> <p> <a href="https://github.com/RedisBloom/RedisBloom/pull/281"> #281 </a> Memory leak when loading TOPK keys from RDB. </p> </li> <li> <p> <a href="https://github.com/RedisBloom/RedisBloom/pull/303"> #303 </a> <code> CMS.INCRBY </code> for negative or non-number </p> </li> <li> <p> <a href="https://github.com/RedisBloom/RedisBloom/pull/354"> #354 </a> TOPK List Duplicate entries </p> </li> <li> <p> <a href="https://github.com/RedisBloom/RedisBloom/pull/369"> #369 </a> Free only latest filter on <code> CF.COMPACT </code> </p> </li> <li> <p> <a href="https://github.com/RedisBloom/RedisBloom/pull/371"> #371 </a> <code> CF.SCANDUMP </code> for cuckoo filter </p> </li> <li> <p> <a href="https://github.com/RedisBloom/RedisBloom/pull/374"> #374 </a> ReplicateVerbatim for <code> CF.LOADCHUNK </code> (similar to <a href="https://github.com/RedisBloom/RedisBloom/pull/309"> #309 </a> ) </p> </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/331"> #331 </a> Add <code> WITHCOUNT </code> flag to <code> TOPK.LIST </code> </li> </ul> </li> </ul> <h2 id="v226-august-2021"> v2.2.6 (August 2021) </h2> <p> This is a maintenance release for version 1.0. </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> Enhancements: <ul> <li> # <a href="https://github.com/redisbloom/redisbloom/issues/333"> 333 </a> Support inter shards TLS capability </li> </ul> </li> </ul> <h2 id="v224-july-2020"> v2.2.4 (July 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for found issues. </li> </ul> <p> Details: </p> <ul> <li> Bug fixes: <ul> <li> # <a href="https://github.com/redisbloom/redisbloom/issues/215"> 215 </a> Count-Min-Sketch CMS.INCRBY command to reply with correct min result. </li> <li> # <a href="https://github.com/redisbloom/redisbloom/issues/219"> 219 </a> Cuckoo Filter CF.DEBUG correct response formatting. </li> </ul> </li> </ul> <h2 id="v223-july-2020"> v2.2.3 (July 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for found issues. </li> </ul> <p> Details: </p> <ul> <li> Bug fixes: <ul> <li> <a href="https://github.com/RedisBloom/RedisBloom/pull/217"> #217 </a> Client hung on <code> BF.INSERT </code> with multiple new items when a non-scaling filter is full. </li> </ul> </li> </ul> <h2 id="v222-march-2020"> v2.2.2 (March 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> </ul> <p> Details: </p> <ul> <li> Minor enhancements: <ul> <li> Bloom <ul> <li> # <a href="https://github.com/redisbloom/redisbloom/issues/180"> 180 </a> Removed the upper limit on Bloom Filter capacity. </li> </ul> </li> </ul> </li> </ul> <h2 id="v221-january-2020"> v2.2.1 (January 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> </ul> <p> Details: </p> <ul> <li> Minor Enhancements: <ul> <li> Bloom <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/179"> 179 </a> Allow storing filters with size over 4294967295 (UINT32_MAX). Now 64 bits. </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/177"> 177 </a> Prevent passing both <code> EXPANSION </code> <em> and </em> <code> NONSCALING </code> parameters to <code> BF.RESERVE </code> . </li> </ul> </li> </ul> </li> </ul> <h2 id="v220-december-2019"> v2.2.0 (December 2019) </h2> <ul> <li> <p> Added functionality </p> <ul> <li> Bloom <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/149"> 149 </a> <code> BF.INFO </code> returns details about a specific bloom filter </li> <li> Scalable <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/153"> 153 </a> Ability to change the <code> EXPANSION </code> rate. This means each subsequent sub-filter will be <code> expansion </code> times larger as the previous one. </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/160"> 160 </a> Optimise the scaling up of filter according to the <a href="https://core.ac.uk/download/pdf/55607643.pdf"> Scalable Bloom Filter </a> paper </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/161"> 161 </a> Optional <code> NONSCALING </code> argument to disable scaling. (This saves space since less hash functions are used) </li> </ul> </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/155"> 155 </a> Disabling rounding up functionality </li> </ul> </li> <li> Cuckoo <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/149"> 149 </a> <code> CF.INFO </code> returns details about a specific cuckoo filter </li> <li> Scalable <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/138"> 138 </a> Configurable <code> EXPANSION </code> . When an additional filter is created, its size will be the size of the current filter multiplied by the <code> expansion </code> . Higher expansion rates will result in lower error rates. </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/142"> 142 </a> The maximum number of expansions limited to 32. </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/131"> 131 </a> Configurable <code> MAXITERATIONS </code> . Number of attempts to swap buckets before declaring filter as full and creating an additional filter. </li> </ul> </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/135"> 135 </a> Configurable <code> BUCKETSIZE </code> . Number of items in each bucket. Higher bucket size value improves the fill rate but result in a higher error rate and slightly slower operation speed. </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/142"> 142 </a> use of 64bit hash function </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/136"> 136 </a> expose compaction of filters in the API </li> </ul> </li> <li> CMS <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/97"> 97 </a> <code> CMS.INCRBY </code> returns count instead of ‘OK’ </li> </ul> </li> </ul> </li> <li> <p> Minor bug fixes </p> <ul> <li> Bloom <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/154"> 154 </a> Check error rate is 1&lt; (cannot be equal) </li> </ul> </li> <li> Cuckoo <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/134"> 134 </a> Added <code> CuckooInsert_MemAllocFailed </code> exception </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/130"> 130 </a> Number of deletes wasn’t saved to RDB </li> </ul> </li> <li> General <ul> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/117"> 117 </a> Using <code> RMUtil_RegisterWriteDenyOOMCmd </code> </li> <li> # <a href="https://github.com/RedisBloom/RedisBloom/issues/121"> 121 </a> Moved <code> ReplicaVerbatim </code> to end of functions </li> </ul> </li> </ul> </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/release-notes/redisbloom/redisbloom-2.2-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/integrate/write-behind/reference/data-transformation-block-types/relational_write/.html
<section class="prose w-full py-12 max-w-none"> <h1> relational.write </h1> <p class="text-lg -mt-5 mb-10"> Write into a SQL-compatible data store </p> <p> Write into a SQL-compatible data store </p> <p> <strong> Properties </strong> </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <strong> connection </strong> <br/> (The connection to use for loading) </td> <td> <code> string </code> </td> <td> Logical connection name as defined in the connections.yaml <br/> </td> <td> yes </td> </tr> <tr> <td> <strong> schema </strong> <br/> (The table schema of the target table) </td> <td> <code> string </code> </td> <td> If left blank, the default schema of this connection will be used as defined in the connections.yaml <br/> </td> <td> yes </td> </tr> <tr> <td> <strong> table </strong> <br/> (The target table name) </td> <td> <code> string </code> </td> <td> Target table name <br/> </td> <td> yes </td> </tr> <tr> <td> <a href="#keys"> <strong> keys </strong> </a> <br/> (Business keys to use in case of `load_strategy` is UPSERT or working with `opcode_field`) </td> <td> <code> array </code> </td> <td> </td> <td> no </td> </tr> <tr> <td> <a href="#mapping"> <strong> mapping </strong> </a> <br/> (Fields to write) </td> <td> <code> array </code> </td> <td> </td> <td> no </td> </tr> <tr> <td> <strong> foreach </strong> <br/> (Split a column into multiple records with a JMESPath expression) </td> <td> <code> string </code> </td> <td> Use a JMESPath expression to split a column into multiple records. The expression should be in the format column: expression. <br/> Pattern: <code> ^(?!:).*:.*(?&lt;!:)$ </code> <br/> </td> <td> no </td> </tr> <tr> <td> <strong> opcode_field </strong> </td> <td> <code> string </code> </td> <td> Name of the field in the payload that holds the operation (c - create, d - delete, u - update) for this record in the DB <br/> </td> <td> no </td> </tr> <tr> <td> <strong> load_strategy </strong> </td> <td> <code> string </code> </td> <td> type of target <br/> Default: <code> "APPEND" </code> <br/> Enum: <code> "APPEND" </code> , <code> "REPLACE" </code> , <code> "UPSERT" </code> , <code> "TYPE2" </code> <br/> </td> <td> no </td> </tr> <tr> <td> <strong> active_record_indicator </strong> </td> <td> <code> string </code> </td> <td> Used for <code> TYPE2 </code> load_strategy. An SQL expression used to identify which rows are active <br/> </td> <td> no </td> </tr> <tr> <td> <a href="#inactive_record_mapping"> <strong> inactive_record_mapping </strong> </a> <br/> (Used for `TYPE2` load_strategy. The columns mapping to use to close out an active record) </td> <td> <code> array </code> </td> <td> A list of columns to use. Use any valid SQL expression for the source. If 'target' is omitted, will default to the name of the source column <br/> Default: <br/> </td> <td> no </td> </tr> </tbody> </table> <p> <strong> Additional Properties: </strong> not allowed </p> <p> <strong> No properties. </strong> </p> <p> <strong> Not [required1]: </strong> <strong> No properties. </strong> </p> <p> <strong> Example </strong> </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l">load_snowflake</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">relational.write</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">properties</span><span class="p">:</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">connection</span><span class="p">:</span><span class="w"> </span><span class="l">eu_datalake</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">employees</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">schema</span><span class="p">:</span><span class="w"> </span><span class="l">dbo</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">load_strategy</span><span class="p">:</span><span class="w"> </span><span class="l">APPEND</span><span class="w"> </span></span></span></code></pre> </div> <p> <a name="keys"> </a> </p> <h2 id="keys-business-keys-to-use-in-case-of-load_strategy-is-upsert-or-working-with-opcode_field"> keys[]: Business keys to use in case of `load_strategy` is UPSERT or working with `opcode_field` </h2> <p> <strong> Items: name of column </strong> </p> <p> <strong> No properties. </strong> </p> <p> <strong> Example </strong> </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl">- <span class="l">fname</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span>- <span class="nt">lname</span><span class="p">:</span><span class="w"> </span><span class="l">last_name</span><span class="w"> </span></span></span></code></pre> </div> <p> <a name="mapping"> </a> </p> <h2 id="mapping-fields-to-write"> mapping[]: Fields to write </h2> <p> <strong> Items: name of column </strong> </p> <p> <strong> No properties. </strong> </p> <p> <strong> Example </strong> </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl">- <span class="l">fname</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span>- <span class="nt">lname</span><span class="p">:</span><span class="w"> </span><span class="l">last_name</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span>- <span class="l">address</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span>- <span class="l">gender</span><span class="w"> </span></span></span></code></pre> </div> <p> <a name="inactive_record_mapping"> </a> </p> <h2 id="inactive_record_mapping-used-for-type2-load_strategy-the-columns-mapping-to-use-to-close-out-an-active-record"> inactive_record_mapping[]: Used for `TYPE2` load_strategy. The columns mapping to use to close out an active record </h2> <p> A list of columns to use. Use any valid SQL expression for the source. If 'target' is omitted, will default to the name of the source column </p> <p> <strong> No properties. </strong> </p> <p> <strong> Example </strong> </p> <div class="highlight"> <pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl">- <span class="nt">source</span><span class="p">:</span><span class="w"> </span><span class="l">CURRENT_DATE</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">target</span><span class="p">:</span><span class="w"> </span><span class="l">deletedAt</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"></span>- <span class="nt">source</span><span class="p">:</span><span class="w"> </span><span class="s2">"'Y'"</span><span class="w"> </span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">target</span><span class="p">:</span><span class="w"> </span><span class="l">is_active</span><span class="w"> </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/integrate/write-behind/reference/data-transformation-block-types/relational_write/"/> <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/getex/.html
<section class="prose w-full py-12"> <h1 class="command-name"> GETEX </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">GETEX key [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | PERSIST]</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.2.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> @write </code> <span class="mr-1 last:hidden"> , </span> <code> @string </code> <span class="mr-1 last:hidden"> , </span> <code> @fast </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Get the value of <code> key </code> and optionally set its expiration. <code> GETEX </code> is similar to <a href="/docs/latest/commands/get/"> <code> GET </code> </a> , but is a write command with additional options. </p> <h2 id="options"> Options </h2> <p> The <code> GETEX </code> command supports a set of options that modify its behavior: </p> <ul> <li> <code> EX </code> <em> seconds </em> -- Set the specified expire time, in seconds. </li> <li> <code> PX </code> <em> milliseconds </em> -- Set the specified expire time, in milliseconds. </li> <li> <code> EXAT </code> <em> timestamp-seconds </em> -- Set the specified Unix time at which the key will expire, in seconds. </li> <li> <code> PXAT </code> <em> timestamp-milliseconds </em> -- Set the specified Unix time at which the key will expire, in milliseconds. </li> <li> <a href="/docs/latest/commands/persist/"> <code> PERSIST </code> </a> -- Remove the time to live associated with the key. </li> </ul> <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; GETEX mykey "Hello" redis&gt; TTL mykey (integer) -1 redis&gt; GETEX mykey EX 60 "Hello" redis&gt; TTL mykey (integer) 60 </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#bulk-strings"> Bulk string reply </a> : the value of <code> key </code> <a href="../../develop/reference/protocol-spec#bulk-strings"> Nil reply </a> : if <code> key </code> does not exist. <h2 id="resp3-reply"> RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : the value of <code> key </code> <a href="../../develop/reference/protocol-spec#nulls"> Null reply </a> : if <code> key </code> does not exist. <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/getex/"/> <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/reference/debezium/oracle/.html
<section class="prose w-full py-12 max-w-none"> <h1> Write-behind configuration for oracle </h1> <p class="text-lg -mt-5 mb-10"> Describes the <code> application.properties </code> settings that configure Debezium Server for oracle </p> <h2 id="applicationproperties"> application.properties </h2> <div class="highlight"> <pre class="chroma"><code class="language-properties" data-lang="properties"><span class="line"><span class="cl"><span class="na">debezium.sink.type</span><span class="o">=</span><span class="s">redis</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.message.format</span><span class="o">=</span><span class="s">extended</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.address</span><span class="o">=</span><span class="s">&lt;RDI_HOST&gt;:&lt;RDI_PORT&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Comment the following line if not using a password for Write-behind.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.password</span><span class="o">=</span><span class="s">&lt;RDI_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.memory.limit.mb</span><span class="o">=</span><span class="s">80</span> </span></span><span class="line"><span class="cl"><span class="c1"># Redis SSL/TLS</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.ssl.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1"># When Redis is configured with a replica shard, these properties allow to verify that the data has been written to the replica.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.timeout.ms=1000</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.retry.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.retry.delay.ms=1000</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.database.history.redis.ssl.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1"># Location of the Java keystore file containing an application process' own certificate and private key.</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.keyStore=&lt;KEY_STORE_FILE_PATH&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Password to access the private key from the keystore file specified by javax.net.ssl.keyStore. This password is used twice: To unlock the keystore file (store password), and To decrypt the private key stored in the keystore (key password).</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.keyStorePassword=&lt;KEY_STORE_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Location of the Java keystore file containing the collection of CA certificates trusted by this application process (trust store).</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.trustStore=&lt;TRUSE_STORE_FILE_PATH&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1"># Password to unlock the keystore file (store password) specified by javax.net.ssl.trustStore.</span> </span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.trustStorePassword=&lt;TRUST_STORE_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.connector.class</span><span class="o">=</span><span class="s">io.debezium.connector.oracle.OracleConnector</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.log.mining.strategy</span><span class="o">=</span><span class="s">online_catalog</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.log.mining.transaction.retention.ms</span><span class="o">=</span><span class="s">180000</span> </span></span><span class="line"><span class="cl"><span class="c1"># This mode creates a JDBC query that filters not only operation types at the database level, but also schema, table, and username include/exclude lists.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.log.mining.query.filter.mode</span><span class="o">=</span><span class="s">in</span> </span></span><span class="line"><span class="cl"><span class="c1"># The name of the Oracle Pluggable Database that the connector captures changes from.</span> </span></span><span class="line"><span class="cl"><span class="c1"># For non-CDB installation, do not specify this property.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.database.pdb.name=ORCLPDB1</span> </span></span><span class="line"><span class="cl"><span class="c1"># Enables capturing and serialization of large object (CLOB, NCLOB, and BLOB) column values in change events.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.lob.enabled=true</span> </span></span><span class="line"><span class="cl"><span class="c1"># Specifies the constant that the connector provides to indicate that the original value is unchanged and not provided by the database.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.unavailable.value.placeholder=__debezium_unavailable_value</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.offset.storage</span><span class="o">=</span><span class="s">io.debezium.storage.redis.offset.RedisOffsetBackingStore</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.topic.prefix</span><span class="o">=</span><span class="s">&lt;SOURCE_LOGICAL_SERVER_NAME&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.dbname</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_NAME&gt;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.hostname</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_HOST&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.port</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_PORT&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.user</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_USER&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.database.password</span><span class="o">=</span><span class="s">&lt;SOURCE_DB_PASSWORD&gt;</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.include.schema.changes</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="c1"># Determines whether the connector should omit publishing change events when there are no modifications in the included columns.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.skip.messages.without.change</span><span class="o">=</span><span class="s">true</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.offset.flush.interval.ms</span><span class="o">=</span><span class="s">1000</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.tombstones.on.delete</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.schema.history.internal</span><span class="o">=</span><span class="s">io.debezium.storage.redis.history.RedisSchemaHistory</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Important: Do NOT use `include` and `exclude` table lists at the same time, use either `include` or `exclude`.</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match fully-qualified table identifiers of tables whose changes you want to capture.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.table.include.list=&lt;SCHEMA_NAME.TABLE_NAME1&gt;,&lt;SCHEMA_NAME.TABLE_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match fully-qualified table identifiers for tables whose changes you do not want to capture.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.table.exclude.list=&lt;SCHEMA_NAME.TABLE_NAME1&gt;,&lt;SCHEMA_NAME.TABLE_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Important: Do NOT use include and exclude column lists at the same time, use either include or exclude.</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match the fully-qualified names of columns to include in change event record values.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.column.include.list=&lt;SCHEMA_NAME.TABLE_NAME.COLUMN_NAME1&gt;,&lt;SCHEMA_NAME.TABLE_NAME.COLUMN_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"><span class="c1"># An optional, comma-separated list of regular expressions that match the fully-qualified names of columns to exclude from change event record values.</span> </span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.column.exclude.list=&lt;SCHEMA_NAME.TABLE_NAME.COLUMN_NAME1&gt;,&lt;SCHEMA_NAME.TABLE_NAME.COLUMN_NAME2&gt;...</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Records only DDL statements that are relevant to tables whose changes are being captured by Debezium.</span> </span></span><span class="line"><span class="cl"><span class="c1"># In case of changing the captured tables, run `redis-di reset`.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.schema.history.internal.store.only.captured.tables.ddl</span><span class="o">=</span><span class="s">true</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Whether to include the detailed schema information generated by Debezium in each record written to RDI.</span> </span></span><span class="line"><span class="cl"><span class="c1"># Note: Including the schema reduces the initial sync throughput and is not recommended for large data sets.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.key.converter.schemas.enable</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.value.converter.schemas.enable</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="c1"># When detailed schema information is excluded, handle decimal numeric types as strings.</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.source.decimal.handling.mode</span><span class="o">=</span><span class="s">string</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms</span><span class="o">=</span><span class="s">AddPrefix</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.type</span><span class="o">=</span><span class="s">org.apache.kafka.connect.transforms.RegexRouter</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.regex</span><span class="o">=</span><span class="s">.*</span> </span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.replacement</span><span class="o">=</span><span class="s">data:$0</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># Logging</span> </span></span><span class="line"><span class="cl"><span class="c1"># Uncomment the following lines if running Debezium Server as a Java standalone process (non-containerized).</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.enable=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.path=&lt;LOG_FILE_PATH&gt;</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.max-file-size=100M</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.rotate-on-boot=true</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.file-suffix=.yyyy-MM-dd.gz</span> </span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.max-backup-index=3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># The default minimum log level for every log category, change only quarkus.log.level when needed.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.log.min-level</span><span class="o">=</span><span class="s">TRACE</span> </span></span><span class="line"><span class="cl"><span class="c1"># The default log level for every log category.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.log.level</span><span class="o">=</span><span class="s">INFO</span> </span></span><span class="line"><span class="cl"><span class="c1"># Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.log.console.json</span><span class="o">=</span><span class="s">false</span> </span></span><span class="line"><span class="cl"><span class="c1"># The port on which Debezium exposes Microprofile Health endpoint and other exposed status information.</span> </span></span><span class="line"><span class="cl"><span class="na">quarkus.http.port</span><span class="o">=</span><span class="s">8088</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/integrate/write-behind/reference/debezium/oracle/"/> <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/job_scheduler/rotate_ccs_job_settings/.html
<section class="prose w-full py-12 max-w-none"> <h1> Rotate CCS job settings object </h1> <p class="text-lg -mt-5 mb-10"> Documents the rotate_ccs_job_settings 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> cron_expression </td> <td> string </td> <td> <a href="https://en.wikipedia.org/wiki/Cron#CRON_expression"> CRON expression </a> that defines the CCS rotation schedule </td> </tr> <tr> <td> file_suffix </td> <td> string (default: 5min) </td> <td> String added to the end of the rotated RDB files </td> </tr> <tr> <td> rotate_max_num </td> <td> integer, (range: 1-100) (default: 24) </td> <td> The maximum number of saved RDB files </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/job_scheduler/rotate_ccs_job_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/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.4-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisGraph 2.4 release notes </h1> <p class="text-lg -mt-5 mb-10"> Added Map and Geospatial Point data types. </p> <h2 id="requirements"> Requirements </h2> <p> RedisGraph v2.4.14 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 6.0.0 </li> <li> Minimum Redis Enterprise Software version (cluster): 6.0.8 </li> </ul> <h2 id="v2414-may-2022"> v2.4.14 (May 2022) </h2> <p> This is a maintenance release for RedisGraph 2.4. </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/RedisGraph/RedisGraph/issues/2072"> #2072 </a> , <a href="https://github.com/RedisGraph/RedisGraph/pull/2081"> #2081 </a> CRLF sequences embedded in strings no longer trigger a protocol error when being emitted </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2102"> #2102 </a> New load-time configuration option <code> NODE_CREATION_BUFFER </code> - see <a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/configuration.md#node_creation_buffer"> documentation </a> (MOD-2348) </li> </ul> </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> For Redis Enterprise users who want to upgrade to this patch, this version requires being on version 6.2.8 or later. </div> </div> <h2 id="v2413-december-2021"> v2.4.13 (December 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Performance improvements </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2040"> #2040 </a> Use optimal order of traversals </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2046"> #2046 </a> Avoid serialization of duplicate graph keys (high urgency) </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2033"> #2033 </a> Update RediSearch to 2.0.13 </li> </ul> </li> </ul> <h2 id="v2412-october-2021"> v2.4.12 (October 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> Bug fixes: <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/1981"> #1981 </a> Crash in index scan </li> </ul> </li> </ul> <h2 id="v2411-october-2021"> v2.4.11 (October 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4. </p> <p> Update urgency: <code> MODERATE </code> : Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> Bug fixes: <ul> <li> # <a href="https://github.com/RedisGraph/RedisGraph/issues/1931"> 1931 </a> Fix race condition on calling <a href="/docs/latest/commands/bgsave/"> <code> BGSAVE </code> </a> while flushing matrices </li> <li> # <a href="https://github.com/RedisGraph/RedisGraph/issues/1898"> 1898 </a> Error when setting a property to an array containing an invalid type </li> <li> # <a href="https://github.com/RedisGraph/RedisGraph/issues/1897"> 1897 </a> Aliases in <code> WITH...ORDER BY </code> must be valid references% </li> </ul> </li> </ul> <h2 id="v2410-september-2021"> v2.4.10 (September 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4 </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Critical bug fixes: </p> <ul> <li> # <a href="https://github.com/RedisGraph/RedisGraph/issues/1911"> 1911 </a> When a query timeout is set and the graph contained indexes, a crash could occur while releasing indexes </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> # <a href="https://github.com/RedisGraph/RedisGraph/issues/1913"> 1913 </a> Update thread-local AST for every cloned operation </li> <li> # <a href="https://github.com/RedisGraph/RedisGraph/issues/1915"> 1915 </a> Validate function references in parameters% </li> </ul> </li> </ul> <h2 id="v247-july-2021"> v2.4.7 (July 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4 </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> Bug fixes: <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1746"> 1746 </a> Avoid invalid memory access after reallocating labels array </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1748"> 1748 </a> Only allocate space for deleted nodes and edges </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1749"> 1749 </a> , # <a href="https://github.com/redisgraph/redisgraph/issues/1730"> 1730 </a> Support updating properties with map referenced by parameter or variable </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1754"> 1754 </a> Map should return volatile data </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1773"> 1773 </a> Matrix resize doesn't set both rows and columns atomically </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1799"> 1799 </a> Always instantiate new persistent matrices as sparse% </li> </ul> </li> </ul> <h2 id="v246-june-2021"> v2.4.6 (June 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4 </p> <p> Update urgency: Medium </p> <p> Details: </p> <ul> <li> <p> Performance improvements: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1702"> 1702 </a> Optimize matrix synchronization in GRAPH.BULK commands </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1716"> 1716 </a> Reduce lock calls in retrieving matrices for reading </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1741"> 1741 </a> Improve edge extraction </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1388"> 1388 </a> Node creation buffer </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1724"> 1724 </a> Update RediSearch 2.0 </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1731"> 1731 </a> Release lock after MergeCreate builds entities </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1734"> 1734 </a> Added multi edge flag </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1726"> 1726 </a> JsonEncoder: invalid cast </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1709"> 1709 </a> #1712 Fix potential deadlock in BGSAVE </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1703"> 1703 </a> Uniquing logic in UNION subqueries </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1720"> 1720 </a> Propagate configuration updates to replicas </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1714"> 1714 </a> Don't build scan operations for bound variables </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1708"> 1708 </a> Regression in GRAPH.CONFIG GET * </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1715"> 1715 </a> Validate function private data before freeing it </li> </ul> </li> <li> <p> Miscellaneous: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1691"> 1691 </a> Reword error message on setting property value to invalid type </li> </ul> </li> </ul> <h2 id="v244-15-may-2021"> v2.4.4 (15 May 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4. </p> <p> Update urgency: Medium </p> <p> Details: </p> <ul> <li> <p> Minor Enhancements: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1666"> 1666 </a> Add configuration parameter to limit the memory usage of queries </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1639"> 1639 </a> Add functionality to SET all properties on an entity to a map </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1678"> 1678 </a> Crash on multiple procedure calls in a single query </li> </ul> </li> </ul> <h2 id="v243-8-may-2021"> v2.4.3 (8 May 2021) </h2> <p> This is a maintenance release for RedisGraph 2.4. </p> <p> Update urgency: Medium </p> <p> Details: </p> <ul> <li> <p> Features: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1657"> 1657 </a> Support filtering on variable-length edges in traversals </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1514"> 1514 </a> Add support for shortestPath in MATCH clauses </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1664"> 1664 </a> Add support for limiting max queued queries </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1653"> 1653 </a> , # <a href="https://github.com/redisgraph/redisgraph/issues/1655"> 1655 </a> Add support for square root (sqrt) function </li> </ul> </li> <li> <p> Performance improvements: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1641"> 1641 </a> Use indexes when filters can only be resolved at runtime </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1668"> 1668 </a> Apply path filters after all other filters </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1650"> 1650 </a> Fix memory leak on allocated keys in OpAggregate </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1671"> 1671 </a> Disallow nested aggregates in map values, circumventing a bug that introduced invalid group keys </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1644"> 1644 </a> Fix bug in which values for unknown schema types are cached </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1656"> 1656 </a> Fix potential crash when releasing thread pools on server shutdown </li> </ul> </li> </ul> <h2 id="v24-ga-march-2021"> v2.4 GA (March 2021) </h2> <p> Headlines: </p> <ul> <li> This release introduces the Map and Geospatial Point data types. </li> </ul> <p> Details: </p> <ul> <li> <p> Features: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1514"> 1514 </a> Add support for Map data type. </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1516"> 1516 </a> Add support for Geospatial Point data type. </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1562"> 1562 </a> Add <code> toJSON </code> function. </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1607"> 1607 </a> Querying full-text indexes can yield the <code> score </code> of each result. </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1610"> 1610 </a> Expose runtime configuration for read query timeouts. </li> </ul> </li> <li> <p> Performance improvements: </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1596"> 1596 </a> <a href="https://github.com/RedisGraph/redisgraph-bulk-loader"> Redisgraph-bulk-loader </a> no longer blocks the server. </li> </ul> </li> <li> <p> Minor Enhancements </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1590"> 1590 </a> Improve handling of runtime errors. </li> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1580"> 1580 </a> Enable assertions in debug mode. </li> </ul> </li> <li> <p> Bugfixes (compared to RC1) </p> <ul> <li> # <a href="https://github.com/redisgraph/redisgraph/issues/1618"> 1618 </a> Fix relationship types being omitted in traversals of 3 or more types. </li> </ul> </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> This is the first GA version of 2.4. The version inside Redis will be 2.4.2 in semantic versioning. Since the version of a module in Redis is numeric, we could not add an GA flag. </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/redisgraph/redisgraph-2.4-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/oss_and_stack/management/troubleshooting/.html
<section class="prose w-full py-12 max-w-none"> <h1> Troubleshooting Redis </h1> <p class="text-lg -mt-5 mb-10"> Problems with Redis? Start here. </p> <p> This page tries to help you with what to do if you have issues with Redis. Part of the Redis project is helping people that are experiencing problems because we don't like to leave people alone with their issues. </p> <ul> <li> If you have <strong> latency problems </strong> with Redis, that in some way appears to be idle for some time, read our <a href="/docs/latest/operate/oss_and_stack/management/optimization/latency/"> Redis latency troubleshooting guide </a> . </li> <li> Redis stable releases are usually very reliable, however in the rare event you are <strong> experiencing crashes </strong> the developers can help a lot more if you provide debugging information. Please read our <a href="/docs/latest/operate/oss_and_stack/management/debugging/"> Debugging Redis guide </a> . </li> <li> We have a long history of users experiencing crashes with Redis that actually turned out to be servers with <strong> broken RAM </strong> . Please test your RAM using <strong> redis-server --test-memory </strong> in case Redis is not stable in your system. Redis built-in memory test is fast and reasonably reliable, but if you can you should reboot your server and use <a href="http://memtest86.com"> memtest86 </a> . </li> </ul> <p> For every other problem please drop a message to the <a href="http://groups.google.com/group/redis-db"> Redis Google Group </a> . We will be glad to help. </p> <p> You can also find assistance on the <a href="https://discord.gg/redis"> Redis Discord server </a> . </p> <h3 id="list-of-known-critical-bugs-in-redis-30x-28x-and-26x"> List of known critical bugs in Redis 3.0.x, 2.8.x and 2.6.x </h3> <p> To find a list of critical bugs please refer to the changelogs: </p> <ul> <li> <a href="https://raw.githubusercontent.com/redis/redis/3.0/00-RELEASENOTES"> Redis 3.0 Changelog </a> . </li> <li> <a href="https://raw.githubusercontent.com/redis/redis/2.8/00-RELEASENOTES"> Redis 2.8 Changelog </a> . </li> <li> <a href="https://raw.githubusercontent.com/redis/redis/2.6/00-RELEASENOTES"> Redis 2.6 Changelog </a> . </li> </ul> <p> Check the <em> upgrade urgency </em> level in each patch release to more easily spot releases that included important fixes. </p> <h3 id="list-of-known-linux-related-bugs-affecting-redis"> List of known Linux related bugs affecting Redis. </h3> <ul> <li> Ubuntu 10.04 and 10.10 contain <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/666211"> bugs </a> that can cause performance issues. The default kernels shipped with these distributions are not recommended. Bugs were reported as having affected EC2 instances, but some users also cited server impact. </li> <li> Certain versions of the Xen hypervisor report poor fork() performance. See <a href="/docs/latest/operate/oss_and_stack/management/optimization/latency/"> the latency page </a> for more information. </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/management/troubleshooting/"/> <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-shardnumsub/.html
<section class="prose w-full py-12"> <h1 class="command-name"> PUBSUB SHARDNUMSUB </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">PUBSUB SHARDNUMSUB [shardchannel [shardchannel ...]]</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) for the SHARDNUMSUB subcommand, where N is the number of requested shard channels </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> Returns the number of subscribers for the specified shard channels. </p> <p> Note that it is valid to call this command without channels, in this case it will just return an empty list. </p> <p> Cluster note: in a Redis Cluster, <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="examples"> Examples </h2> <pre tabindex="0"><code>&gt; PUBSUB SHARDNUMSUB orders 1) "orders" 2) (integer) 1 </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : the number of subscribers per shard channel, each even element (including the 0th) is channel name, each odd element is the number of subscribers. <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-shardnumsub/"/> <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/commands/rg-jexecute/.html
<section class="prose w-full py-12 max-w-none"> <h1> RG.JEXECUTE </h1> <p class="text-lg -mt-5 mb-10"> Executes a Java function. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">RG.JEXECUTE &lt;path.to.main.class&gt; <span class="o">[</span>UPGRADE<span class="o">]</span> &lt;JAR file&gt; </span></span></code></pre> </div> <p> Executes a Java function. </p> <p> The code runs immediately if it uses <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/run/"> <code> GearsBuilder.run() </code> </a> . Code that uses <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/register/"> <code> GearsBuilder.register() </code> </a> will run later, every time certain events occur in the database. </p> <h2 id="arguments"> Arguments </h2> <table> <thead> <tr> <th> Name </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> path.to.main.class </td> <td> The path to the main class in the JAR </td> </tr> <tr> <td> JAR file </td> <td> A JAR file that contains the RedisGears code to run or register </td> </tr> <tr> <td> UPGRADE </td> <td> Upgrades registered code to a new version </td> </tr> </tbody> </table> <h2 id="returns"> Returns </h2> <p> If the executed code calls <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/run/"> <code> GearsBuilder.run() </code> </a> , it returns the output of the executed code. </p> <p> For registered code, it returns the string " <code> OK </code> " instead. </p> <h2 id="examples"> Examples </h2> <p> The executed code in this example <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/run/"> runs </a> immediately: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ redis-cli -x RG.JEXECUTE com.domain.packagename.Reviews &lt; /tmp/rgjvmtest-0.0.1-SNAPSHOT.jar </span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"3.6666666666666665"</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>empty array<span class="o">)</span> </span></span></code></pre> </div> <p> This example <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/register/"> registers </a> the RedisGears code to run every time certain database events occur: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ redis-cli -x RG.JEXECUTE com.domain.packagename.App &lt; /tmp/rgjvmtest-0.0.1-SNAPSHOT.jar </span></span><span class="line"><span class="cl">OK </span></span></code></pre> </div> <p> Here's an example of how to upgrade registered code to a new version: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ redis-cli -x RG.JEXECUTE com.domain.packagename.App UPGRADE &lt; /tmp/rgjvmtest-0.0.2-SNAPSHOT.jar </span></span><span class="line"><span class="cl">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/oss_and_stack/stack-with-enterprise/gears-v1/jvm/commands/rg-jexecute/"/> <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/node/.html
<section class="prose w-full py-12 max-w-none"> <h1> Node object </h1> <p class="text-lg -mt-5 mb-10"> An object that represents a node in the cluster </p> <p> An API object that represents a node in the cluster. </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> Cluster unique ID of node (read-only) </td> </tr> <tr> <td> accept_servers </td> <td> boolean (default: true) </td> <td> The node only accepts new shards if <code> accept_servers </code> is <code> true </code> </td> </tr> <tr> <td> addr </td> <td> string </td> <td> Internal IP address of node </td> </tr> <tr> <td> architecture </td> <td> string </td> <td> Hardware architecture (read-only) </td> </tr> <tr> <td> bigredis_storage_path </td> <td> string </td> <td> Flash storage path (read-only) </td> </tr> <tr> <td> bigstore_driver </td> <td> 'ibm-capi-ga1' <br/> 'ibm-capi-ga2' <br/> 'ibm-capi-ga4' <br/> 'speedb' <br/> 'rocksdb' </td> <td> Bigstore driver name or none (deprecated as of Redis Enterprise v7.2, use the <a href="/docs/latest/operate/rs/references/rest-api/objects/cluster/"> cluster object </a> 's bigstore_driver instead) </td> </tr> <tr> <td> bigstore_size </td> <td> integer </td> <td> Storage size of bigstore storage (read-only) </td> </tr> <tr> <td> cores </td> <td> integer </td> <td> Total number of CPU cores (read-only) </td> </tr> <tr> <td> ephemeral_storage_path </td> <td> string </td> <td> Ephemeral storage path (read-only) </td> </tr> <tr> <td> ephemeral_storage_size </td> <td> number </td> <td> Ephemeral storage size (bytes) (read-only) </td> </tr> <tr> <td> external_addr </td> <td> complex object </td> <td> External IP addresses of node. <code> GET </code> <code> /jsonschema </code> to retrieve the object's structure. </td> </tr> <tr> <td> max_listeners </td> <td> integer </td> <td> Maximum number of listeners on the node </td> </tr> <tr> <td> max_redis_servers </td> <td> integer </td> <td> Maximum number of shards on the node </td> </tr> <tr> <td> os_family </td> <td> 'rhel' <br/> 'ubuntu' <br/> 'amzn' </td> <td> Operating system family (read-only) </td> </tr> <tr> <td> os_name </td> <td> string </td> <td> Operating system name (read-only) </td> </tr> <tr> <td> os_semantic_version </td> <td> string </td> <td> Full version number (read-only) </td> </tr> <tr> <td> os_version </td> <td> string </td> <td> Installed OS version (human-readable) (read-only) </td> </tr> <tr> <td> persistent_storage_path </td> <td> string </td> <td> Persistent storage path (read-only) </td> </tr> <tr> <td> persistent_storage_size </td> <td> number </td> <td> Persistent storage size (bytes) (read- only) </td> </tr> <tr> <td> public_addr </td> <td> string </td> <td> Public IP address of node (deprecated as of Redis Enterprise v4.3.3, use external_addr instead) </td> </tr> <tr> <td> rack_id </td> <td> string </td> <td> Rack ID where node is installed </td> </tr> <tr> <td> recovery_path </td> <td> string </td> <td> Recovery files path </td> </tr> <tr> <td> shard_count </td> <td> integer </td> <td> Number of shards on the node (read-only) </td> </tr> <tr> <td> shard_list </td> <td> array of integers </td> <td> Cluster unique IDs of all node shards </td> </tr> <tr> <td> software_version </td> <td> string </td> <td> Installed Redis Enterprise cluster software version (read-only) </td> </tr> <tr> <td> status </td> <td> 'active' <br/> 'decommissioning' <br/> 'down' <br/> 'provisioning' </td> <td> Node status (read-only) </td> </tr> <tr> <td> supported_database_versions </td> <td> <pre><code> [{ "db_type": string, "version": string }, ...] </code></pre> </td> <td> Versions of Redis Community Edition databases supported by Redis Enterprise Software on the node (read-only) <br/> <strong> db_type </strong> : Type of database <br/> <strong> version </strong> : Version of database </td> </tr> <tr> <td> system_time </td> <td> string </td> <td> System time (UTC) (read-only) </td> </tr> <tr> <td> total_memory </td> <td> integer </td> <td> Total memory of node (bytes) (read-only) </td> </tr> <tr> <td> uptime </td> <td> integer </td> <td> System uptime (seconds) (read-only) </td> </tr> <tr> <td> use_internal_ipv6 </td> <td> boolean (default: false) </td> <td> Node uses IPv6 for internal communication. Value is taken from bootstrap identity (read-only) </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/node/"/> <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.50.0/.html
<section class="prose w-full py-12"> <h1> Redis Insight v2.50.0, May 2024 </h1> <p class="text-lg -mt-5 mb-10"> Redis Insight v2.50 </p> <h2 id="250-may-2024"> 2.50 (May 2024) </h2> <p> This is the General Availability (GA) release of Redis Insight 2.50. </p> <h3 id="highlights"> Highlights </h3> <ul> <li> New tutorial exploring several common Redis use cases with paired-up sample data that will get you started quicker with your empty database. </li> <li> Performance and UX enhancements for the JSON data structure for smoother data rendering and interaction in the Browser. </li> </ul> <h3 id="details"> Details </h3> <p> <strong> Features and improvements </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3402"> #3402 </a> New tutorial exploring several common Redis use cases with paired-up sample data that will get you started quicker with your empty database. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3251"> #3251 </a> UX enhancements for the JSON data structure in the Browser to prevent collapsing the entire structure when updating a JSON value. Includes performance optimizations for loading JSON documents containing numerous objects. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3161"> #3161 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/3171"> #3171 </a> Added a quick access button to sign in to your Redis Cloud account from anywhere within Redis Insight, to import existing databases or create a new account with a free database. Integration with your Redis Cloud account is currently available only in the desktop Redis Insight version. </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/3349"> #3349 </a> Changed the sorting order in the Tree view to lexicographical. </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.50.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/develop/use/.html
<section class="prose w-full py-12 max-w-none"> <h1> Use Redis </h1> <p class="text-lg -mt-5 mb-10"> A developer's guide to Redis </p> <nav> <a href="/docs/latest/develop/use/keyspace/"> Keyspace </a> <p> Managing keys in Redis: Key expiration, scanning, altering and querying the key space </p> <a href="/docs/latest/develop/use/pipelining/"> Redis pipelining </a> <p> How to optimize round-trip times by batching Redis commands </p> <a href="/docs/latest/develop/use/keyspace-notifications/"> Redis keyspace notifications </a> <p> Monitor changes to Redis keys and values in real time </p> <a href="/docs/latest/develop/use/patterns/"> Redis programming patterns </a> <p> Novel patterns for working with Redis data structures </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/develop/use/"/> <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/cli-utilities/crdb-cli/.html
<section class="prose w-full py-12 max-w-none"> <h1> crdb-cli </h1> <p class="text-lg -mt-5 mb-10"> Manage Active-Active databases. </p> <p> An <a href="/docs/latest/operate/rs/databases/active-active/"> Active-Active database </a> (also known as CRDB or conflict-free replicated database) replicates your data across Redis Enterprise Software clusters located in geographically distributed regions. Active-Active databases allow read-write access in all locations, making them ideal for distributed applications that require fast response times and disaster recovery. </p> <p> The Active-Active database on an individual cluster is called an <strong> instance </strong> . Each cluster that hosts an instance is called a <strong> participating cluster </strong> . </p> <p> An Active-Active database requires two or more participating clusters. Each instance is responsible for updating the instances that reside on other participating clusters with the transactions it receives. Write conflicts are resolved using <a href="/docs/latest/operate/rs/databases/active-active/"> conflict-free replicated data types </a> (CRDTs). </p> <p> To programmatically maintain an Active-Active database and its instances, you can use the <code> crdb-cli </code> command-line tool. </p> <h2 id="crdb-cli-commands"> <code> crdb-cli </code> commands </h2> <table> <thead> <tr> <th style="text-align:left"> Command </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/"> crdb </a> </td> <td style="text-align:left"> Manage Active-Active databases. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/task/"> task </a> </td> <td style="text-align:left"> Manage Active-Active tasks. </td> </tr> </tbody> </table> <h2 id="use-the-crdb-cli"> Use the crdb-cli </h2> <p> To use the <code> crdb-cli </code> tool, use SSH to sign in to a Redis Enterprise host with a user that belongs to the group that Redis Enterprise Software was installed with (Default: <strong> redislabs </strong> ). If you sign in with a non-root user, you must add <code> /opt/redislabs/bin/ </code> to your <code> PATH </code> environment variables. </p> <p> <code> crdb-cli </code> commands use the syntax: <code> crdb-cli &lt;command&gt; &lt;arguments&gt; </code> to let you: </p> <ul> <li> Create, list, update, flush, or delete an Active-Active database. </li> <li> Add or remove an instance of the Active-Active database on a specific cluster. </li> </ul> <p> Each command creates a task. </p> <p> By default, the command runs immediately and displays the result in the output. </p> <p> If you use the <nobr> <code> --no-wait </code> </nobr> flag, the command runs in the background so that your application is not delayed by the response. </p> <p> Use the <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/task/"> <code> crdb-cli task </code> commands </a> to manage Active-Active database tasks. </p> <p> For each <code> crdb-cli </code> command, you can use <nobr> <code> --help </code> </nobr> for additional information about the command. </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/references/cli-utilities/crdb-cli/"/> <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/hyperloglog/.html
<section class="prose w-full py-12 max-w-none"> <h1> HyperLogLog in Active-Active databases </h1> <p class="text-lg -mt-5 mb-10"> Information about using hyperloglog with an Active-Active database. </p> <p> <strong> HyperLogLog </strong> is an algorithm that addresses the <a href="https://en.wikipedia.org/wiki/Count-distinct_problem"> count-distinct problem </a> . To do this it approximates the numbers of items in a <a href="https://en.wikipedia.org/wiki/Multiset"> set </a> . Determining the <em> exact </em> cardinality of a set requires memory according to the cardinality of the set. Because it estimates the cardinality by probability, the HyperLogLog algorithm can run with more reasonable memory requirements. </p> <h2 id="hyperloglog-in-redis"> HyperLogLog in Redis </h2> <p> Redis Community Edition implements <a href="https://redislabs.com/redis-best-practices/counting/hyperloglog/"> HyperLogLog </a> (HLL) as a native data structure. It supports adding elements ( <a href="/docs/latest/commands/pfadd/"> PFADD </a> to an HLL, counting elements ( <a href="/docs/latest/commands/pfcount/"> PFCOUNT </a> of HLLs, and merging of ( <a href="/docs/latest/commands/pfmerge/"> PFMERGE </a> HLLs. </p> <p> Here is an example of a simple write case: </p> <table> <thead> <tr> <th> Time </th> <th> Replica 1 </th> <th> Replica 2 </th> </tr> </thead> <tbody> <tr> <td> t1 </td> <td> PFADD hll x </td> <td> </td> </tr> <tr> <td> t2 </td> <td> --- sync --- </td> <td> </td> </tr> <tr> <td> t3 </td> <td> </td> <td> PFADD hll y </td> </tr> <tr> <td> t4 </td> <td> --- sync --- </td> <td> </td> </tr> <tr> <td> t5 </td> <td> PFCOUNT hll --&gt; 2 </td> <td> PFCOUNT hll --&gt; 2 </td> </tr> </tbody> </table> <p> Here is an example of a concurrent add case: </p> <table> <thead> <tr> <th> Time </th> <th> Replica 1 </th> <th> Replica 2 </th> </tr> </thead> <tbody> <tr> <td> t1 </td> <td> PFADD hll x </td> <td> PFADD hll y </td> </tr> <tr> <td> t2 </td> <td> PFCOUNT hll --&gt; 1 </td> <td> PFCOUNT hll --&gt; 1 </td> </tr> <tr> <td> t3 </td> <td> --- sync --- </td> <td> </td> </tr> <tr> <td> t4 </td> <td> PFCOUNT hll --&gt; 2 </td> <td> PFCOUNT hll --&gt; 2 </td> </tr> </tbody> </table> <h2 id="the-del-wins-approach"> The DEL-wins approach </h2> <p> Other collections in the Redis-CRDT implementation use the observed remove method to resolve conflicts. The CRDT-HLL uses the DEL-wins method. If a DEL request is received at the same time as any other request (ADD/MERGE/EXPIRE) on the HLL-key the replicas consistently converge to delete key. In the observed remove method used by other collections (sets, lists, sorted-sets and hashes), only the replica that received the DEL request removes the elements, but elements added concurrently in other replicas exist in the consistently converged collection. We chose to use the DEL-wins method for the CRDT-HLL to maintain the original time and space complexity of the HLL in Redis Community Edition. </p> <p> Here is an example of a DEL-wins case: </p> <table> <thead> <tr> <th> HLL </th> <th> </th> <th> </th> <th> | </th> <th> Set </th> <th> </th> <th> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> </td> <td> </td> <td> | </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> Time </td> <td> Replica 1 </td> <td> Replica 2 </td> <td> | </td> <td> Time </td> <td> Replica 1 </td> <td> Replica 2 </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> | </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> t1 </td> <td> PFADD h e1 </td> <td> </td> <td> | </td> <td> t1 </td> <td> SADD s e1 </td> <td> </td> </tr> <tr> <td> t2 </td> <td> --- sync --- </td> <td> </td> <td> | </td> <td> t2 </td> <td> --- sync --- </td> <td> </td> </tr> <tr> <td> t3 </td> <td> PFCOUNT h --&gt; 1 </td> <td> PFCOUNT h --&gt; 1 </td> <td> | </td> <td> t3 </td> <td> SCARD s --&gt; 1 </td> <td> SCARD s --&gt; 1 </td> </tr> <tr> <td> t4 </td> <td> PFADD h e2 </td> <td> Del h </td> <td> | </td> <td> t4 </td> <td> SADD s e2 </td> <td> Del S </td> </tr> <tr> <td> t5 </td> <td> PFCOUNT h --&gt; 2 </td> <td> PFCOUNT h --&gt; 0 </td> <td> | </td> <td> t5 </td> <td> SCARD s --&gt; 2 </td> <td> SCARD s --&gt; 0 </td> </tr> <tr> <td> t6 </td> <td> --- sync --- </td> <td> </td> <td> | </td> <td> t6 </td> <td> --- sync --- </td> <td> </td> </tr> <tr> <td> t7 </td> <td> PFCOUNT h --&gt; 0 </td> <td> PFCOUNT h --&gt; 0 </td> <td> | </td> <td> t7 </td> <td> SCARD s --&gt; 1 </td> <td> SCARD s --&gt; 1 </td> </tr> <tr> <td> t8 </td> <td> Exists h --&gt; 0 </td> <td> Exists h --&gt; 0 </td> <td> | </td> <td> t8 </td> <td> Exists s --&gt; 1 </td> <td> Exists s --&gt; 1 </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> | </td> <td> t9 </td> <td> SMEMBERS s --&gt; {e2} </td> <td> SMEMBERS s --&gt; {e2} </td> </tr> </tbody> </table> <h2 id="hll-in-active-active-databases-versus-hll-in-redis-community-edition"> HLL in Active-Active databases versus HLL in Redis Community Edition </h2> <p> In Active-Active databases, we implemented HLL within the CRDT on the basis of the Redis implementation with a few exceptions: </p> <ul> <li> Redis keeps the HLL data structure as an encoded string object such that you can potentially run any string request can on a key that contains an HLL. In CRDT, only get and set are supported for HLL. </li> <li> In CRDT, if you do SET on a key that contains a value encoded as an HLL, then the value will remain an HLL. If the value is not encoded as HLL, then it will be a register. </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/databases/active-active/develop/data-types/hyperloglog/"/> <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/certificate/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin cluster certificate </h1> <p class="text-lg -mt-5 mb-10"> Sets the cluster certificate. </p> <p> Sets a cluster certificate to a specified PEM file. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster certificate </span></span><span class="line"><span class="cl"> <span class="nb">set</span> &lt;certificate name&gt; </span></span><span class="line"><span class="cl"> certificate_file &lt;certificate filepath&gt; </span></span><span class="line"><span class="cl"> <span class="o">[</span> key_file &lt;key filepath&gt; <span class="o">]</span> </span></span></code></pre> </div> <p> To set a certificate for a specific service, use the corresponding certificate name. See the <a href="/docs/latest/operate/rs/7.4/security/certificates/"> certificates table </a> for the list of cluster certificates and their descriptions. </p> <h3 id="parameters"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> certificate name </td> <td> 'cm' <br/> 'api' <br/> 'proxy' <br/> 'syncer' <br/> 'metrics_exporter' </td> <td> Name of the certificate to update </td> </tr> <tr> <td> certificate_file </td> <td> filepath </td> <td> Path to the certificate file </td> </tr> <tr> <td> key_file </td> <td> filepath </td> <td> Path to the key file (optional) </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Reports that the certificate was set to the specified file. Returns an error message if the certificate fails to update. </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 certificate <span class="nb">set</span> proxy <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> certificate_file /tmp/proxy.pem </span></span><span class="line"><span class="cl">Set proxy certificate to contents of file /tmp/proxy.pem </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/certificate/"/> <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/development/.html
<section class="prose w-full py-12"> <h1> Development </h1> <p class="text-lg -mt-5 mb-10"> Developing RedisTimeSeries </p> <p> Developing RedisTimeSeries involves setting up the development environment (which can be either Linux-based or macOS-based), building the RedisTimeSeries module, running tests and benchmarks, and debugging both the RedisTimeSeries module and its tests. </p> <h2 id="cloning-the-git-repository"> Cloning the git repository </h2> <p> By invoking the following command, the RedisTimeSeries module and its submodules are cloned: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">git clone --recursive https://github.com/RedisTimeSeries/RedisTimeSeries.git </span></span></code></pre> </div> <h2 id="working-in-an-isolated-environment"> Working in an isolated environment </h2> <p> There are several reasons to develop in an isolated environment, like keeping your workstation clean, and developing for a different Linux distribution. The most general option for an isolated environment is a virtual machine (it's very easy to set one up using <a href="https://www.vagrantup.com"> Vagrant </a> ). Docker is even a more agile solution, as it offers an almost instant solution: </p> <pre tabindex="0"><code>ts=$(docker run -d -it -v $PWD:/build debian:bullseye bash) docker exec -it $ts bash </code></pre> <p> Then, from within the container, <code> cd /build </code> and go on as usual. In this mode, all installations remain in the scope of the Docker container. Upon exiting the container, you can either re-invoke the container with the above <code> docker exec </code> or commit the state of the container to an image and re-invoke it on a later stage: </p> <pre tabindex="0"><code>docker commit $ts ts1 docker stop $ts ts=$(docker run -d -it -v $PWD:/build ts1 bash) docker exec -it $ts bash </code></pre> <h2 id="installing-prerequisites"> Installing prerequisites </h2> <p> To build and test RedisTimeSeries you needs to install several packages, depending on the underlying OS. Currently, we support the Ubuntu/Debian, CentOS, Fedora, and macOS. </p> <p> If you have <code> gnu make </code> installed, you can execute </p> <pre tabindex="0"><code>cd RedisTimeSeries make setup </code></pre> <p> Alternatively, just invoke the following: </p> <pre tabindex="0"><code>cd RedisTimeSeries git submodule update --init --recursive ./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. <code> sudo </code> ) on Linux. </p> <p> If you prefer to avoid that, you can: </p> <ul> <li> Review <code> system-setup.py </code> and install packages manually, </li> <li> Use an isolated environment like explained above, </li> <li> Utilize a Python virtual environment, as Python installations known to be sensitive when not used in isolation. </li> </ul> <h2 id="installing-redis"> Installing Redis </h2> <p> As a rule of thumb, you're better off running the latest Redis version. </p> <p> If your OS has a Redis package, you can install it using the OS package manager. </p> <p> Otherwise, you can invoke <code> ./deps/readies/bin/getredis </code> . </p> <h2 id="getting-help"> Getting help </h2> <p> <code> make help </code> provides a quick summary of the development features. </p> <h2 id="building-from-source"> Building from source </h2> <p> <code> make </code> will build RedisTimeSeries. </p> <p> Build artifacts are placed into <code> bin/linux-x64-release </code> (or similar, according to your platform and build options). </p> <p> Use <code> make clean </code> to remove built artifacts. <code> make clean ALL=1 </code> will remove the entire binary artifacts directory. </p> <h2 id="running-redis-with-redistimeseries"> Running Redis with RedisTimeSeries </h2> <p> The following will run <code> redis </code> and load the RedisTimeSeries module. </p> <pre tabindex="0"><code>make run </code></pre> <p> You can open <code> redis-cli </code> in another terminal to interact with it. </p> <h2 id="running-tests"> Running tests </h2> <p> The module includes a basic set of unit tests and integration tests: </p> <ul> <li> C unit tests, located in <code> src/tests </code> , run by <code> make unit_tests </code> . </li> <li> Python integration tests (enabled by RLTest), located in <code> tests/flow </code> , run by <code> make flow_tests </code> . </li> </ul> <p> One can run all tests by invoking <code> make test </code> . A single test can be run using the <code> TEST </code> parameter, e.g. <code> make flow_test TEST=file:name </code> . </p> <h2 id="debugging"> Debugging </h2> <p> To build for debugging (enabling symbolic information and disabling optimization), run <code> make DEBUG=1 </code> . You can the use <code> make run DEBUG=1 </code> to invoke <code> gdb </code> . In addition to the usual way to set breakpoints in <code> gdb </code> , it is possible to use the <code> BB </code> macro to set a breakpoint inside the RedisTimeSeries code. It will only have an effect when running under <code> gdb </code> . </p> <p> Similarly, Python tests in a single-test mode, one can set a breakpoint by using the <code> BB() </code> function inside a test. This will invoke <code> pudb </code> . </p> <p> The two methods can be combined: one can set a breakpoint within a flow test, and when reached, connect <code> gdb </code> to a <code> redis-server </code> process to debug the module. </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/data-types/timeseries/development/"/> <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-numpat/.html
<section class="prose w-full py-12"> <h1 class="command-name"> PUBSUB NUMPAT </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">PUBSUB NUMPAT</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> @pubsub </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns the number of unique patterns that are subscribed to by clients (that are performed using the <a href="/docs/latest/commands/psubscribe/"> <code> PSUBSCRIBE </code> </a> command). </p> <p> Note that this isn't the count of clients subscribed to patterns, but the total number of unique patterns all the clients are subscribed to. </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#integers"> Integer reply </a> : the number of patterns all the clients are subscribed to. <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-numpat/"/> <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/redisvl/api/searchindex/.html
<section class="prose w-full py-12 max-w-none"> <h1> Search index </h1> <p class="text-lg -mt-5 mb-10"> The search index APIs </p> <table> <thead> <tr> <th> Class </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> SearchIndex </td> <td> Primary class to write, read, and search across data structures in Redis. </td> </tr> <tr> <td> AsyncSearchIndex </td> <td> Async version of the SearchIndex to write, read, and search across data structures in Redis. </td> </tr> </tbody> </table> <h2 id="searchindex"> SearchIndex </h2> <p> <a id="searchindex-api"> </a> </p> <h3 id="class-searchindexschema-redis_clientnone-redis_urlnone-connection_args-kwargs"> <em> class </em> SearchIndex(schema, redis_client=None, redis_url=None, connection_args={}, **kwargs) </h3> <p> A search index class for interacting with Redis as a vector database. </p> <p> The SearchIndex is instantiated with a reference to a Redis database and an IndexSchema (YAML path or dictionary object) that describes the various settings and field configurations. </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">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># initialize the index object with schema from file</span> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s2">"schemas/schema.yaml"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">redis_url</span><span class="o">=</span><span class="s2">"redis://localhost:6379"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># create the index</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</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="c1"># data is an iterable of dictionaries</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># delete index and data</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span></code></pre> </div> <p> Initialize the RedisVL search index with a schema, Redis client (or URL string with other connection args), connection_args, and other kwargs. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> schema </strong> ( <a href="schema.md#redisvl.schema.IndexSchema"> <em> IndexSchema </em> </a> ) – Index schema object. </li> <li> <strong> redis_client </strong> ( <em> Union </em> *[* <em> redis.Redis </em> <em> , </em> <em> aredis.Redis </em> <em> ] </em> <em> , </em> <em> optional </em> ) – An instantiated redis client. </li> <li> <strong> redis_url </strong> ( <em> str </em> <em> , </em> <em> optional </em> ) – The URL of the Redis server to connect to. </li> <li> <strong> connection_args </strong> ( <em> Dict </em> *[* <em> str </em> <em> , </em> <em> Any </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Redis client connection args. </li> </ul> </li> </ul> <h3 id="connectredis_urlnone-kwargs"> connect(redis_url=None, **kwargs) </h3> <p> Connect to a Redis instance using the provided redis_url, falling back to the REDIS_URL environment variable (if available). </p> <p> Note: Additional keyword arguments (**kwargs) can be used to provide extra options specific to the Redis connection. </p> <ul> <li> <strong> Parameters: </strong> <strong> redis_url </strong> ( <em> Optional </em> *[* <em> str </em> <em> ] </em> <em> , </em> <em> optional </em> ) – The URL of the Redis server to connect to. If not provided, the method defaults to using the REDIS_URL environment variable. </li> <li> <strong> Raises: </strong> <ul> <li> <strong> redis.exceptions.ConnectionError </strong> – If the connection to the Redis server fails. </li> <li> <strong> ValueError </strong> – If the Redis URL is not provided nor accessible through the REDIS_URL environment variable. </li> </ul> </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">redis_url</span><span class="o">=</span><span class="s2">"redis://localhost:6379"</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="createoverwritefalse-dropfalse"> create(overwrite=False, drop=False) </h3> <p> Create an index in Redis with the current schema and properties. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> overwrite </strong> ( <em> bool </em> <em> , </em> <em> optional </em> ) – Whether to overwrite the index if it already exists. Defaults to False. </li> <li> <strong> drop </strong> ( <em> bool </em> <em> , </em> <em> optional </em> ) – Whether to drop all keys associated with the index in the case of overwriting. Defaults to False. </li> </ul> </li> <li> <strong> Raises: </strong> <ul> <li> <strong> RuntimeError </strong> – If the index already exists and ‘overwrite’ is False. </li> <li> <strong> ValueError </strong> – If no fields are defined for the index. </li> </ul> </li> <li> <strong> Return type: </strong> None </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="c1"># create an index in Redis; only if one does not exist with given name</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># overwrite an index in Redis without dropping associated data</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</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="c1"># overwrite an index in Redis; drop associated data (clean slate)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="deletedroptrue"> delete(drop=True) </h3> <p> Delete the search index while optionally dropping all keys associated with the index. </p> <ul> <li> <strong> Parameters: </strong> <strong> drop </strong> ( <em> bool </em> <em> , </em> <em> optional </em> ) – Delete the key / documents pairs in the index. Defaults to True. </li> <li> <strong> Raises: </strong> <strong> redis.exceptions.ResponseError </strong> – If the index does not exist. </li> </ul> <h3 id="disconnect"> disconnect() </h3> <p> Disconnect from the Redis database. </p> <h3 id="exists"> exists() </h3> <p> Check if the index exists in Redis. </p> <ul> <li> <strong> Returns: </strong> True if the index exists, False otherwise. </li> <li> <strong> Return type: </strong> bool </li> </ul> <h3 id="fetchid"> fetch(id) </h3> <p> Fetch an object from Redis by id. </p> <p> The id is typically either a unique identifier, or derived from some domain-specific metadata combination (like a document id or chunk id). </p> <ul> <li> <strong> Parameters: </strong> <strong> id </strong> ( <em> str </em> ) – The specified unique identifier for a particular document indexed in Redis. </li> <li> <strong> Returns: </strong> The fetched object. </li> <li> <strong> Return type: </strong> Dict[str, Any] </li> </ul> <h3 id="classmethod-from_dictschema_dict-kwargs"> <em> classmethod </em> from_dict(schema_dict, **kwargs) </h3> <p> Create a SearchIndex from a dictionary. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> schema_dict </strong> ( <em> Dict </em> *[* <em> str </em> <em> , </em> <em> Any </em> <em> ] </em> ) – A dictionary containing the schema. </li> <li> <strong> connection_args </strong> ( <em> Dict </em> *[* <em> str </em> <em> , </em> <em> Any </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Redis client connection args. </li> </ul> </li> <li> <strong> Returns: </strong> A RedisVL SearchIndex object. </li> <li> <strong> Return type: </strong> <a href="#redisvl.index.SearchIndex"> SearchIndex </a> </li> </ul> <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">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="o">.</span><span class="n">from_dict</span><span class="p">({</span> </span></span><span class="line"><span class="cl"> <span class="s2">"index"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"name"</span><span class="p">:</span> <span class="s2">"my-index"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"prefix"</span><span class="p">:</span> <span class="s2">"rvl"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"storage_type"</span><span class="p">:</span> <span class="s2">"hash"</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">"fields"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"name"</span><span class="p">:</span> <span class="s2">"doc-id"</span><span class="p">,</span> <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"tag"</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> <h3 id="classmethod-from_yamlschema_path-kwargs"> <em> classmethod </em> from_yaml(schema_path, **kwargs) </h3> <p> Create a SearchIndex from a YAML schema file. </p> <ul> <li> <strong> Parameters: </strong> <strong> schema_path </strong> ( <em> str </em> ) – Path to the YAML schema file. </li> <li> <strong> Returns: </strong> A RedisVL SearchIndex object. </li> <li> <strong> Return type: </strong> <a href="#redisvl.index.SearchIndex"> SearchIndex </a> </li> </ul> <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">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s2">"schemas/schema.yaml"</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="info"> info() </h3> <p> Get information about the index. </p> <ul> <li> <strong> Returns: </strong> A dictionary containing the information about the index. </li> <li> <strong> Return type: </strong> dict </li> </ul> <h3 id="keyid"> key(id) </h3> <p> Construct a redis key as a combination of an index key prefix (optional) and specified id. </p> <p> The id is typically either a unique identifier, or derived from some domain-specific metadata combination (like a document id or chunk id). </p> <ul> <li> <strong> Parameters: </strong> <strong> id </strong> ( <em> str </em> ) – The specified unique identifier for a particular document indexed in Redis. </li> <li> <strong> Returns: </strong> The full Redis key including key prefix and value as a string. </li> <li> <strong> Return type: </strong> str </li> </ul> <h3 id="listall"> listall() </h3> <p> List all search indices in Redis database. </p> <ul> <li> <strong> Returns: </strong> The list of indices in the database. </li> <li> <strong> Return type: </strong> List[str] </li> </ul> <h3 id="loaddata-id_fieldnone-keysnone-ttlnone-preprocessnone-batch_sizenone"> load(data, id_field=None, keys=None, ttl=None, preprocess=None, batch_size=None) </h3> <p> Load objects to the Redis database. Returns the list of keys loaded to Redis. </p> <p> RedisVL automatically handles constructing the object keys, batching, optional preprocessing steps, and setting optional expiration (TTL policies) on keys. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> data </strong> ( <em> Iterable </em> *[* <em> Any </em> <em> ] </em> ) – An iterable of objects to store. </li> <li> <strong> id_field </strong> ( <em> Optional </em> *[* <em> str </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Specified field used as the id portion of the redis key (after the prefix) for each object. Defaults to None. </li> <li> <strong> keys </strong> ( <em> Optional </em> *[* <em> Iterable </em> *[* <em> str </em> <em> ] </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Optional iterable of keys. Must match the length of objects if provided. Defaults to None. </li> <li> <strong> ttl </strong> ( <em> Optional </em> *[* <em> int </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Time-to-live in seconds for each key. Defaults to None. </li> <li> <strong> preprocess </strong> ( <em> Optional </em> *[* <em> Callable </em> <em> ] </em> <em> , </em> <em> optional </em> ) – A function to preprocess objects before storage. Defaults to None. </li> <li> <strong> batch_size </strong> ( <em> Optional </em> *[* <em> int </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Number of objects to write in a single Redis pipeline execution. Defaults to class’s default batch size. </li> </ul> </li> <li> <strong> Returns: </strong> List of keys loaded to Redis. </li> <li> <strong> Return type: </strong> List[str] </li> <li> <strong> Raises: </strong> <strong> ValueError </strong> – If the length of provided keys does not match the length of objects. </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">data</span> <span class="o">=</span> <span class="p">[{</span><span class="s2">"test"</span><span class="p">:</span> <span class="s2">"foo"</span><span class="p">},</span> <span class="p">{</span><span class="s2">"test"</span><span class="p">:</span> <span class="s2">"bar"</span><span class="p">}]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># simple case</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># set 360 second ttl policy on data</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">ttl</span><span class="o">=</span><span class="mi">360</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data with predefined keys</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">keys</span><span class="o">=</span><span class="p">[</span><span class="s2">"rvl:foo"</span><span class="p">,</span> <span class="s2">"rvl:bar"</span><span class="p">])</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data with preprocessing step</span> </span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">add_field</span><span class="p">(</span><span class="n">d</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">d</span><span class="p">[</span><span class="s2">"new_field"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">123</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">d</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">preprocess</span><span class="o">=</span><span class="n">add_field</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="paginatequery-page_size30"> paginate(query, page_size=30) </h3> <p> Execute a given query against the index and return results in paginated batches. </p> <p> This method accepts a RedisVL query instance, enabling pagination of results which allows for subsequent processing over each batch with a generator. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> query </strong> ( <em> BaseQuery </em> ) – The search query to be executed. </li> <li> <strong> page_size </strong> ( <em> int </em> <em> , </em> <em> optional </em> ) – The number of results to return in each batch. Defaults to 30. </li> </ul> </li> <li> <strong> Yields: </strong> A generator yielding batches of search results. </li> <li> <strong> Raises: </strong> <ul> <li> <strong> TypeError </strong> – If the page_size argument is not of type int. </li> <li> <strong> ValueError </strong> – If the page_size argument is less than or equal to zero. </li> </ul> </li> <li> <strong> Return type: </strong> <em> Generator </em> </li> </ul> <h3 id="example"> Example </h3> <h1 id="iterate-over-paginated-search-results-in-batches-of-10"> Iterate over paginated search results in batches of 10 </h1> <p> for result_batch in index.paginate(query, page_size=10): </p> <blockquote> <h1 id="process-each-batch-of-results"> Process each batch of results </h1> <p> pass </p> </blockquote> <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 page_size parameter controls the number of items each result batch contains. Adjust this value based on performance considerations and the expected volume of search results. </div> </div> <h3 id="queryquery"> query(query) </h3> <p> Execute a query on the index. </p> <p> This method takes a BaseQuery object directly, runs the search, and handles post-processing of the search. </p> <ul> <li> <strong> Parameters: </strong> <strong> query </strong> ( <em> BaseQuery </em> ) – The query to run. </li> <li> <strong> Returns: </strong> A list of search results. </li> <li> <strong> Return type: </strong> List[Result] </li> </ul> <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">redisvl.query</span> <span class="kn">import</span> <span class="n">VectorQuery</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">VectorQuery</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">vector</span><span class="o">=</span><span class="p">[</span><span class="mf">0.16</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.34</span><span class="p">,</span> <span class="mf">0.98</span><span class="p">,</span> <span class="mf">0.23</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_field_name</span><span class="o">=</span><span class="s2">"embedding"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">num_results</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></span><span class="line"><span class="cl"><span class="n">results</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">query</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="searchargs-kwargs"> search(*args, **kwargs) </h3> <p> Perform a search against the index. </p> <p> Wrapper around redis.search.Search that adds the index name to the search query and passes along the rest of the arguments to the redis-py ft.search() method. </p> <ul> <li> <strong> Returns: </strong> Raw Redis search results. </li> <li> <strong> Return type: </strong> Result </li> </ul> <h3 id="set_clientclient"> set_client(client) </h3> <p> Manually set the Redis client to use with the search index. </p> <p> This method configures the search index to use a specific Redis or Async Redis client. It is useful for cases where an external, custom-configured client is preferred instead of creating a new one. </p> <ul> <li> <strong> Parameters: </strong> <strong> client </strong> ( <em> redis.Redis </em> ) – A Redis or Async Redis client instance to be used for the connection. </li> <li> <strong> Raises: </strong> <strong> TypeError </strong> – If the provided client is not valid. </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><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">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</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="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="s2">"redis://localhost:6379"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s2">"schemas/schema.yaml"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">set_client</span><span class="p">(</span><span class="n">client</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="property-client--redis--redis--none"> <em> property </em> client <em> : Redis | Redis | None </em> </h3> <p> The underlying redis-py client object. </p> <h3 id="property-key_separator--str"> <em> property </em> key_separator <em> : str </em> </h3> <p> The optional separator between a defined prefix and key value in forming a Redis key. </p> <h3 id="property-name--str"> <em> property </em> name <em> : str </em> </h3> <p> The name of the Redis search index. </p> <h3 id="property-prefix--str"> <em> property </em> prefix <em> : str </em> </h3> <p> The optional key prefix that comes before a unique key value in forming a Redis key. </p> <h3 id="property-storage_type--storagetype"> <em> property </em> storage_type <em> : StorageType </em> </h3> <p> The underlying storage type for the search index; either hash or json. </p> <h2 id="asyncsearchindex"> AsyncSearchIndex </h2> <p> <a id="asyncsearchindex-api"> </a> </p> <h3 id="class-asyncsearchindexschema-redis_clientnone-redis_urlnone-connection_args-kwargs"> <em> class </em> AsyncSearchIndex(schema, redis_client=None, redis_url=None, connection_args={}, **kwargs) </h3> <p> A search index class for interacting with Redis as a vector database in async-mode. </p> <p> The AsyncSearchIndex is instantiated with a reference to a Redis database and an IndexSchema (YAML path or dictionary object) that describes the various settings and field configurations. </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">redisvl.index</span> <span class="kn">import</span> <span class="n">AsyncSearchIndex</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># initialize the index object with schema from file</span> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">AsyncSearchIndex</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s2">"schemas/schema.yaml"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">redis_url</span><span class="o">=</span><span class="s2">"redis://localhost:6379"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># create the index</span> </span></span><span class="line"><span class="cl"><span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</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="c1"># data is an iterable of dictionaries</span> </span></span><span class="line"><span class="cl"><span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># delete index and data</span> </span></span><span class="line"><span class="cl"><span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span></code></pre> </div> <p> Initialize the RedisVL search index with a schema, Redis client (or URL string with other connection args), connection_args, and other kwargs. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> schema </strong> ( <a href="schema.md#redisvl.schema.IndexSchema"> <em> IndexSchema </em> </a> ) – Index schema object. </li> <li> <strong> redis_client </strong> ( <em> Union </em> *[* <em> redis.Redis </em> <em> , </em> <em> aredis.Redis </em> <em> ] </em> <em> , </em> <em> optional </em> ) – An instantiated redis client. </li> <li> <strong> redis_url </strong> ( <em> str </em> <em> , </em> <em> optional </em> ) – The URL of the Redis server to connect to. </li> <li> <strong> connection_args </strong> ( <em> Dict </em> *[* <em> str </em> <em> , </em> <em> Any </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Redis client connection args. </li> </ul> </li> </ul> <h3 id="connectredis_urlnone-kwargs-1"> connect(redis_url=None, **kwargs) </h3> <p> Connect to a Redis instance using the provided redis_url, falling back to the REDIS_URL environment variable (if available). </p> <p> Note: Additional keyword arguments (**kwargs) can be used to provide extra options specific to the Redis connection. </p> <ul> <li> <strong> Parameters: </strong> <strong> redis_url </strong> ( <em> Optional </em> *[* <em> str </em> <em> ] </em> <em> , </em> <em> optional </em> ) – The URL of the Redis server to connect to. If not provided, the method defaults to using the REDIS_URL environment variable. </li> <li> <strong> Raises: </strong> <ul> <li> <strong> redis.exceptions.ConnectionError </strong> – If the connection to the Redis server fails. </li> <li> <strong> ValueError </strong> – If the Redis URL is not provided nor accessible through the REDIS_URL environment variable. </li> </ul> </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">redis_url</span><span class="o">=</span><span class="s2">"redis://localhost:6379"</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="async-createoverwritefalse-dropfalse"> <em> async </em> create(overwrite=False, drop=False) </h3> <dl> <dt> Asynchronously create an index in Redis with the current schema </dt> <dd> and properties. </dd> </dl> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> overwrite </strong> ( <em> bool </em> <em> , </em> <em> optional </em> ) – Whether to overwrite the index if it already exists. Defaults to False. </li> <li> <strong> drop </strong> ( <em> bool </em> <em> , </em> <em> optional </em> ) – Whether to drop all keys associated with the index in the case of overwriting. Defaults to False. </li> </ul> </li> <li> <strong> Raises: </strong> <ul> <li> <strong> RuntimeError </strong> – If the index already exists and ‘overwrite’ is False. </li> <li> <strong> ValueError </strong> – If no fields are defined for the index. </li> </ul> </li> <li> <strong> Return type: </strong> None </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="c1"># create an index in Redis; only if one does not exist with given name</span> </span></span><span class="line"><span class="cl"><span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># overwrite an index in Redis without dropping associated data</span> </span></span><span class="line"><span class="cl"><span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</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="c1"># overwrite an index in Redis; drop associated data (clean slate)</span> </span></span><span class="line"><span class="cl"><span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="async-deletedroptrue"> <em> async </em> delete(drop=True) </h3> <p> Delete the search index. </p> <ul> <li> <strong> Parameters: </strong> <strong> drop </strong> ( <em> bool </em> <em> , </em> <em> optional </em> ) – Delete the documents in the index. Defaults to True. </li> <li> <strong> Raises: </strong> <strong> redis.exceptions.ResponseError </strong> – If the index does not exist. </li> </ul> <h3 id="disconnect-1"> disconnect() </h3> <p> Disconnect from the Redis database. </p> <h3 id="async-exists"> <em> async </em> exists() </h3> <p> Check if the index exists in Redis. </p> <ul> <li> <strong> Returns: </strong> True if the index exists, False otherwise. </li> <li> <strong> Return type: </strong> bool </li> </ul> <h3 id="async-fetchid"> <em> async </em> fetch(id) </h3> <p> Asynchronously etch an object from Redis by id. The id is typically either a unique identifier, or derived from some domain-specific metadata combination (like a document id or chunk id). </p> <ul> <li> <strong> Parameters: </strong> <strong> id </strong> ( <em> str </em> ) – The specified unique identifier for a particular document indexed in Redis. </li> <li> <strong> Returns: </strong> The fetched object. </li> <li> <strong> Return type: </strong> Dict[str, Any] </li> </ul> <h3 id="classmethod-from_dictschema_dict-kwargs-1"> <em> classmethod </em> from_dict(schema_dict, **kwargs) </h3> <p> Create a SearchIndex from a dictionary. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> schema_dict </strong> ( <em> Dict </em> *[* <em> str </em> <em> , </em> <em> Any </em> <em> ] </em> ) – A dictionary containing the schema. </li> <li> <strong> connection_args </strong> ( <em> Dict </em> *[* <em> str </em> <em> , </em> <em> Any </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Redis client connection args. </li> </ul> </li> <li> <strong> Returns: </strong> A RedisVL SearchIndex object. </li> <li> <strong> Return type: </strong> <a href="#redisvl.index.SearchIndex"> SearchIndex </a> </li> </ul> <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">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="o">.</span><span class="n">from_dict</span><span class="p">({</span> </span></span><span class="line"><span class="cl"> <span class="s2">"index"</span><span class="p">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s2">"name"</span><span class="p">:</span> <span class="s2">"my-index"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"prefix"</span><span class="p">:</span> <span class="s2">"rvl"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s2">"storage_type"</span><span class="p">:</span> <span class="s2">"hash"</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">"fields"</span><span class="p">:</span> <span class="p">[</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="s2">"name"</span><span class="p">:</span> <span class="s2">"doc-id"</span><span class="p">,</span> <span class="s2">"type"</span><span class="p">:</span> <span class="s2">"tag"</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> <h3 id="classmethod-from_yamlschema_path-kwargs-1"> <em> classmethod </em> from_yaml(schema_path, **kwargs) </h3> <p> Create a SearchIndex from a YAML schema file. </p> <ul> <li> <strong> Parameters: </strong> <strong> schema_path </strong> ( <em> str </em> ) – Path to the YAML schema file. </li> <li> <strong> Returns: </strong> A RedisVL SearchIndex object. </li> <li> <strong> Return type: </strong> <a href="#redisvl.index.SearchIndex"> SearchIndex </a> </li> </ul> <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">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s2">"schemas/schema.yaml"</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="async-info"> <em> async </em> info() </h3> <p> Get information about the index. </p> <ul> <li> <strong> Returns: </strong> A dictionary containing the information about the index. </li> <li> <strong> Return type: </strong> dict </li> </ul> <h3 id="keyid-1"> key(id) </h3> <p> Construct a redis key as a combination of an index key prefix (optional) and specified id. </p> <p> The id is typically either a unique identifier, or derived from some domain-specific metadata combination (like a document id or chunk id). </p> <ul> <li> <strong> Parameters: </strong> <strong> id </strong> ( <em> str </em> ) – The specified unique identifier for a particular document indexed in Redis. </li> <li> <strong> Returns: </strong> The full Redis key including key prefix and value as a string. </li> <li> <strong> Return type: </strong> str </li> </ul> <h3 id="async-listall"> <em> async </em> listall() </h3> <p> List all search indices in Redis database. </p> <ul> <li> <strong> Returns: </strong> The list of indices in the database. </li> <li> <strong> Return type: </strong> List[str] </li> </ul> <h3 id="async-loaddata-id_fieldnone-keysnone-ttlnone-preprocessnone-concurrencynone"> <em> async </em> load(data, id_field=None, keys=None, ttl=None, preprocess=None, concurrency=None) </h3> <p> Asynchronously load objects to Redis with concurrency control. Returns the list of keys loaded to Redis. </p> <p> RedisVL automatically handles constructing the object keys, batching, optional preprocessing steps, and setting optional expiration (TTL policies) on keys. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> data </strong> ( <em> Iterable </em> *[* <em> Any </em> <em> ] </em> ) – An iterable of objects to store. </li> <li> <strong> id_field </strong> ( <em> Optional </em> *[* <em> str </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Specified field used as the id portion of the redis key (after the prefix) for each object. Defaults to None. </li> <li> <strong> keys </strong> ( <em> Optional </em> *[* <em> Iterable </em> *[* <em> str </em> <em> ] </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Optional iterable of keys. Must match the length of objects if provided. Defaults to None. </li> <li> <strong> ttl </strong> ( <em> Optional </em> *[* <em> int </em> <em> ] </em> <em> , </em> <em> optional </em> ) – Time-to-live in seconds for each key. Defaults to None. </li> <li> <strong> preprocess </strong> ( <em> Optional </em> *[* <em> Callable </em> <em> ] </em> <em> , </em> <em> optional </em> ) – An async function to preprocess objects before storage. Defaults to None. </li> <li> <strong> concurrency </strong> ( <em> Optional </em> *[* <em> int </em> <em> ] </em> <em> , </em> <em> optional </em> ) – The maximum number of concurrent write operations. Defaults to class’s default concurrency level. </li> </ul> </li> <li> <strong> Returns: </strong> List of keys loaded to Redis. </li> <li> <strong> Return type: </strong> List[str] </li> <li> <strong> Raises: </strong> <strong> ValueError </strong> – If the length of provided keys does not match the length of objects. </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">data</span> <span class="o">=</span> <span class="p">[{</span><span class="s2">"test"</span><span class="p">:</span> <span class="s2">"foo"</span><span class="p">},</span> <span class="p">{</span><span class="s2">"test"</span><span class="p">:</span> <span class="s2">"bar"</span><span class="p">}]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># simple case</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># set 360 second ttl policy on data</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">ttl</span><span class="o">=</span><span class="mi">360</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data with predefined keys</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">keys</span><span class="o">=</span><span class="p">[</span><span class="s2">"rvl:foo"</span><span class="p">,</span> <span class="s2">"rvl:bar"</span><span class="p">])</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data with preprocessing step</span> </span></span><span class="line"><span class="cl"><span class="k">async</span> <span class="k">def</span> <span class="nf">add_field</span><span class="p">(</span><span class="n">d</span><span class="p">):</span> </span></span><span class="line"><span class="cl"> <span class="n">d</span><span class="p">[</span><span class="s2">"new_field"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">123</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">d</span> </span></span><span class="line"><span class="cl"><span class="n">keys</span> <span class="o">=</span> <span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">preprocess</span><span class="o">=</span><span class="n">add_field</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="async-paginatequery-page_size30"> <em> async </em> paginate(query, page_size=30) </h3> <p> Execute a given query against the index and return results in paginated batches. </p> <p> This method accepts a RedisVL query instance, enabling async pagination of results which allows for subsequent processing over each batch with a generator. </p> <ul> <li> <strong> Parameters: </strong> <ul> <li> <strong> query </strong> ( <em> BaseQuery </em> ) – The search query to be executed. </li> <li> <strong> page_size </strong> ( <em> int </em> <em> , </em> <em> optional </em> ) – The number of results to return in each batch. Defaults to 30. </li> </ul> </li> <li> <strong> Yields: </strong> An async generator yielding batches of search results. </li> <li> <strong> Raises: </strong> <ul> <li> <strong> TypeError </strong> – If the page_size argument is not of type int. </li> <li> <strong> ValueError </strong> – If the page_size argument is less than or equal to zero. </li> </ul> </li> <li> <strong> Return type: </strong> <em> AsyncGenerator </em> </li> </ul> <h3 id="example-1"> Example </h3> <h1 id="iterate-over-paginated-search-results-in-batches-of-10-1"> Iterate over paginated search results in batches of 10 </h1> <p> async for result_batch in index.paginate(query, page_size=10): </p> <blockquote> <h1 id="process-each-batch-of-results-1"> Process each batch of results </h1> <p> pass </p> </blockquote> <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 page_size parameter controls the number of items each result batch contains. Adjust this value based on performance considerations and the expected volume of search results. </div> </div> <h3 id="async-queryquery"> <em> async </em> query(query) </h3> <p> Asynchronously execute a query on the index. </p> <p> This method takes a BaseQuery object directly, runs the search, and handles post-processing of the search. </p> <ul> <li> <strong> Parameters: </strong> <strong> query </strong> ( <em> BaseQuery </em> ) – The query to run. </li> <li> <strong> Returns: </strong> A list of search results. </li> <li> <strong> Return type: </strong> List[Result] </li> </ul> <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">redisvl.query</span> <span class="kn">import</span> <span class="n">VectorQuery</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">VectorQuery</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">vector</span><span class="o">=</span><span class="p">[</span><span class="mf">0.16</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.34</span><span class="p">,</span> <span class="mf">0.98</span><span class="p">,</span> <span class="mf">0.23</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="n">vector_field_name</span><span class="o">=</span><span class="s2">"embedding"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">num_results</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></span><span class="line"><span class="cl"><span class="n">results</span> <span class="o">=</span> <span class="k">await</span> <span class="n">index</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">query</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="async-searchargs-kwargs"> <em> async </em> search(*args, **kwargs) </h3> <p> Perform a search on this index. </p> <p> Wrapper around redis.search.Search that adds the index name to the search query and passes along the rest of the arguments to the redis-py ft.search() method. </p> <ul> <li> <strong> Returns: </strong> Raw Redis search results. </li> <li> <strong> Return type: </strong> Result </li> </ul> <h3 id="set_clientclient-1"> set_client(client) </h3> <p> Manually set the Redis client to use with the search index. </p> <p> This method configures the search index to use a specific Async Redis client. It is useful for cases where an external, custom-configured client is preferred instead of creating a new one. </p> <ul> <li> <strong> Parameters: </strong> <strong> client </strong> ( <em> aredis.Redis </em> ) – An Async Redis client instance to be used for the connection. </li> <li> <strong> Raises: </strong> <strong> TypeError </strong> – If the provided client is not valid. </li> </ul> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.asyncio</span> <span class="k">as</span> <span class="nn">aredis</span> </span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redisvl.index</span> <span class="kn">import</span> <span class="n">AsyncSearchIndex</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># async Redis client and index</span> </span></span><span class="line"><span class="cl"><span class="n">client</span> <span class="o">=</span> <span class="n">aredis</span><span class="o">.</span><span class="n">Redis</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="s2">"redis://localhost:6379"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">AsyncSearchIndex</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s2">"schemas/schema.yaml"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">set_client</span><span class="p">(</span><span class="n">client</span><span class="p">)</span> </span></span></code></pre> </div> <h3 id="property-client--redis--redis--none-1"> <em> property </em> client <em> : Redis | Redis | None </em> </h3> <p> The underlying redis-py client object. </p> <h3 id="property-key_separator--str-1"> <em> property </em> key_separator <em> : str </em> </h3> <p> The optional separator between a defined prefix and key value in forming a Redis key. </p> <h3 id="property-name--str-1"> <em> property </em> name <em> : str </em> </h3> <p> The name of the Redis search index. </p> <h3 id="property-prefix--str-1"> <em> property </em> prefix <em> : str </em> </h3> <p> The optional key prefix that comes before a unique key value in forming a Redis key. </p> <h3 id="property-storage_type--storagetype-1"> <em> property </em> storage_type <em> : StorageType </em> </h3> <p> The underlying storage type for the search index; either hash or json. </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/redisvl/api/searchindex/"/> <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/type/.html
<section class="prose w-full py-12"> <h1 class="command-name"> TYPE </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">TYPE 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(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 string representation of the type of the value stored at <code> key </code> . The different types that can be returned are: <code> string </code> , <code> list </code> , <code> set </code> , <code> zset </code> , <code> hash </code> and <code> stream </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; SET key1 "value" "OK" redis&gt; LPUSH key2 "value" (integer) 1 redis&gt; SADD key3 "value" (integer) 1 redis&gt; TYPE key1 "string" redis&gt; TYPE key2 "list" redis&gt; TYPE key3 "set" </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> : the type of <em> key </em> , or <code> none </code> when <em> key </em> doesn't exist. <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/type/"/> <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/terraform-provider-for-redis-cloud/get-started/.html
<section class="prose w-full py-12 max-w-none"> <h1> Get started with Terraform </h1> <p class="text-lg -mt-5 mb-10"> Shows how to install the Redis Cloud provider and create a subscription. </p> <p> Here, you'll learn how to use the <a href="/docs/latest/integrate/terraform-provider-for-redis-cloud/"> Redis Cloud Terraform Provider </a> to create a subscription and a database. </p> <h2 id="prerequisites"> Prerequisites </h2> <ol> <li> <p> <a href="https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli"> Install Terraform </a> . </p> </li> <li> <p> <a href="/docs/latest/operate/rc/rc-quickstart/#create-an-account"> Create a Redis Cloud account </a> if you do not have one already. </p> </li> <li> <p> <a href="/docs/latest/operate/rc/api/get-started/enable-the-api/"> Enable the Redis Cloud API </a> . </p> </li> <li> <p> Get your Redis Cloud <a href="/docs/latest/operate/rc/api/get-started/manage-api-keys/"> API keys </a> . Set them to the following environment variables: </p> <ul> <li> Set <code> REDISCLOUD_ACCESS_KEY </code> to your API account key. </li> <li> Set <code> REDISCLOUD_SECRET_KEY </code> to your API user key. </li> </ul> </li> <li> <p> Set a <a href="/docs/latest/operate/rc/billing-and-payments/#add-payment-method"> payment method </a> . </p> </li> </ol> <h2 id="install-the-redis-cloud-provider"> Install the Redis Cloud provider </h2> <ol> <li> <p> Create a file to contain the Terraform configuration called <code> main.tf </code> . </p> </li> <li> <p> Go to the <a href="https://registry.terraform.io/providers/RedisLabs/rediscloud/latest/"> Redis Cloud Terraform Registry </a> . </p> </li> <li> <p> Select <strong> Use Provider </strong> and copy the Terraform code located there. Paste the code into <code> main.tf </code> and save the file. </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">provider "rediscloud" { </span></span><span class="line"><span class="cl">} </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"># Example resource configuration </span></span><span class="line"><span class="cl">resource "rediscloud_subscription" "example" { </span></span><span class="line"><span class="cl"> # ... </span></span><span class="line"><span class="cl">} </span></span></code></pre> </div> </li> <li> <p> Run <code> terraform init </code> . </p> </li> </ol> <h2 id="create-a-redis-cloud-subscription-with-terraform"> Create a Redis Cloud subscription with Terraform </h2> <p> In your Terraform configuration file, you can add resources and data sources to plan and create subscriptions and databases. See the <a href="https://registry.terraform.io/providers/RedisLabs/rediscloud/latest/docs"> Redis Cloud Terraform Registry documentation </a> for more info about the resources and data sources you can use as part of the Redis Cloud provider. </p> <p> The steps in this section show you how to plan and create a Redis Cloud Pro subscription with one database. </p> <ol> <li> <p> Use the <a href="https://registry.terraform.io/providers/RedisLabs/rediscloud/latest/docs/data-sources/rediscloud_payment_method"> <code> rediscloud_payment_method </code> </a> data source to get the payment method ID. </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># Get credit card details </span></span><span class="line"><span class="cl">data "rediscloud_payment_method" "card" { </span></span><span class="line"><span class="cl"> card_type = "&lt;Card type&gt;" </span></span><span class="line"><span class="cl"> last_four_numbers = "&lt;Last four numbers on the card&gt;" </span></span><span class="line"><span class="cl">} </span></span></code></pre> </div> <p> Example: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">data "rediscloud_payment_method" "card" { </span></span><span class="line"><span class="cl"> card_type = "Visa" </span></span><span class="line"><span class="cl"> last_four_numbers = "5625" </span></span><span class="line"><span class="cl">} </span></span></code></pre> </div> </li> <li> <p> Define a <a href="https://registry.terraform.io/providers/RedisLabs/rediscloud/latest/docs/resources/rediscloud_subscription"> <code> rediscloud_subscription </code> </a> resource to create the subscription. </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># Create a subscription </span></span><span class="line"><span class="cl">resource "rediscloud_subscription" "subscription-resource" { </span></span><span class="line"><span class="cl"> name = "subscription-name" </span></span><span class="line"><span class="cl"> payment_method_id = data.rediscloud_payment_method.card.id # If you want to pay with a marketplace account, replace this line with payment_method = 'marketplace'. </span></span><span class="line"><span class="cl"> memory_storage = "ram" </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> # Specify the cloud provider information here </span></span><span class="line"><span class="cl"> cloud_provider { </span></span><span class="line"><span class="cl"> provider = "&lt;Cloud provider&gt;" </span></span><span class="line"><span class="cl"> region { </span></span><span class="line"><span class="cl"> region = "&lt;region&gt;" </span></span><span class="line"><span class="cl"> networking_deployment_cidr = "&lt;CIDR&gt;" </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"> #Define the average database specification for databases in the subscription </span></span><span class="line"><span class="cl"> creation_plan { </span></span><span class="line"><span class="cl"> memory_limit_in_gb = 2 </span></span><span class="line"><span class="cl"> quantity = 1 </span></span><span class="line"><span class="cl"> replication = true </span></span><span class="line"><span class="cl"> throughput_measurement_by = "operations-per-second" </span></span><span class="line"><span class="cl"> throughput_measurement_value = 20000 </span></span><span class="line"><span class="cl"> } </span></span><span class="line"><span class="cl">} </span></span></code></pre> </div> <p> Example: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">resource "rediscloud_subscription" "subscription-resource" { </span></span><span class="line"><span class="cl"> name = "redis-docs-sub" </span></span><span class="line"><span class="cl"> payment_method_id = data.rediscloud_payment_method.card.id # If you want to pay with a marketplace account, replace this line with payment_method = 'marketplace'. </span></span><span class="line"><span class="cl"> memory_storage = "ram" </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> cloud_provider { </span></span><span class="line"><span class="cl"> provider = "GCP" </span></span><span class="line"><span class="cl"> region { </span></span><span class="line"><span class="cl"> region = "us-west1" </span></span><span class="line"><span class="cl"> networking_deployment_cidr = "192.168.0.0/24" </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"> creation_plan { </span></span><span class="line"><span class="cl"> memory_limit_in_gb = 2 </span></span><span class="line"><span class="cl"> quantity = 1 </span></span><span class="line"><span class="cl"> replication = true </span></span><span class="line"><span class="cl"> throughput_measurement_by = "operations-per-second" </span></span><span class="line"><span class="cl"> throughput_measurement_value = 20000 </span></span><span class="line"><span class="cl"> modules = ["RedisJSON"] </span></span><span class="line"><span class="cl"> } </span></span><span class="line"><span class="cl">} </span></span></code></pre> </div> </li> <li> <p> Define a <a href="https://registry.terraform.io/providers/RedisLabs/rediscloud/latest/docs/resources/rediscloud_subscription_database"> <code> rediscloud_subscription_database </code> </a> resource to create a database. </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># Create a Database </span></span><span class="line"><span class="cl">resource "rediscloud_subscription_database" "database-resource" { </span></span><span class="line"><span class="cl"> subscription_id = rediscloud_subscription.subscription-resource.id </span></span><span class="line"><span class="cl"> name = "database-name" </span></span><span class="line"><span class="cl"> memory_limit_in_gb = 2 </span></span><span class="line"><span class="cl"> data_persistence = "aof-every-write" </span></span><span class="line"><span class="cl"> throughput_measurement_by = "operations-per-second" </span></span><span class="line"><span class="cl"> throughput_measurement_value = 20000 </span></span><span class="line"><span class="cl"> replication = true </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> alert { </span></span><span class="line"><span class="cl"> name = "dataset-size" </span></span><span class="line"><span class="cl"> value = 40 </span></span><span class="line"><span class="cl"> } </span></span><span class="line"><span class="cl"> depends_on = [rediscloud_subscription.subscription-resource] </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">} </span></span></code></pre> </div> <p> Example: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">resource "rediscloud_subscription_database" "database-resource" { </span></span><span class="line"><span class="cl"> subscription_id = rediscloud_subscription.subscription-resource.id </span></span><span class="line"><span class="cl"> name = "redis-docs-db" </span></span><span class="line"><span class="cl"> memory_limit_in_gb = 2 </span></span><span class="line"><span class="cl"> data_persistence = "aof-every-write" </span></span><span class="line"><span class="cl"> throughput_measurement_by = "operations-per-second" </span></span><span class="line"><span class="cl"> throughput_measurement_value = 20000 </span></span><span class="line"><span class="cl"> replication = true </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> modules = [ </span></span><span class="line"><span class="cl"> { </span></span><span class="line"><span class="cl"> name = "RedisJSON" </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"> alert { </span></span><span class="line"><span class="cl"> name = "dataset-size" </span></span><span class="line"><span class="cl"> value = 40 </span></span><span class="line"><span class="cl"> } </span></span><span class="line"><span class="cl"> depends_on = [rediscloud_subscription.subscription-resource] </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">} </span></span></code></pre> </div> </li> <li> <p> Run <code> terraform plan </code> to check for any syntax errors. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ terraform plan </span></span><span class="line"><span class="cl">data.rediscloud_payment_method.card: Reading... </span></span><span class="line"><span class="cl">data.rediscloud_payment_method.card: Read <span class="nb">complete</span> after 1s <span class="o">[</span><span class="nv">id</span><span class="o">=</span>8859<span class="o">]</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following </span></span><span class="line"><span class="cl">symbols: </span></span><span class="line"><span class="cl">+ create </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl">Terraform will perform the following actions: </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1"># rediscloud_subscription.subscription-resource will be created</span> </span></span><span class="line"><span class="cl"> + resource <span class="s2">"rediscloud_subscription"</span> <span class="s2">"subscription-resource"</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="o">[</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></span><span class="line"><span class="cl"> <span class="c1"># rediscloud_subscription_database.database-resource will be created</span> </span></span><span class="line"><span class="cl"> + resource <span class="s2">"rediscloud_subscription_database"</span> <span class="s2">"database-resource"</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="o">[</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></span><span class="line"><span class="cl">Plan: <span class="m">2</span> to add, <span class="m">0</span> to change, <span class="m">0</span> to destroy. </span></span></code></pre> </div> </li> <li> <p> Run <code> terraform apply </code> to apply the changes and enter <code> yes </code> to confirm when prompted. </p> <p> This will take some time. You will see messages in your terminal while the subscription and database are being created: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rediscloud_subscription.subscription-resource: Creating... </span></span><span class="line"><span class="cl">rediscloud_subscription.subscription-resource: Still creating... [10s elapsed] </span></span><span class="line"><span class="cl">rediscloud_subscription.subscription-resource: Still creating... [20s elapsed] </span></span><span class="line"><span class="cl">rediscloud_subscription.subscription-resource: Still creating... [30s elapsed] </span></span></code></pre> </div> <p> When provisioning is complete, you will see a message in your terminal: </p> <div class="highlight"> <pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Apply complete! Resources: 2 added, 0 changed, 0 destroyed. </span></span></code></pre> </div> <p> View the <a href="https://cloud.redis.io/"> Redis Cloud console </a> to verify your subscription and database creation. </p> </li> <li> <p> If you want to remove these sample resources, run <code> terraform destroy </code> . </p> </li> </ol> <h2 id="more-info"> More info </h2> <ul> <li> <a href="https://registry.terraform.io/providers/RedisLabs/rediscloud/latest/docs"> Redis Cloud Terraform Registry </a> </li> <li> <a href="https://developer.hashicorp.com/terraform/docs"> Terraform documentation </a> </li> <li> <a href="https://developer.hashicorp.com/terraform/language/syntax/configuration"> Terraform configuration syntax </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/integrate/terraform-provider-for-redis-cloud/get-started/"/> <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/node/recovery-path/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin node recovery_path set </h1> <p class="text-lg -mt-5 mb-10"> Sets a node's local recovery path. </p> <p> Sets the node's local recovery path, which specifies the directory where <a href="/docs/latest/operate/rs/7.4/databases/configure/database-persistence/"> persistence files </a> are stored. You can use these persistence files to <a href="/docs/latest/operate/rs/7.4/databases/recover/"> recover a failed database </a> . </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; recovery_path <span class="nb">set</span> &lt;path&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> node </td> <td> integer </td> <td> Sets the recovery path for the specified node </td> </tr> <tr> <td> path </td> <td> filepath </td> <td> Path to the folder where persistence files are stored </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns <code> Updated successfully </code> if the recovery path was set. 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 node <span class="m">2</span> recovery_path <span class="nb">set</span> /var/opt/redislabs/persist/redis </span></span><span class="line"><span class="cl">Updated 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/node/recovery-path/"/> <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/cluster/actions/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster actions requests </h1> <p class="text-lg -mt-5 mb-10"> Cluster action requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-all-cluster-actions"> GET </a> </td> <td> <code> /v1/cluster/actions </code> </td> <td> Get the status of all actions </td> </tr> <tr> <td> <a href="#get-cluster-action"> GET </a> </td> <td> <code> /v1/cluster/actions/{action} </code> </td> <td> Get the status of a specific action </td> </tr> <tr> <td> <a href="#post-cluster-action"> POST </a> </td> <td> <code> /v1/cluster/actions/{action} </code> </td> <td> Initiate a cluster-wide action </td> </tr> <tr> <td> <a href="#delete-cluster-action"> DELETE </a> </td> <td> <code> /v1/cluster/actions/{action} </code> </td> <td> Cancel action or remove action status </td> </tr> </tbody> </table> <h2 id="get-all-cluster-actions"> Get all cluster actions </h2> <pre><code>GET /v1/cluster/actions </code></pre> <p> Get the status of all currently executing, queued, or completed cluster actions. </p> <h4 id="required-permissions"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_status_of_cluster_action"> view_status_of_cluster_action </a> </td> </tr> </tbody> </table> <h3 id="get-all-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>GET /cluster/actions </code></pre> <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/action/"> action 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="nt">"actions"</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">"name"</span><span class="p">:</span> <span class="s2">"action_name"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"status"</span><span class="p">:</span> <span class="s2">"queued"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"progress"</span><span class="p">:</span> <span class="mf">0.0</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="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, response provides info about an ongoing action. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Action does not exist (i.e. not currently running and no available status of last run). </td> </tr> </tbody> </table> <h2 id="get-cluster-action"> Get cluster action </h2> <pre><code>GET /v1/cluster/actions/{action} </code></pre> <p> Get the status of a currently executing, queued, or completed cluster action. </p> <h4 id="required-permissions-1"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_status_of_cluster_action"> view_status_of_cluster_action </a> </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request-1"> Example HTTP request </h4> <pre><code>GET /cluster/actions/action_name </code></pre> <h4 id="url-parameters"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> action </td> <td> string </td> <td> The action to check. </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns an <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/action/"> action 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">"name"</span><span class="p">:</span> <span class="s2">"action_name"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"status"</span><span class="p">:</span> <span class="s2">"queued"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"progress"</span><span class="p">:</span> <span class="mf">0.0</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, response provides info about an ongoing action. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Action does not exist (i.e. not currently running and no available status of last run). </td> </tr> </tbody> </table> <h2 id="post-cluster-action"> Initiate cluster-wide action </h2> <pre><code>POST /v1/cluster/actions/{action} </code></pre> <p> Initiate a cluster-wide action. </p> <p> The API allows only a single instance of any action type to be invoked at the same time, and violations of this requirement will result in a <code> 409 CONFLICT </code> response. </p> <p> The caller is expected to query and process the results of the previously executed instance of the same action, which will be removed as soon as the new one is submitted. </p> <h4 id="required-permissions-2"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#start_cluster_action"> start_cluster_action </a> </td> </tr> </tbody> </table> <h3 id="post-request"> Request </h3> <h4 id="example-http-request-2"> Example HTTP request </h4> <pre><code>POST /cluster/actions/action_name </code></pre> <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> action </td> <td> string </td> <td> The name of the action required. </td> </tr> </tbody> </table> <p> Supported cluster actions: </p> <ul> <li> <p> <code> change_master </code> : Promotes a specified node to become the primary node of the cluster, which coordinates cluster-wide operations. Include the <code> node_uid </code> of the node you want to promote in the request body. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/cluster/actions/change_master </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">"2"</span> </span></span><span class="line"><span class="cl"><span class="o">}</span> </span></span></code></pre> </div> </li> </ul> <h3 id="post-response"> Response </h3> <p> The body content may provide additional action details. Currently, it is not used. </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> No error, action was initiated. </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 action or content provided. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10"> 409 Conflict </a> </td> <td> A conflicting action is already in progress. </td> </tr> </tbody> </table> <h2 id="delete-cluster-action"> Cancel action </h2> <pre><code>DELETE /v1/cluster/actions/{action} </code></pre> <p> Cancel a queued or executing cluster action, or remove the status of a previously executed and completed action. </p> <h4 id="required-permissions-3"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#cancel_cluster_action"> cancel_cluster_action </a> </td> </tr> </tbody> </table> <h3 id="delete-request"> Request </h3> <h4 id="example-http-request-3"> Example HTTP request </h4> <pre><code>DELETE /v1/cluster/actions/action_name </code></pre> <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> action </td> <td> string </td> <td> The name of the action to cancel, currently no actions are supported. </td> </tr> </tbody> </table> <h3 id="delete-response"> Response </h3> <p> Returns a status code. </p> <h3 id="delete-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> Action will be cancelled when possible. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Action unknown or not currently running. </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/cluster/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/release-notes/redisgraph/redisgraph-2.10-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisGraph 2.10 release notes </h1> <p class="text-lg -mt-5 mb-10"> Introduces new path algorithms, additional expressivity (constructs and functions), performance improvements, and bug fixes. </p> <h2 id="requirements"> Requirements </h2> <p> RedisGraph v2.10.15 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 6.2.0 </li> <li> Minimum Redis Enterprise Software version (cluster): 6.2.8 </li> </ul> <h2 id="v21015-september-2023"> v2.10.15 (September 2023) </h2> <p> This is a maintenance release for RedisGraph 2.10. </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/RedisGraph/RedisGraph/pull/3172"> #3172 </a> Crash on certain write queries (MOD-5645) </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/3179"> #3179 </a> High CPU on idle </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/3184"> #3184 </a> Revert breaking change introduced in 2.10: <code> toString </code> supports list argument again </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/3185"> #3185 </a> Don’t write AUX field in the RDB file when there are no graphs in the keyspace </li> </ul> </li> </ul> <h2 id="v21012-july-2023"> v2.10.12 (July 2023) </h2> <p> This is a maintenance release for RedisGraph 2.10. </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/RedisGraph/RedisGraph/pull/3129"> #3129 </a> Crash on certain queries ( <code> INDEX SCAN </code> followed by <code> DEL </code> followed by <code> SET </code> ) (MOD-5430) </li> </ul> </li> </ul> <h2 id="v21011-june-2023"> v2.10.11 (June 2023) </h2> <p> This is a maintenance release for RedisGraph 2.10. </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/RedisGraph/RedisGraph/pull/3096"> #3096 </a> Potential crash on query timeout (MOD-5202) </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/3042"> #3042 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/3052"> #3052 </a> Potential crashes due to false assertions </li> </ul> </li> </ul> <h2 id="v21010-april-2023"> v2.10.10 (April 2023) </h2> <p> This is a maintenance release for RedisGraph 2.10. </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/RedisGraph/RedisGraph/issues/3038"> #3038 </a> Potential crash when a query with a <code> UNION </code> clause sets or modifies an indexed property </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2631"> #2631 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/2968"> #2968 </a> Potential crash on certain <code> MATCH </code> clauses where label filters are used (MOD-5093) </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2957"> #2957 </a> Label filters in expressions such as <code> WITH n MATCH (n:X) </code> are ignored </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2931"> #2931 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/3027"> #3027 </a> Wrong overflow error message </li> </ul> </li> </ul> <h2 id="v2109-march-2023"> v2.10.9 (March 2023) </h2> <p> This is a maintenance release for RedisGraph 2.10. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2880"> #2880 </a> Potential crash when using <code> WITH * </code> expressions </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2917"> #2917 </a> Potential crash when using <code> CASE </code> expressions (MOD-4873) </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2836"> #2836 </a> Potential crash on <code> *0 </code> variable-length path (MOD-4817) </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2916"> #2916 </a> Potential crash when executing concurrent queries that utilize full-text indices (MOD-4818) </li> </ul> </li> </ul> <h2 id="v2108-february-2023"> v2.10.8 (February 2023) </h2> <p> This is a maintenance release for RedisGraph 2.10. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2777"> #2777 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/2841"> #2841 </a> Potential crash when sending queries from multiple connections and timeout is not 0 </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2844"> #2844 </a> Potential partial results when same parametrized query is running from multiple connections </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2739"> #2739 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/2774"> #2774 </a> Paths with exact variable length &gt;1 are not matched </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2794"> #2794 </a> <code> toInteger </code> and <code> toIntegerOrNull </code> don't convert Booleans </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2798"> #2798 </a> <code> right </code> and <code> left </code> should reply with an error when <code> length </code> is null </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2809"> #2809 </a> <code> TIMEOUT_MAX </code> configuration parameter is not enforced when <code> TIMEOUT_DEFAULT </code> is 0 </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2780"> #2780 </a> <code> indegree </code> and <code> outdegree </code> - relationships are counted more than once when same relationship type is supplied more than once </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2790"> #2790 </a> Improved performance by disabling SuiteSparse:GraphBLAS' global free pool </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2758"> #2758 </a> Improved edge deletion performance </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2781"> #2781 </a> <code> indegree </code> and <code> outdegree </code> now also accept an argument which is a list of labels </li> </ul> </li> </ul> <h2 id="v2105-december-2022"> v2.10.5 (December 2022) </h2> <p> This is a maintenance release for RedisGraph 2.10. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2754"> #2754 </a> Partial sync may hang (MOD-4594) </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2757"> #2757 </a> Improved performance of <code> indegree </code> and <code> outdegree </code> </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2681"> #2681 </a> Fixed some error messages </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2740"> #2740 </a> Don’t show partial results for timed-out <code> GRAPH.PROFILE </code> </li> </ul> </li> </ul> <h2 id="v210-ga-v2104-november-2022"> v2.10 GA (v2.10.4) (November 2022) </h2> <p> This is the General Availability release of RedisGraph 2.10. </p> <h3 id="highlights"> Highlights </h3> <p> RedisGraph 2.10 introduces new path algorithms, additional expressivity (constructs and functions), performance improvements, and bug fixes. </p> <h4 id="whats-new-in-210"> What's new in 2.10 </h4> <ul> <li> New pathfinding algorithms: <ul> <li> The <code> algo.SPpaths </code> procedure yields one, <em> n </em> , or all minimal-weight, optionally bounded-cost, optionally bounded-length paths between a given pair of nodes. </li> <li> The <code> algo.SSpaths </code> procedure yields one, <em> n </em> , or all minimal-weight, optionally bounded-cost, optionally bounded-length paths from a given node. </li> </ul> </li> <li> Introduce <code> SET </code> for adding node labels and <code> REMOVE </code> for removing node labels, node properties, and edge properties. </li> <li> Support deleting paths with <code> DELETE </code> . </li> <li> Introduce 29 functions: <code> toBoolean </code> , <code> toBooleanOrNull </code> , <code> toFloatOrNull </code> , <code> toIntegerOrNull </code> , <code> toStringOrNull </code> , <code> toBooleanList </code> , <code> toFloatList </code> , <code> toIntegerList </code> , <code> toStringList </code> , <code> properties </code> , <code> split </code> , <code> last </code> , <code> isEmpty </code> , <code> e </code> , <code> exp </code> , <code> log </code> , <code> log10 </code> , <code> sin </code> , <code> cos </code> , <code> tan </code> , <code> cot </code> , <code> asin </code> , <code> acos </code> , <code> atan </code> , <code> atan2 </code> , <code> degrees </code> , <code> radians </code> , <code> pi </code> , and <code> haversin </code> . </li> <li> Graph slow log can be reset with <code> GRAPH.SLOWLOG g RESET </code> . </li> <li> Queries are now atomic ( <em> Atomicity </em> is the guarantee that each query either succeeds or fails with no side effects). Whenever a failure occurs, the query effect is rolled back from an undo log. </li> </ul> <h3 id="details"> Details </h3> <ul> <li> <p> Bug fixes (since 2.10-RC1): </p> <ul> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2695"> #2695 </a> Potential crash on certain write queries (MOD-4286, MOD-4545) </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2724"> #2724 </a> Potential crash when setting property values based on nonexistent properties </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2460"> #2460 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/2637"> #2637 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/2680"> #2680 </a> Crash on invalid queries </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2672"> #2672 </a> Wrong matching result on multiple labels </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2643"> #2643 </a> Duplicate reports when matching relationship type <code> :R|R </code> </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2687"> #2687 </a> , <a href="https://github.com/RedisGraph/RedisGraph/issues/2414"> #2414 </a> Error when <code> UNWIND </code> ing relationships </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2636"> #2636 </a> <code> MERGE </code> ... <code> ON </code> ... - cannot remove property by setting it to null </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/pull/2710"> #2710 </a> Undo log fix </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2435"> #2435 </a> Incorrect result when comparing a value to NaN </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2497"> #2497 </a> Incorrect result when comparing a value to null </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2676"> #2676 </a> <code> sqrt </code> , <code> log </code> , <code> log10 </code> - incorrect result for negative values </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/issues/2213"> #2213 </a> Division and Modulo by zero - wrong behavior </li> </ul> </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/release-notes/redisgraph/redisgraph-2.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/oss_and_stack/management/admin/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis administration </h1> <p class="text-lg -mt-5 mb-10"> Advice for configuring and managing Redis in production </p> <h2 id="redis-setup-tips"> Redis setup tips </h2> <h3 id="linux"> Linux </h3> <ul> <li> <p> Deploy Redis using the Linux operating system. Redis is also tested on OS X, and from time to time on FreeBSD and OpenBSD systems. However, Linux is where most of the stress testing is performed, and where most production deployments are run. </p> </li> <li> <p> Set the Linux kernel overcommit memory setting to 1. Add <code> vm.overcommit_memory = 1 </code> to <code> /etc/sysctl.conf </code> . Then, reboot or run the command <code> sysctl vm.overcommit_memory=1 </code> to activate the setting. See <a href="/docs/latest/develop/get-started/faq/#background-saving-fails-with-a-fork-error-on-linux"> FAQ: Background saving fails with a fork() error on Linux? </a> for details. </p> </li> <li> <p> To ensure the Linux kernel feature Transparent Huge Pages does not impact Redis memory usage and latency, run the command: <code> echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled </code> to disable it. See <a href="/docs/latest/operate/oss_and_stack/management/optimization/latency#latency-induced-by-transparent-huge-pages"> Latency Diagnosis - Latency induced by transparent huge pages </a> for additional context. </p> </li> </ul> <h3 id="memory"> Memory </h3> <ul> <li> <p> Ensured that swap is enabled and that your swap file size is equal to amount of memory on your system. If Linux does not have swap set up, and your Redis instance accidentally consumes too much memory, Redis can crash when it is out of memory, or the Linux kernel OOM killer can kill the Redis process. When swapping is enabled, you can detect latency spikes and act on them. </p> </li> <li> <p> Set an explicit <code> maxmemory </code> option limit in your instance to make sure that it will report errors instead of failing when the system memory limit is near to be reached. Note that <code> maxmemory </code> should be set by calculating the overhead for Redis, other than data, and the fragmentation overhead. So if you think you have 10 GB of free memory, set it to 8 or 9. </p> </li> <li> <p> If you are using Redis in a write-heavy application, while saving an RDB file on disk or rewriting the AOF log, Redis can use up to 2 times the memory normally used. The additional memory used is proportional to the number of memory pages modified by writes during the saving process, so it is often proportional to the number of keys (or aggregate types items) touched during this time. Make sure to size your memory accordingly. </p> </li> <li> <p> See the <a href="/commands/latency-doctor"> <code> LATENCY DOCTOR </code> </a> and <a href="/commands/memory-doctor"> <code> MEMORY DOCTOR </code> </a> commands to assist in troubleshooting. </p> </li> </ul> <h3 id="imaging"> Imaging </h3> <ul> <li> When running under daemontools, use <code> daemonize no </code> . </li> </ul> <h3 id="replication"> Replication </h3> <ul> <li> <p> Set up a non-trivial replication backlog in proportion to the amount of memory Redis is using. The backlog allows replicas to sync with the primary (master) instance much more easily. </p> </li> <li> <p> If you use replication, Redis performs RDB saves even if persistence is disabled. (This does not apply to diskless replication.) If you don't have disk usage on the master, enable diskless replication. </p> </li> <li> <p> If you are using replication, ensure that either your master has persistence enabled, or that it does not automatically restart on crashes. Replicas will try to maintain an exact copy of the master, so if a master restarts with an empty data set, replicas will be wiped as well. </p> </li> </ul> <h3 id="security"> Security </h3> <ul> <li> By default, Redis does not require any authentication and listens to all the network interfaces. This is a big security issue if you leave Redis exposed on the internet or other places where attackers can reach it. See for example <a href="http://antirez.com/news/96"> this attack </a> to see how dangerous it can be. Please check our <a href="/docs/latest/operate/oss_and_stack/management/security/"> security page </a> for information about how to secure Redis. </li> </ul> <h2 id="running-redis-on-ec2"> Running Redis on EC2 </h2> <ul> <li> Use HVM based instances, not PV based instances. </li> <li> Do not use old instance families. For example, use m3.medium with HVM instead of m1.medium with PV. </li> <li> The use of Redis persistence with EC2 EBS volumes needs to be handled with care because sometimes EBS volumes have high latency characteristics. </li> <li> You may want to try the new diskless replication if you have issues when replicas are synchronizing with the master. </li> </ul> <h2 id="upgrading-or-restarting-a-redis-instance-without-downtime"> Upgrading or restarting a Redis instance without downtime </h2> <p> Redis is designed to be a long-running process in your server. You can modify many configuration options without a restart using the <a href="/commands/config-set"> <code> CONFIG SET </code> </a> command. You can also switch from AOF to RDB snapshots persistence, or the other way around, without restarting Redis. Check the output of the <code> CONFIG GET * </code> command for more information. </p> <p> From time to time, a restart is required, for example, to upgrade the Redis process to a newer version, or when you need to modify a configuration parameter that is currently not supported by the <a href="/commands/config"> <code> CONFIG </code> </a> command. </p> <p> Follow these steps to avoid downtime. </p> <ul> <li> <p> Set up your new Redis instance as a replica for your current Redis instance. In order to do so, you need a different server, or a server that has enough RAM to keep two instances of Redis running at the same time. </p> </li> <li> <p> If you use a single server, ensure that the replica is started on a different port than the master instance, otherwise the replica cannot start. </p> </li> <li> <p> Wait for the replication initial synchronization to complete. Check the replica's log file. </p> </li> <li> <p> Using <a href="/commands/info"> <code> INFO </code> </a> , ensure the master and replica have the same number of keys. Use <code> redis-cli </code> to check that the replica is working as expected and is replying to your commands. </p> </li> <li> <p> Allow writes to the replica using <code> CONFIG SET slave-read-only no </code> . </p> </li> <li> <p> Configure all your clients to use the new instance (the replica). Note that you may want to use the <a href="/commands/client-pause"> <code> CLIENT PAUSE </code> </a> command to ensure that no client can write to the old master during the switch. </p> </li> <li> <p> Once you confirm that the master is no longer receiving any queries (you can check this using the <a href="/commands/monitor"> <code> MONITOR </code> </a> command), elect the replica to master using the <code> REPLICAOF NO ONE </code> command, and then shut down your master. </p> </li> </ul> <p> If you are using <a href="/docs/latest/operate/oss_and_stack/management/sentinel/"> Redis Sentinel </a> or <a href="/docs/latest/operate/oss_and_stack/management/scaling/"> Redis Cluster </a> , the simplest way to upgrade to newer versions is to upgrade one replica after the other. Then you can perform a manual failover to promote one of the upgraded replicas to master, and finally promote the last replica. </p> <hr/> <p> <strong> NOTE </strong> </p> <p> Redis Cluster 4.0 is not compatible with Redis Cluster 3.2 at cluster bus protocol level, so a mass restart is needed in this case. However, Redis 5 cluster bus is backward compatible with Redis 4. </p> <hr/> <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/admin/"/> <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/search-and-query/advanced-concepts/tags/.html
<section class="prose w-full py-12"> <h1> Tags </h1> <p class="text-lg -mt-5 mb-10"> Details about tag fields </p> <p> Tag fields are similar to full-text fields but they interpret the text as a simple list of <em> tags </em> delimited by a <a href="#creating-a-tag-field"> separator </a> character (which is a comma "," by default). This limitation means that tag fields can use simpler <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/escaping/"> tokenization </a> and encoding in the index, which is more efficient than full-text indexing. </p> <p> The values in tag fields cannot be accessed by general field-less search and can be used only with a special syntax. </p> <p> The main differences between tag and full-text fields are: </p> <ol> <li> <p> <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/escaping/#tokenization-rules-for-tag-fields"> Tokenization </a> is very simple for tags. </p> </li> <li> <p> Stemming is not performed on tag indexes. </p> </li> <li> <p> Tags cannot be found from a general full-text search. If a document has a field called "tags" with the values "foo" and "bar", searching for foo or bar without a special tag modifier (see below) will not return this document. </p> </li> <li> <p> The index is much simpler and more compressed: frequencies or offset vectors of field flags are not stored. The index contains only document IDs encoded as deltas. This means that an entry in a tag index is usually one or two bytes long. This makes them very memory-efficient and fast. </p> </li> <li> <p> You can create up to 1024 tag fields per index. </p> </li> </ol> <h2 id="creating-a-tag-field"> Creating a tag field </h2> <p> Tag fields can be added to the schema with the following syntax: </p> <pre tabindex="0"><code>FT.CREATE ... SCHEMA ... {field_name} TAG [SEPARATOR {sep}] [CASESENSITIVE] </code></pre> <p> For hashes, SEPARATOR can be any printable ASCII character; the default is a comma ( <code> , </code> ). For JSON, there is no default separator; you must declare one explicitly if needed. </p> <p> For example: </p> <pre tabindex="0"><code>JSON.SET key:1 $ '{"colors": "red, orange, yellow"}' FT.CREATE idx on JSON PREFIX 1 key: SCHEMA $.colors AS colors TAG SEPARATOR "," &gt; FT.SEARCH idx '@colors:{orange}' 1) "1" 2) "key:1" 3) 1) "$" 2) "{\"colors\":\"red, orange, yellow\"}" </code></pre> <p> CASESENSITIVE can be specified to keep the original case. </p> <h2 id="querying-tag-fields"> Querying tag fields </h2> <p> As mentioned above, just searching for a tag without any modifiers will not retrieve documents containing it. </p> <p> The syntax for matching tags in a query is as follows (the curly braces are part of the syntax): </p> <pre tabindex="0"><code> @&lt;field_name&gt;:{ &lt;tag&gt; | &lt;tag&gt; | ...} </code></pre> <p> For example, this query finds documents with either the tag <code> hello world </code> or <code> foo bar </code> : </p> <pre tabindex="0"><code> FT.SEARCH idx "@tags:{ hello world | foo bar }" </code></pre> <p> Tag clauses can be combined into any sub-clause, used as negative expressions, optional expressions, etc. For example, given the following index: </p> <pre tabindex="0"><code>FT.CREATE idx ON HASH PREFIX 1 test: SCHEMA title TEXT price NUMERIC tags TAG SEPARATOR ";" </code></pre> <p> You can combine a full-text search on the title field, a numerical range on price, and match either the <code> foo bar </code> or <code> hello world </code> tag like this: </p> <pre tabindex="0"><code>FT.SEARCH idx "@title:hello @price:[0 100] @tags:{ foo bar | hello world } </code></pre> <p> Tags support prefix matching with the regular <code> * </code> character: </p> <pre tabindex="0"><code>FT.SEARCH idx "@tags:{ hell* }" FT.SEARCH idx "@tags:{ hello\\ w* }" </code></pre> <h2 id="multiple-tags-in-a-single-filter"> Multiple tags in a single filter </h2> <p> Notice that including multiple tags in the same clause creates a union of all documents that contain any of the included tags. To create an intersection of documents containing all of the given tags, you should repeat the tag filter several times. </p> <p> For example, imagine an index of travelers, with a tag field for the cities each traveler has visited: </p> <pre tabindex="0"><code>FT.CREATE myIndex ON HASH PREFIX 1 traveler: SCHEMA name TEXT cities TAG HSET traveler:1 name "John Doe" cities "New York, Barcelona, San Francisco" </code></pre> <p> For this index, the following query will return all the people who visited at least one of the following cities: </p> <pre tabindex="0"><code>FT.SEARCH myIndex "@cities:{ New York | Los Angeles | Barcelona }" </code></pre> <p> But the next query will return all people who have visited all three cities: </p> <pre tabindex="0"><code>FT.SEARCH myIndex "@cities:{ New York } @cities:{Los Angeles} @cities:{ Barcelona }" </code></pre> <h2 id="including-punctuation-and-spaces-in-tags"> Including punctuation and spaces in tags </h2> <p> A tag field can contain any punctuation characters except for the field separator. You can use punctuation without escaping when you <em> define </em> a tag field, but you typically need to escape certain characters when you <em> query </em> the field because the query syntax itself uses the same characters. (See <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/#tag-filters"> Query syntax </a> for the full set of characters that require escaping.) </p> <p> For example, given the following index: </p> <pre tabindex="0"><code>FT.CREATE punctuation ON HASH PREFIX 1 test: SCHEMA tags TAG </code></pre> <p> You can add tags that contain punctuation like this: </p> <pre tabindex="0"><code>HSET test:1 tags "Andrew's Top 5,Justin's Top 5" </code></pre> <p> However, when you query for those tags, you must escape the punctuation characters with a backslash ( <code> \ </code> ). So, querying for the tag <code> Andrew's Top 5 </code> in <a href="/docs/latest/develop/tools/cli/"> <code> redis-cli </code> </a> looks like this: </p> <pre tabindex="0"><code>FT.SEARCH punctuation "@tags:{ Andrew\\'s Top 5 }" </code></pre> <p> (Note that you need the double backslash here because the terminal app itself uses the backslash as an escape character. Programming languages commonly use this convention also.) </p> <p> You can include spaces in a tag filter without escaping <em> unless </em> you are using a version of RediSearch earlier than v2.4 or you are using <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/#dialect-1"> query dialect 1 </a> . See <a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/#tag-filters"> Query syntax </a> for a full explanation. </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/search-and-query/advanced-concepts/tags/"/> <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/upgrading/upgrade-cluster/.html
<section class="prose w-full py-12 max-w-none"> <h1> Upgrade a Redis Enterprise Software cluster </h1> <p class="text-lg -mt-5 mb-10"> Upgrade a Redis Enterprise Software cluster. </p> <h2 id="supported-upgrade-paths"> Supported upgrade paths </h2> <p> <span title="Check mark icon"> ✅ </span> Supported – You can upgrade directly from the current Redis Software cluster version. </p> <p> <span title="X icon"> ❌ </span> Not supported – You cannot upgrade directly from the current Redis Software cluster version. You must first upgrade to a supported intermediate version. </p> <table> <thead> <tr> <th style="text-align:center"> Current Redis Software cluster version </th> <th style="text-align:center"> Upgrade to Redis Software 6.2.x </th> <th style="text-align:center"> Upgrade to Redis Software 6.4.x </th> <th style="text-align:center"> Upgrade to Redis Software 7.2.x </th> <th style="text-align:center"> Upgrade to Redis Software 7.4.x </th> <th style="text-align:center"> Upgrade to Redis Software 7.8.x </th> </tr> </thead> <tbody> <tr> <td style="text-align:center"> 6.0.x </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="Not supported"> ❌ </span> </td> <td style="text-align:center"> <span title="Not supported"> ❌ </span> </td> </tr> <tr> <td style="text-align:center"> 6.2.4 <br/> 6.2.8 </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> <td style="text-align:center"> <span title="Not supported"> ❌ </span> </td> </tr> <tr> <td style="text-align:center"> 6.2.10 <br/> 6.2.12 <br/> 6.2.18 </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> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td style="text-align:center"> 6.4.x </td> <td style="text-align:center"> – </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 style="text-align:center"> 7.2.x </td> <td style="text-align:center"> – </td> <td style="text-align:center"> – </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> </tr> <tr> <td style="text-align:center"> 7.4.x </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> <td style="text-align:center"> <span title="Supported"> ✅ </span> </td> </tr> </tbody> </table> <p> See the <a href="/docs/latest/operate/rs/7.4/installing-upgrading/product-lifecycle/"> Redis Enterprise Software product lifecycle </a> for more information about release numbers and the end-of-life schedule. </p> <h2 id="upgrade-prerequisites"> Upgrade prerequisites </h2> <p> Before upgrading a cluster: </p> <ul> <li> <p> Verify access to <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rlcheck/"> rlcheck </a> and <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/#use-the-rladmin-shell"> rladmin </a> commands </p> </li> <li> <p> Verify that you meet the upgrade path requirements for your desired cluster version and review the relevant <a href="/docs/latest/operate/rs/7.4/release-notes/"> release notes </a> for any preparation instructions. </p> </li> <li> <p> Avoid changing the database configuration or performing other cluster management operations during the upgrade process, as this might cause unexpected results. </p> </li> <li> <p> Upgrade the cluster's primary (master) node first. To identify the primary node, use one of the following methods: </p> <ul> <li> <p> <strong> Nodes </strong> screen in the new Cluster Manager UI (only available for Redis Enterprise versions 7.2 and later) </p> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/#status-nodes"> <code> rladmin status nodes </code> </a> command </p> </li> <li> <p> <a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/nodes/status/#get-all-nodes-status"> <code> GET /nodes/status </code> </a> REST API request </p> </li> </ul> </li> </ul> <h2 id="upgrade-cluster"> Upgrade cluster </h2> <p> Starting with the primary (master) node, follow these steps for every node in the cluster. To ensure cluster availability, upgrade each node separately. </p> <ol> <li> <p> Verify node operation with the following commands: </p> <div class="highlight"> <pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">$ rlcheck </span></span><span class="line"><span class="cl">$ rladmin status extra all </span></span></code></pre> </div> </li> <li> <p> Download the Redis Enterprise Software installation package to the machine running the node from the Download Center on <a href="https://cloud.redis.io"> https://cloud.redis.io </a> . </p> </li> <li> <p> Extract the installation package: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">tar vxf &lt;tarfile name&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> You cannot change the installation path or the user during the upgrade. </div> </div> </li> <li> <p> Run the install command. See <a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/install-script/"> installation script options </a> for a list of command-line options you can add to the following command: </p> <div class="highlight"> <pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">sudo ./install.sh </span></span></code></pre> </div> <p> The installation script automatically recognizes the upgrade and responds accordingly. </p> <p> The upgrade replaces all node processes, which might briefly interrupt any active connections. </p> </li> <li> <p> Verify the node was upgraded to the new version and is still operational: </p> <div class="highlight"> <pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">$ rlcheck </span></span><span class="line"><span class="cl">$ rladmin status extra all </span></span></code></pre> </div> </li> <li> <p> Visit the Cluster Manager UI. </p> <p> If the Cluster Manager UI was open in a web browser during the upgrade, refresh the browser to reload the console. </p> </li> </ol> <p> After all nodes are upgraded, the cluster is fully upgraded. Certain features introduced in the new version of Redis Enterprise Software only become available after upgrading the entire cluster. </p> <p> After upgrading from version 6.0.x to 6.2.x, restart <code> cnm_exec </code> on each cluster node to enable more advanced state machine handling capabilities: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">supervisorctl restart cnm_exec </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/installing-upgrading/upgrading/upgrade-cluster/"/> <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/georadiusbymember/.html
<section class="prose w-full py-12"> <h1 class="command-name"> GEORADIUSBYMEMBER <span class="text-base"> (deprecated) </span> </h1> <div class="border-l-8 pl-4"> <p> As of Redis version 6.2.0, this command is regarded as deprecated. </p> <p> It can be replaced by <a href="/docs/latest/commands/geosearch/"> <code> GEOSEARCH </code> </a> and <a href="/docs/latest/commands/geosearchstore/"> <code> GEOSEARCHSTORE </code> </a> with the <code> BYRADIUS </code> and <code> FROMMEMBER </code> arguments when migrating or writing new code. </p> </div> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">GEORADIUSBYMEMBER key member radius &lt;m | km | ft | mi&gt; [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] [STORE key | STOREDIST 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"> 3.2.0 </dd> <dt class="font-semibold text-redis-ink-900 m-0"> Time complexity: </dt> <dd class="m-0"> O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. </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> @geo </code> <span class="mr-1 last:hidden"> , </span> <code> @slow </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> This command is exactly like <a href="/docs/latest/commands/georadius/"> <code> GEORADIUS </code> </a> with the sole difference that instead of taking, as the center of the area to query, a longitude and latitude value, it takes the name of a member already existing inside the geospatial index represented by the sorted set. </p> <p> The position of the specified member is used as the center of the query. </p> <p> Please check the example below and the <a href="/docs/latest/commands/georadius/"> <code> GEORADIUS </code> </a> documentation for more information about the command and its options. </p> <p> Note that <a href="/docs/latest/commands/georadiusbymember_ro/"> <code> GEORADIUSBYMEMBER_RO </code> </a> is also available since Redis 3.2.10 and Redis 4.0.0 in order to provide a read-only command that can be used in replicas. See the <a href="/docs/latest/commands/georadius/"> <code> GEORADIUS </code> </a> page for more information. </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; GEOADD Sicily 13.583333 37.316667 "Agrigento" (integer) 1 redis&gt; GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania" (integer) 2 redis&gt; GEORADIUSBYMEMBER Sicily Agrigento 100 km 1) "Agrigento" 2) "Palermo" </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> If no <code> WITH* </code> option is specified, an <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> of matched member names </li> <li> If <code> WITHCOORD </code> , <code> WITHDIST </code> , or <code> WITHHASH </code> options are specified, the command returns an <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> of arrays, where each sub-array represents a single item: <ul> <li> The distance from the center as a floating point number, in the same unit specified in the radius. </li> <li> The Geohash integer. </li> <li> The coordinates as a two items x,y array (longitude,latitude). </li> </ul> </li> </ul> <br/> <h2> History </h2> <ul> <li> Starting with Redis version 7.0.0: Added support for uppercase unit names. </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/georadiusbymember/"/> <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/delete-custom-resources/.html
<section class="prose w-full py-12 max-w-none"> <h1> Delete custom resources </h1> <p class="text-lg -mt-5 mb-10"> This article explains how to delete Redis Enterprise clusters and Redis Enterprise databases from your Kubernetes environment. </p> <h2 id="multi-namespace-management"> Multi-namespace management </h2> <p> Before you can delete a namespace, you must remove the Redis custom resources ( <a href="#delete-a-database-redb"> REDB </a> , <a href="#delete-a-redis-enterprise-cluster-rec"> REC </a> , and <a href="#delete-operator-from-one-namespace"> operator </a> ) residing within a namespace before you can delete that namespace. Deleting namespace containing an REDB may cause errors or data loss. </p> <h2 id="delete-a-database-redb"> Delete a database (REDB) </h2> <p> To delete a database managed by the Redis Enterprise Kubernetes operator, run <code> kubectl delete redb &lt;your-db-name&gt; </code> from your K8s cluster. </p> <p> When you delete a database, your data and the REDB custom resource are also deleted. </p> <h2 id="delete-a-redis-enterprise-cluster-rec"> Delete a Redis Enterprise cluster (REC) </h2> <p> To delete a Redis Enterprise cluster managed by the operator: </p> <ol> <li> <p> Delete all the databases in your cluster. </p> </li> <li> <p> Run <code> kubectl delete rec &lt;your-rec-name&gt; </code> from your K8s cluster. </p> </li> </ol> <p> When you delete your cluster, your databases and the REC custom resource are also deleted. However, persistent volume claims (PVCs) for your cluster are not deleted in the process. If you want to delete your PVCs, you'll have to delete them manually. </p> <h2 id="delete-the-operator"> Delete the operator </h2> <p> There are two ways to delete the operator. You can delete the entire operator bundle, but this will also delete any cluster-wide resources created by the operator. To only delete resources within a specific namespace and leave other cluster-wide resources intact, you need to delete each resource manually. </p> <p> Whether you decide to delete the entire bundle or just resources from a specific namespace, it's important to delete the operator ConfigMap ( <code> operator-environment-config </code> ). </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl delete cm operator-environment-config </span></span></code></pre> </div> <h3 id="delete-operator-bundle"> Delete operator bundle </h3> <p> To delete the operator from your K8s cluster, you can delete the operator bundle with: </p> <ul> <li> <code> kubectl delete -f bundle.yaml </code> for non-OpenShift K8s deployments </li> <li> <code> kubectl delete -f openshift.bundle.yaml </code> for OpenShift deployments </li> </ul> <p> This will remove the operator and its custom resource definitions (CRDs) from your K8s cluster. </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> The Redis Enterprise CRDs are non-namespaced resources, meaning they are shared across your entire K8s cluster. Deleting CRDs in one namespace will delete custom resources in every other namespace across the K8s cluster. </div> </div> <h3 id="delete-operator-from-one-namespace"> Delete operator from one namespace </h3> <p> If you have Redis Enterprise clusters running in different namespaces on the same K8s cluster, deleting the entire operator bundle might cause data loss. </p> <p> To safely delete the operator from one namespace without affecting the others, delete the operator files individually, excluding the CRD files: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl delete -f role.yaml </span></span><span class="line"><span class="cl">kubectl delete -f role_binding.yaml </span></span><span class="line"><span class="cl">kubectl delete -f service_account.yaml </span></span><span class="line"><span class="cl">kubectl delete -f admission-service.yaml </span></span><span class="line"><span class="cl">kubectl delete -f operator.yaml </span></span></code></pre> </div> <p> You will also need to remove <a href="/docs/latest/operate/kubernetes/deployment/quick-start/#webhook"> the <code> namespaceSelector </code> section from the validating webhook </a> . </p> <h2 id="delete-an-active-active-database-reaadb"> Delete an Active-Active database (REAADB) </h2> <ol> <li> On one of the existing participating clusters, delete the REEADB (substituting <code> &lt;reaadb-name&gt; </code> with your database name). </li> </ol> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl delete reaadb &lt;reaadb-name&gt; </span></span></code></pre> </div> <ol start="2"> <li> Verify the REAADB no longer exists. </li> </ol> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get reaadb -o<span class="o">=</span><span class="nv">jsonpath</span><span class="o">=</span><span class="s1">'{range .items[*]}{.metadata.name}'</span> </span></span></code></pre> </div> <h2 id="delete-a-remote-cluster-rerc"> Delete a remote cluster (RERC) </h2> <ol> <li> <p> Verify the RERC you want to delete isn't listed as a participating cluster in any REAADB resources. </p> <p> If an RERC is still listed as a participating cluster in any database, the deletion will be blocked. </p> </li> <li> <p> On one of the existing participating clusters, delete the RERC (substituting <code> &lt;rerc-name&gt; </code> with your database name). </p> </li> </ol> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl delete rerc &lt;rerc-name&gt; </span></span></code></pre> </div> <ol start="3"> <li> Verify the RERC no longer exists. </li> </ol> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get rerc -o<span class="o">=</span><span class="nv">jsonpath</span><span class="o">=</span><span class="s1">'{range .items[*]}{.metadata.name}'</span> </span></span></code></pre> </div> <h2 id="troubleshoot-redb-deletion"> Troubleshoot REDB deletion </h2> <p> The operator attaches a finalizer to the Redis Enterprise database (REDB) object. This makes sure the database is deleted before the REDB custom resource is removed from the K8s cluster. </p> <p> If the operator isn't running, or some other fatal error occurs, the finalizer isn't removed automatically by the operator. In this case, you won't be able to delete your REDB resource. </p> <p> If this happens, you can remove the finalizer manually. </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> If you remove the finalizer manually, there is no guarantee that the underlying REDB has been deleted. This may cause resource issues and require manual intervention. </div> </div> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl patch redb &lt;your-db-name&gt; --type<span class="o">=</span>json -p <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> <span class="s1">'[{"op":"remove","path":"/metadata/finalizers","value":"finalizer.redisenterprisedatabases.app.redislabs.com"}]'</span> </span></span></code></pre> </div> <h2 id="troubleshoot-rec-deletion"> Troubleshoot REC deletion </h2> <p> The operator attaches a finalizer to the Redis Enterprise cluster (REC) object. This makes sure the Redis cluster is deleted before the REC custom resource is removed from the K8s cluster. </p> <p> If the operator isn't running, or some other fatal error occurs, the finalizer isn't removed automatically by the operator. In this case, you won't be able to delete your REC resource. </p> <p> If this happens, you can remove the finalizer manually. </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> If you remove the finalizer manually, there is no guarantee that the underlying REC has been deleted. This may cause resource issues and require manual intervention. </div> </div> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl patch rec &lt;your-rec-name&gt; --type<span class="o">=</span>json -p <span class="se">\ </span></span></span><span class="line"><span class="cl"><span class="se"></span> <span class="s1">'[{"op":"remove","path":"/metadata/finalizers","value":"redbfinalizer.redisenterpriseclusters.app.redislabs.com"}]'</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/kubernetes/delete-custom-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/rest-api/requests/shards/actions/migrate/.html
<section class="prose w-full py-12 max-w-none"> <h1> Migrate shards requests </h1> <p class="text-lg -mt-5 mb-10"> REST API requests to migrate database shards </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#post-multi-shards"> POST </a> </td> <td> <code> /v1/shards/actions/migrate </code> </td> <td> Migrate multiple shards </td> </tr> <tr> <td> <a href="#post-shard"> POST </a> </td> <td> <code> /v1/shards/{uid}/actions/migrate </code> </td> <td> Migrate a specific shard </td> </tr> </tbody> </table> <h2 id="post-multi-shards"> Migrate multiple shards </h2> <pre><code>POST /v1/shards/actions/migrate </code></pre> <p> Migrates the list of given shard UIDs to the node specified by <code> target_node_uid </code> . The shards can be from multiple databases. This request is asynchronous. </p> <p> For more information about shard migration use cases and considerations, see <a href="/docs/latest/operate/rs/7.4/databases/migrate-shards/"> Migrate database shards </a> . </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/7.4/references/rest-api/permissions/#migrate_shard"> migrate_shard </a> </td> <td> admin <br/> cluster_member <br/> db_member </td> </tr> </tbody> </table> <h3 id="post-multi-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>POST /shards/actions/migrate </code></pre> <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">"shard_uids"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"2"</span><span class="p">,</span><span class="s2">"4"</span><span class="p">,</span><span class="s2">"6"</span><span class="p">],</span> </span></span><span class="line"><span class="cl"> <span class="nt">"target_node_uid"</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">"override_rack_policy"</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">"preserve_roles"</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_concurrent_bdb_migrations"</span><span class="p">:</span> <span class="mi">3</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </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> 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="post-multi-request-body"> Request body </h4> <p> The request body is a JSON object that can contain the following fields: </p> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> shard_uids </td> <td> array of strings </td> <td> List of shard UIDs to migrate. </td> </tr> <tr> <td> target_node_uid </td> <td> integer </td> <td> UID of the node to where the shards should migrate. </td> </tr> <tr> <td> override_rack_policy </td> <td> boolean </td> <td> If true, overrides and ignores rack-aware policy violations. </td> </tr> <tr> <td> dry_run </td> <td> boolean </td> <td> Determines whether the migration is actually done. If true, will just do a dry run. If the dry run succeeds, the request returns a <code> 200 OK </code> status code. Otherwise, it returns a JSON object with an error code and description. </td> </tr> <tr> <td> preserve_roles </td> <td> boolean </td> <td> If true, preserves the migrated shards' roles after migration. </td> </tr> <tr> <td> max_concurrent_bdb_migrations </td> <td> integer </td> <td> The number of concurrent databases that can migrate shards. </td> </tr> </tbody> </table> <h3 id="post-multi-response"> Response </h3> <p> Returns a JSON object with an <code> action_uid </code> . 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> <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">"action_uid"</span><span class="p">:</span> <span class="s2">"e5e24ddf-a456-4a7e-ad53-4463cd44880e"</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> <h3 id="post-multi-status-codes"> Status codes </h3> <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> 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> Conflicting 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> A list of shard UIDs is required and not given, a specified shard does not exist, or a node UID is required and not given. </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> Migration failed. </td> </tr> </tbody> </table> <h2 id="post-shard"> Migrate shard </h2> <pre><code>POST /v1/shards/{int: uid}/actions/migrate </code></pre> <p> Migrates the shard with the given <code> shard_uid </code> to the node specified by <code> target_node_uid </code> . If the shard is already on the target node, nothing happens. This request is asynchronous. </p> <p> For more information about shard migration use cases and considerations, see <a href="/docs/latest/operate/rs/7.4/databases/migrate-shards/"> Migrate database shards </a> . </p> <h4 id="required-permissions-1"> Required permissions </h4> <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/#migrate_shard"> migrate_shard </a> </td> <td> admin <br/> cluster_member <br/> db_member </td> </tr> </tbody> </table> <h3 id="post-request"> Request </h3> <h4 id="example-http-request-1"> Example HTTP request </h4> <pre><code>POST /shards/1/actions/migrate </code></pre> <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">"target_node_uid"</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">"override_rack_policy"</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">"preserve_roles"</span><span class="p">:</span> <span class="kc">false</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <h4 id="request-headers-1"> Request 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 shard to migrate. </td> </tr> </tbody> </table> <h4 id="post-request-body"> Request body </h4> <p> The request body is a JSON object that can contain the following fields: </p> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> target_node_uid </td> <td> integer </td> <td> UID of the node to where the shard should migrate. </td> </tr> <tr> <td> override_rack_policy </td> <td> boolean </td> <td> If true, overrides and ignores rack-aware policy violations. </td> </tr> <tr> <td> dry_run </td> <td> boolean </td> <td> Determines whether the migration is actually done. If true, will just do a dry run. If the dry run succeeds, the request returns a <code> 200 OK </code> status code. Otherwise, it returns a JSON object with an error code and description. </td> </tr> <tr> <td> preserve_roles </td> <td> boolean </td> <td> If true, preserves the migrated shards' roles after migration. </td> </tr> </tbody> </table> <h3 id="post-response"> Response </h3> <p> Returns a JSON object with an <code> action_uid </code> . 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> <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">"action_uid"</span><span class="p">:</span> <span class="s2">"e5e24ddf-a456-4a7e-ad53-4463cd44880e"</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> <h3 id="post-status-codes"> Status codes </h3> <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> No error. </td> </tr> <tr> <td> <a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found"> 404 Not Found </a> </td> <td> Shard does not exist, or node UID is required and not given. </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. </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/shards/actions/migrate/"/> <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/cli-utilities/rladmin/info/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin info </h1> <p class="text-lg -mt-5 mb-10"> Shows the current configuration of a cluster, database, node, or proxy. </p> <p> Shows the current configuration of specified databases, proxies, clusters, or nodes. </p> <h2 id="info-cluster"> <code> info cluster </code> </h2> <p> Lists the current configuration for the cluster. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin info cluster </span></span></code></pre> </div> <h3 id="parameters"> Parameters </h3> <p> None </p> <h3 id="returns"> Returns </h3> <p> Returns the current configuration for the cluster. </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 info cluster </span></span><span class="line"><span class="cl">Cluster configuration: </span></span><span class="line"><span class="cl"> repl_diskless: enabled </span></span><span class="line"><span class="cl"> shards_overbooking: disabled </span></span><span class="line"><span class="cl"> default_non_sharded_proxy_policy: single </span></span><span class="line"><span class="cl"> default_sharded_proxy_policy: single </span></span><span class="line"><span class="cl"> default_shards_placement: dense </span></span><span class="line"><span class="cl"> default_fork_evict_ram: enabled </span></span><span class="line"><span class="cl"> default_provisioned_redis_version: 6.0 </span></span><span class="line"><span class="cl"> redis_migrate_node_threshold: 0KB <span class="o">(</span><span class="m">0</span> bytes<span class="o">)</span> </span></span><span class="line"><span class="cl"> redis_migrate_node_threshold_percent: <span class="m">4</span> <span class="o">(</span>%<span class="o">)</span> </span></span><span class="line"><span class="cl"> redis_provision_node_threshold: 0KB <span class="o">(</span><span class="m">0</span> bytes<span class="o">)</span> </span></span><span class="line"><span class="cl"> redis_provision_node_threshold_percent: <span class="m">12</span> <span class="o">(</span>%<span class="o">)</span> </span></span><span class="line"><span class="cl"> max_simultaneous_backups: <span class="m">4</span> </span></span><span class="line"><span class="cl"> slave_ha: enabled </span></span><span class="line"><span class="cl"> slave_ha_grace_period: <span class="m">600</span> </span></span><span class="line"><span class="cl"> slave_ha_cooldown_period: <span class="m">3600</span> </span></span><span class="line"><span class="cl"> slave_ha_bdb_cooldown_period: <span class="m">7200</span> </span></span><span class="line"><span class="cl"> parallel_shards_upgrade: <span class="m">0</span> </span></span><span class="line"><span class="cl"> show_internals: disabled </span></span><span class="line"><span class="cl"> expose_hostnames_for_all_suffixes: disabled </span></span><span class="line"><span class="cl"> login_lockout_threshold: <span class="m">5</span> </span></span><span class="line"><span class="cl"> login_lockout_duration: <span class="m">1800</span> </span></span><span class="line"><span class="cl"> login_lockout_counter_reset_after: <span class="m">900</span> </span></span><span class="line"><span class="cl"> default_concurrent_restore_actions: <span class="m">10</span> </span></span><span class="line"><span class="cl"> endpoint_rebind_propagation_grace_time: <span class="m">15</span> </span></span><span class="line"><span class="cl"> data_internode_encryption: disabled </span></span><span class="line"><span class="cl"> redis_upgrade_policy: major </span></span><span class="line"><span class="cl"> db_conns_auditing: disabled </span></span><span class="line"><span class="cl"> watchdog profile: local-network </span></span><span class="line"><span class="cl"> http support: enabled </span></span><span class="line"><span class="cl"> upgrade mode: disabled </span></span><span class="line"><span class="cl"> cm_session_timeout_minutes: <span class="m">15</span> </span></span><span class="line"><span class="cl"> cm_port: <span class="m">8443</span> </span></span><span class="line"><span class="cl"> cnm_http_port: <span class="m">8080</span> </span></span><span class="line"><span class="cl"> cnm_https_port: <span class="m">9443</span> </span></span><span class="line"><span class="cl"> bigstore_driver: speedb </span></span></code></pre> </div> <h2 id="info-db"> <code> info db </code> </h2> <p> Shows the current configuration for databases. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin info db <span class="o">[</span> <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></code></pre> </div> <h3 id="parameters-1"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> db:id </td> <td> ID of the specified database (optional) </td> </tr> <tr> <td> name </td> <td> Name of the specified database (optional) </td> </tr> </tbody> </table> <h3 id="returns-1"> Returns </h3> <p> Returns the current configuration for all databases. </p> <p> If <code> db:&lt;id&gt; </code> or <code> &lt;name&gt; </code> is specified, returns the current configuration for the specified database. </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 info db db:1 </span></span><span class="line"><span class="cl">db:1 <span class="o">[</span>database1<span class="o">]</span>: </span></span><span class="line"><span class="cl"> client_buffer_limits: 1GB <span class="o">(</span>hard limit<span class="o">)</span>/512MB <span class="o">(</span>soft limit<span class="o">)</span> in <span class="m">30</span> seconds </span></span><span class="line"><span class="cl"> slave_buffer: auto </span></span><span class="line"><span class="cl"> pubsub_buffer_limits: 32MB <span class="o">(</span>hard limit<span class="o">)</span>/8MB <span class="o">(</span>soft limit<span class="o">)</span> in <span class="m">60</span> seconds </span></span><span class="line"><span class="cl"> proxy_client_buffer_limits: 0KB <span class="o">(</span>hard limit<span class="o">)</span>/0KB <span class="o">(</span>soft limit<span class="o">)</span> in <span class="m">0</span> seconds </span></span><span class="line"><span class="cl"> proxy_slave_buffer_limits: 1GB <span class="o">(</span>hard limit<span class="o">)</span>/512MB <span class="o">(</span>soft limit<span class="o">)</span> in <span class="m">60</span> seconds </span></span><span class="line"><span class="cl"> proxy_pubsub_buffer_limits: 32MB <span class="o">(</span>hard limit<span class="o">)</span>/8MB <span class="o">(</span>soft limit<span class="o">)</span> in <span class="m">60</span> seconds </span></span><span class="line"><span class="cl"> repl_backlog: 1.02MB <span class="o">(</span><span class="m">1073741</span> bytes<span class="o">)</span> </span></span><span class="line"><span class="cl"> repl_timeout: <span class="m">360</span> seconds </span></span><span class="line"><span class="cl"> repl_diskless: default </span></span><span class="line"><span class="cl"> master_persistence: disabled </span></span><span class="line"><span class="cl"> maxclients: <span class="m">10000</span> </span></span><span class="line"><span class="cl"> conns: <span class="m">5</span> </span></span><span class="line"><span class="cl"> conns_type: per-thread </span></span><span class="line"><span class="cl"> sched_policy: cmp </span></span><span class="line"><span class="cl"> max_aof_file_size: 300GB </span></span><span class="line"><span class="cl"> max_aof_load_time: <span class="m">3600</span> seconds </span></span><span class="line"><span class="cl"> dedicated_replicaof_threads: <span class="m">5</span> </span></span><span class="line"><span class="cl"> max_client_pipeline: <span class="m">200</span> </span></span><span class="line"><span class="cl"> max_shard_pipeline: <span class="m">2000</span> </span></span><span class="line"><span class="cl"> max_connections: <span class="m">0</span> </span></span><span class="line"><span class="cl"> oss_cluster: disabled </span></span><span class="line"><span class="cl"> oss_cluster_api_preferred_ip_type: internal </span></span><span class="line"><span class="cl"> gradual_src_mode: disabled </span></span><span class="line"><span class="cl"> gradual_src_max_sources: <span class="m">1</span> </span></span><span class="line"><span class="cl"> gradual_sync_mode: auto </span></span><span class="line"><span class="cl"> gradual_sync_max_shards_per_source: <span class="m">1</span> </span></span><span class="line"><span class="cl"> slave_ha: disabled <span class="o">(</span>database<span class="o">)</span> </span></span><span class="line"><span class="cl"> mkms: enabled </span></span><span class="line"><span class="cl"> oss_sharding: disabled </span></span><span class="line"><span class="cl"> mtls_allow_weak_hashing: disabled </span></span><span class="line"><span class="cl"> mtls_allow_outdated_certs: disabled </span></span><span class="line"><span class="cl"> data_internode_encryption: disabled </span></span><span class="line"><span class="cl"> proxy_policy: single </span></span><span class="line"><span class="cl"> db_conns_auditing: disabled </span></span><span class="line"><span class="cl"> syncer_mode: centralized </span></span></code></pre> </div> <h2 id="info-node"> <code> info node </code> </h2> <p> Lists the current configuration for all nodes. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin info node <span class="o">[</span> &lt;id&gt; <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> id </td> <td> ID of the specified node </td> </tr> </tbody> </table> <h3 id="returns-2"> Returns </h3> <p> Returns the current configuration for all nodes. </p> <p> If <code> &lt;id&gt; </code> is specified, returns the current configuration for the specified node. </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 info node <span class="m">3</span> </span></span><span class="line"><span class="cl">Command Output: node:3 </span></span><span class="line"><span class="cl"> address: 198.51.100.17 </span></span><span class="line"><span class="cl"> external addresses: N/A </span></span><span class="line"><span class="cl"> recovery path: N/A </span></span><span class="line"><span class="cl"> quorum only: disabled </span></span><span class="line"><span class="cl"> max redis servers: <span class="m">100</span> </span></span><span class="line"><span class="cl"> max listeners: <span class="m">100</span> </span></span></code></pre> </div> <h2 id="info-proxy"> <code> info proxy </code> </h2> <p> Lists the current configuration for a proxy. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin info proxy <span class="o">{</span> &lt;id&gt; <span class="p">|</span> all <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> id </td> <td> ID of the specified proxy </td> </tr> <tr> <td> all </td> <td> Show the current configuration for all proxies (optional) </td> </tr> </tbody> </table> <h3 id="returns-3"> Returns </h3> <p> If no parameter is specified or the <code> all </code> option is specified, returns the current configuration for all proxies. </p> <p> If <code> &lt;id&gt; </code> is specified, returns the current configuration for the specified proxy. </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 info proxy </span></span><span class="line"><span class="cl">proxy:1 </span></span><span class="line"><span class="cl"> mode: dynamic </span></span><span class="line"><span class="cl"> scale_threshold: <span class="m">80</span> <span class="o">(</span>%<span class="o">)</span> </span></span><span class="line"><span class="cl"> scale_duration: <span class="m">30</span> <span class="o">(</span>seconds<span class="o">)</span> </span></span><span class="line"><span class="cl"> max_threads: <span class="m">8</span> </span></span><span class="line"><span class="cl"> threads: <span class="m">3</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/rs/references/cli-utilities/rladmin/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/operate/rs/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/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/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 <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 /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/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/cluster/cluster_alert_settings_with_threshold/.html
<section class="prose w-full py-12 max-w-none"> <h1> Cluster alert settings with threshold object </h1> <p class="text-lg -mt-5 mb-10"> Documents the cluster_alert_settings_with_threshold 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> enabled </td> <td> boolean (default: false) </td> <td> Alert enabled or disabled </td> </tr> <tr> <td> threshold </td> <td> string </td> <td> Threshold for alert going on/off </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/cluster/cluster_alert_settings_with_threshold/"/> <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_database_api/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisEnterpriseDatabase 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> RedisEnterpriseDatabase is the Schema for the redisenterprisedatabases 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> RedisEnterpriseDatabase </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> RedisEnterpriseDatabaseSpec defines the desired state of RedisEnterpriseDatabase <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#status"> status </a> </td> <td> object </td> <td> RedisEnterpriseDatabaseStatus defines the observed state of RedisEnterpriseDatabase <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="spec"> spec </h3> <p> <sup> <sup> <a href="#"> ↩ Parent </a> </sup> </sup> </p> <p> RedisEnterpriseDatabaseSpec defines the desired state of RedisEnterpriseDatabase </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> Connection/ association to the Active-Active database. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettings"> alertSettings </a> </td> <td> object </td> <td> Settings for database alerts <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbackup"> 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? <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="#specmoduleslist"> 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="#specredisenterprisecluster"> 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="#specreplicasources"> 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 and Flash), as specified by "memorySize". <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specrolespermissions"> 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> enum </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/> <br/> <i> Enum </i> : dense, sparse <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 (redis or memcached). Defaults to "redis". <br/> <br/> <i> Enum </i> : redis, memcached <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specupgradespec"> upgradeSpec </a> </td> <td> object </td> <td> Specifications for DB upgrade. <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> 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="specalertsettings"> spec.alertSettings </h3> <p> <sup> <sup> <a href="#spec"> ↩ 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="#specalertsettingsbdb_backup_delayed"> bdb_backup_delayed </a> </td> <td> object </td> <td> Periodic backup has been delayed for longer than specified threshold value [minutes]. -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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 -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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 -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_high_latency"> bdb_high_latency </a> </td> <td> object </td> <td> Latency is higher than specified threshold value [micro-sec] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_high_throughput"> bdb_high_throughput </a> </td> <td> object </td> <td> Throughput is higher than specified threshold value [requests / sec.] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_long_running_action"> bdb_long_running_action </a> </td> <td> object </td> <td> An alert for state-machines that are running for too long -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_low_throughput"> bdb_low_throughput </a> </td> <td> object </td> <td> Throughput is lower than specified threshold value [requests / sec.] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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 -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_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] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specalertsettingsbdb_size"> bdb_size </a> </td> <td> object </td> <td> Dataset size has reached the threshold value [% of the memory limit] expected fields: -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_backup_delayed"> spec.alertSettings.bdb_backup_delayed </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Periodic backup has been delayed for longer than specified threshold value [minutes]. -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_crdt_src_high_syncer_lag"> spec.alertSettings.bdb_crdt_src_high_syncer_lag </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Active-active source - sync lag is higher than specified threshold value [seconds] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_crdt_src_syncer_connection_error"> spec.alertSettings.bdb_crdt_src_syncer_connection_error </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Active-active source - sync has connection error while trying to connect replica source -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_crdt_src_syncer_general_error"> spec.alertSettings.bdb_crdt_src_syncer_general_error </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Active-active source - sync encountered in general error -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_high_latency"> spec.alertSettings.bdb_high_latency </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Latency is higher than specified threshold value [micro-sec] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_high_throughput"> spec.alertSettings.bdb_high_throughput </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Throughput is higher than specified threshold value [requests / sec.] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_long_running_action"> spec.alertSettings.bdb_long_running_action </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> An alert for state-machines that are running for too long -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_low_throughput"> spec.alertSettings.bdb_low_throughput </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Throughput is lower than specified threshold value [requests / sec.] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_ram_dataset_overhead"> spec.alertSettings.bdb_ram_dataset_overhead </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Dataset RAM overhead of a shard has reached the threshold value [% of its RAM limit] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_ram_values"> spec.alertSettings.bdb_ram_values </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Percent of values kept in a shard's RAM is lower than [% of its key count] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_replica_src_high_syncer_lag"> spec.alertSettings.bdb_replica_src_high_syncer_lag </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Replica-of source - sync lag is higher than specified threshold value [seconds] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_replica_src_syncer_connection_error"> spec.alertSettings.bdb_replica_src_syncer_connection_error </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Replica-of source - sync has connection error while trying to connect replica source -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_shard_num_ram_values"> spec.alertSettings.bdb_shard_num_ram_values </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Number of values kept in a shard's RAM is lower than [values] -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specalertsettingsbdb_size"> spec.alertSettings.bdb_size </h3> <p> <sup> <sup> <a href="#specalertsettings"> ↩ Parent </a> </sup> </sup> </p> <p> Dataset size has reached the threshold value [% of the memory limit] expected fields: -Note threshold is commented (allow string/int/float and support backwards compatibility) but is required </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> false </td> </tr> </tbody> </table> <h3 id="specbackup"> spec.backup </h3> <p> <sup> <sup> <a href="#spec"> ↩ 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="#specbackupabs"> abs </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbackupftp"> ftp </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbackupgcs"> 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="#specbackupmount"> mount </a> </td> <td> object </td> <td> MountPointStorage <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbackups3"> s3 </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbackupsftp"> sftp </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#specbackupswift"> swift </a> </td> <td> object </td> <td> <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="specbackupabs"> spec.backup.abs </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ Parent </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 K8s 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="specbackupftp"> spec.backup.ftp </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ Parent </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[/] <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="specbackupgcs"> spec.backup.gcs </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ 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 K8s 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="specbackupmount"> spec.backup.mount </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ 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="specbackups3"> spec.backup.s3 </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ Parent </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 K8s 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="specbackupsftp"> spec.backup.sftp </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ Parent </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 K8s 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="specbackupswift"> spec.backup.swift </h3> <p> <sup> <sup> <a href="#specbackup"> ↩ Parent </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 K8s 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="specmoduleslist"> spec.modulesList[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ 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> 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="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="specreplicasources"> spec.replicaSources[] </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> 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="specrolespermissions"> spec.rolesPermissions[] </h3> <p> <sup> <sup> <a href="#spec"> ↩ 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 <br/> </td> <td> true </td> </tr> <tr> <td> role </td> <td> string </td> <td> Role Name of RolePermissionType <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="specupgradespec"> spec.upgradeSpec </h3> <p> <sup> <sup> <a href="#spec"> ↩ 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. Notes - All modules must be without specifing the version. in addition, This field is currently not supported for Active-Active databases. <br/> </td> <td> true </td> </tr> </tbody> </table> <h3 id="status"> status </h3> <p> <sup> <sup> <a href="#"> ↩ Parent </a> </sup> </sup> </p> <p> RedisEnterpriseDatabaseStatus defines the observed state of RedisEnterpriseDatabase </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> <a href="#statusactiveactive"> activeActive </a> </td> <td> object </td> <td> Connection/ association to the Active-Active database. <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statusbackupinfo"> backupInfo </a> </td> <td> object </td> <td> Information on the database's periodic backup <br/> </td> <td> false </td> </tr> <tr> <td> createdTime </td> <td> string </td> <td> Time when the database was created <br/> </td> <td> false </td> </tr> <tr> <td> databaseUID </td> <td> string </td> <td> Database UID provided by redis enterprise <br/> </td> <td> false </td> </tr> <tr> <td> <a href="#statusinternalendpoints"> internalEndpoints </a> </td> <td> []object </td> <td> Endpoints listed internally by the Redis Enterprise Cluster. Can be used to correlate a ReplicaSourceStatus entry. <br/> </td> <td> false </td> </tr> <tr> <td> lastActionStatus </td> <td> string </td> <td> Status of the last action done by operator on this database <br/> </td> <td> false </td> </tr> <tr> <td> lastActionUid </td> <td> string </td> <td> UID of the last action done by operator on this database <br/> </td> <td> false </td> </tr> <tr> <td> lastUpdated </td> <td> string </td> <td> Time when the database was last updated <br/> </td> <td> false </td> </tr> <tr> <td> observedGeneration </td> <td> integer </td> <td> The generation (built in update counter of K8s) of the REDB resource that was fully acted upon, meaning that all changes were handled and sent as an API call to the Redis Enterprise Cluster (REC). This field value should equal the current generation when the resource changes were handled. Note: the lastActionStatus field tracks actions handled asynchronously by the Redis Enterprise Cluster. <br/> <br/> <i> Format </i> : int64 <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> <a href="#statusreplicasourcestatuses"> replicaSourceStatuses </a> </td> <td> []object </td> <td> ReplicaSource statuses <br/> </td> <td> false </td> </tr> <tr> <td> shardStatuses </td> <td> map[string]integer </td> <td> Aggregated statuses of shards <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 database <br/> </td> <td> false </td> </tr> <tr> <td> version </td> <td> string </td> <td> Database compatibility version <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusactiveactive"> status.activeActive </h3> <p> <sup> <sup> <a href="#status"> ↩ 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="statusbackupinfo"> status.backupInfo </h3> <p> <sup> <sup> <a href="#status"> ↩ Parent </a> </sup> </sup> </p> <p> Information on the database's periodic backup </p> <table> <thead> <tr> <th> Name </th> <th> Type </th> <th> Description </th> <th> Required </th> </tr> </thead> <tbody> <tr> <td> backupFailureReason </td> <td> string </td> <td> Reason of last failed backup process <br/> </td> <td> false </td> </tr> <tr> <td> backupHistory </td> <td> integer </td> <td> Backup history retention policy (number of days, 0 is forever) <br/> </td> <td> false </td> </tr> <tr> <td> backupInterval </td> <td> integer </td> <td> Interval in seconds in which automatic backup will be initiated <br/> </td> <td> false </td> </tr> <tr> <td> backupIntervalOffset </td> <td> integer </td> <td> Offset (in seconds) from round backup interval when automatic backup will be initiated (should be less than backup_interval) <br/> </td> <td> false </td> </tr> <tr> <td> backupProgressPercentage </td> <td> integer </td> <td> Database scheduled periodic backup progress (percentage) <br/> </td> <td> false </td> </tr> <tr> <td> backupStatus </td> <td> string </td> <td> Status of scheduled periodic backup process <br/> </td> <td> false </td> </tr> <tr> <td> lastBackupTime </td> <td> string </td> <td> Time of last successful backup <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusinternalendpoints"> status.internalEndpoints[] </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> host </td> <td> string </td> <td> Hostname assigned to the database <br/> </td> <td> false </td> </tr> <tr> <td> port </td> <td> integer </td> <td> Database port name <br/> </td> <td> false </td> </tr> </tbody> </table> <h3 id="statusreplicasourcestatuses"> status.replicaSourceStatuses[] </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> endpointHost </td> <td> string </td> <td> The internal host name of the replica source database. Can be used as an identifier. See the internalEndpoints list on the REDB status. <br/> </td> <td> true </td> </tr> <tr> <td> lag </td> <td> integer </td> <td> Lag in millisec between source and destination (while synced). <br/> </td> <td> false </td> </tr> <tr> <td> lastError </td> <td> string </td> <td> Last error encountered when syncing from the source. <br/> </td> <td> false </td> </tr> <tr> <td> lastUpdate </td> <td> string </td> <td> Time when we last receive an update from the source. <br/> </td> <td> false </td> </tr> <tr> <td> rdbSize </td> <td> integer </td> <td> The source’s RDB size to be transferred during the syncing phase. <br/> </td> <td> false </td> </tr> <tr> <td> rdbTransferred </td> <td> integer </td> <td> Number of bytes transferred from the source’s RDB during the syncing phase. <br/> </td> <td> false </td> </tr> <tr> <td> status </td> <td> string </td> <td> Sync status of this source <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_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/command-getkeys/.html
<section class="prose w-full py-12"> <h1 class="command-name"> COMMAND GETKEYS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">COMMAND GETKEYS command [arg [arg ...]]</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 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> @slow </code> <span class="mr-1 last:hidden"> , </span> <code> @connection </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> Returns <a href="/docs/latest/develop/reference/protocol-spec/#arrays"> Array reply </a> of keys from a full Redis command. </p> <p> <code> COMMAND GETKEYS </code> is a helper command to let you find the keys from a full Redis command. </p> <p> <a href="/docs/latest/commands/command/"> <code> COMMAND </code> </a> provides information on how to find the key names of each command (see <code> firstkey </code> , <a href="/docs/latest/develop/reference/key-specs#logical-operation-flags"> key specifications </a> , and <code> movablekeys </code> ), but in some cases it's not possible to find keys of certain commands and then the entire command must be parsed to discover some / all key names. You can use <code> COMMAND GETKEYS </code> or <a href="/docs/latest/commands/command-getkeysandflags/"> <code> COMMAND GETKEYSANDFLAGS </code> </a> to discover key names directly from how Redis parses the commands. </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; COMMAND GETKEYS MSET a b c d e f 1) "a" 2) "c" 3) "e" redis&gt; COMMAND GETKEYS EVAL "not consulted" 3 key1 key2 key3 arg1 arg2 arg3 argN 1) "key1" 2) "key2" 3) "key3" redis&gt; COMMAND GETKEYS SORT mylist ALPHA STORE outlist 1) "mylist" 2) "outlist" </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#arrays"> Array reply </a> : list of keys from the given command. <h2 id="resp3-reply"> RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a list of keys from the given command. <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-getkeys/"/> <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/library_configuration/.html
<section class="prose w-full py-12 max-w-none"> <h1> Library configuration </h1> <p class="text-lg -mt-5 mb-10"> How to use configuration in JavaScript functions </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> When writing a library, you may want to provide a loading configuration so that different users can use the same library with slightly different behaviour, without changing the base code. For example, assume you write a library that adds a <code> __last_updated__ </code> field to a hash (you can see how it can also be done with <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/keyspace_triggers/"> keyspace triggers </a> ), the code will look like this: </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">lib</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">registerFunction</span><span class="p">(</span><span class="s2">"hset"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">client</span><span class="p">,</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">field</span><span class="p">,</span> <span class="nx">val</span><span class="p">){</span> </span></span><span class="line"><span class="cl"> <span class="c1">// get the current time in ms </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="kd">var</span> <span class="nx">curr_time</span> <span class="o">=</span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s2">"time"</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'hset'</span><span class="p">,</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">field</span><span class="p">,</span> <span class="nx">val</span><span class="p">,</span> <span class="s2">"__last_update__"</span><span class="p">,</span> <span class="nx">curr_time</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="p">});</span> </span></span></code></pre> </div> <p> Run example: </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; TFCALL lib.hset k a b <span class="m">0</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; hgetall k </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"foo"</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"bar"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"__last_update__"</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"1658653125"</span> </span></span></code></pre> </div> <p> The problem with the above code is that the <code> __last_update__ </code> field is hard coded. What if we want to allow the user to configure it at runtime? Triggers and functions provide for specifying a library configuration at load time using a <a href="/docs/latest/commands/config/"> <code> CONFIG </code> </a> argument that is passed to the <code> TFUNCTION LOAD </code> command. The configuration argument accepts a string representation of a JSON object. The JSON will be provided to the library as a JS object under the <code> redis.config </code> variable. We can change the above example to accept the <code> __last_update__ </code> field name as a library configuration. The code will look like this: </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">lib</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kd">var</span> <span class="nx">last_update_field_name</span> <span class="o">=</span> <span class="s2">"__last_update__"</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="p">(</span><span class="nx">redis</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">last_update_field_name</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">redis</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">last_update_field_name</span> <span class="o">!=</span> <span class="s1">'string'</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">throw</span> <span class="s2">"last_update_field_name must be a string"</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="nx">last_update_field_name</span> <span class="o">=</span> <span class="nx">redis</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">last_update_field_name</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="nx">redis</span><span class="p">.</span><span class="nx">registerFunction</span><span class="p">(</span><span class="s2">"hset"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">client</span><span class="p">,</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">field</span><span class="p">,</span> <span class="nx">val</span><span class="p">){</span> </span></span><span class="line"><span class="cl"> <span class="c1">// get the current time in ms </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="kd">var</span> <span class="nx">curr_time</span> <span class="o">=</span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s2">"time"</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'hset'</span><span class="p">,</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">field</span><span class="p">,</span> <span class="nx">val</span><span class="p">,</span> <span class="nx">last_update_field_name</span><span class="p">,</span> <span class="nx">curr_time</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="p">});</span> </span></span></code></pre> </div> <p> Notice that in the above example we first set <code> last_update_field_name </code> to <code> __last_update__ </code> , the default value in cases where a value is not provided by the configuration. Then we check if we have <code> last_update_field_name </code> in our configuration and if we do we use it. We can now load our function with a <a href="/docs/latest/commands/config/"> <code> CONFIG </code> </a> argument: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">&gt; redis-cli -x TFUNCTION LOAD REPLACE CONFIG <span class="s1">'{"last_update_field_name":"last_update"}'</span> &lt; &lt;path to code file&gt; </span></span><span class="line"><span class="cl">OK </span></span></code></pre> </div> <p> We can see that the last update field name is <code> last_update </code> : </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; TFCALL lib.hset h a b <span class="m">0</span> </span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span> </span></span><span class="line"><span class="cl">127.0.0.1:6379&gt; hgetall h </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"a"</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"b"</span> </span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"last_update"</span> </span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"1658654047"</span> </span></span></code></pre> </div> <p> Notice, triggers and functions only provides the library with the JSON configuration. <strong> It's the library's responsibility to verify the correctness of the given configuration </strong> . </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/library_configuration/"/> <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/sync_source_stats/.html
<section class="prose w-full py-12 max-w-none"> <h1> Database syncer source stats requests </h1> <p class="text-lg -mt-5 mb-10"> Syncer source statistics requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-all-bdbs-sync_source_stats"> GET </a> </td> <td> <code> /v1/bdbs/{bdb_uid}/sync_source_stats </code> </td> <td> Get stats for all syncer sources </td> </tr> <tr> <td> <a href="#get-bdbs-sync_source_stats"> GET </a> </td> <td> <code> /v1/bdbs/{bdb_uid}/sync_source_stats/{uid} </code> </td> <td> Get stats for a specific syncer instance </td> </tr> </tbody> </table> <h2 id="get-all-bdbs-sync_source_stats"> Get all syncer source stats </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>bdb_uid<span class="o">}</span>/sync_source_stats </span></span></code></pre> </div> <p> Get stats for all syncer sources of a local database. </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_stats"> view_bdb_stats </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 /bdbs/1/sync_source_stats?interval<span class="o">=</span>5min </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> bdb_uid </td> <td> integer </td> <td> The unique ID of the local database. </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> interval </td> <td> string </td> <td> Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional) </td> </tr> <tr> <td> stime </td> <td> ISO_8601 </td> <td> Start time from which we want the stats. Should comply with the <a href="https://en.wikipedia.org/wiki/ISO_8601"> ISO_8601 </a> format (optional) </td> </tr> <tr> <td> etime </td> <td> ISO_8601 </td> <td> Optional end time after which we don't want the stats. Should comply with the <a href="https://en.wikipedia.org/wiki/ISO_8601"> ISO_8601 </a> format (optional) </td> </tr> </tbody> </table> <h3 id="get-all-response"> Response </h3> <p> Returns <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/"> statistics </a> for all syncer sources. </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 class="nt">"sync_source_stats"</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">"intervals"</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">"etime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:30:00Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes"</span><span class="p">:</span> <span class="mi">18528</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes_decompressed"</span><span class="p">:</span> <span class="mi">185992</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"5min"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"local_ingress_lag_time"</span><span class="p">:</span> <span class="mf">0.244</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:25:00Z"</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">"etime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:35:00Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes"</span><span class="p">:</span> <span class="mi">18</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes_decompressed"</span><span class="p">:</span> <span class="mi">192</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"5min"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"local_ingress_lag_time"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:30:00Z"</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="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="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> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Database does not exist. </td> </tr> </tbody> </table> <h2 id="get-bdbs-sync_source_stats"> Get syncer instance stats </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>bdb_uid<span class="o">}</span>/sync_source_stats/<span class="o">{</span>int: uid<span class="o">}</span> </span></span></code></pre> </div> <p> Get stats for a specific syncer (Replica Of) instance. </p> <h4 id="permissions-1"> Permissions </h4> <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_stats"> view_bdb_stats </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 /bdbs/1/sync_source_stats/1?interval<span class="o">=</span>5min </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-1"> URL parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> bdb_uid </td> <td> integer </td> <td> The unique ID of the local database. </td> </tr> <tr> <td> uid </td> <td> integer </td> <td> The sync_source uid. </td> </tr> </tbody> </table> <h4 id="query-parameters-1"> Query parameters </h4> <table> <thead> <tr> <th> Field </th> <th> Type </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> interval </td> <td> string </td> <td> Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional) </td> </tr> <tr> <td> stime </td> <td> ISO_8601 </td> <td> Optional start time from which we want the stats. Should comply with the <a href="https://en.wikipedia.org/wiki/ISO_8601"> ISO_8601 </a> format (optional) </td> </tr> <tr> <td> etime </td> <td> ISO_8601 </td> <td> Optional end time after which we don't want the stats. Should comply with the <a href="https://en.wikipedia.org/wiki/ISO_8601"> ISO_8601 </a> format (optional) </td> </tr> </tbody> </table> <h3 id="get-response"> Response </h3> <p> Returns <a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/"> statistics </a> for a specific syncer instance. </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">"intervals"</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">"etime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:30:00Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes"</span><span class="p">:</span> <span class="mi">18528</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes_decompressed"</span><span class="p">:</span> <span class="mi">185992</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"5min"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"local_ingress_lag_time"</span><span class="p">:</span> <span class="mf">0.244</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:25:00Z"</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">"etime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:35:00Z"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes"</span><span class="p">:</span> <span class="mi">18</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"ingress_bytes_decompressed"</span><span class="p">:</span> <span class="mi">192</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"5min"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"local_ingress_lag_time"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2017-10-22T19:30:00Z"</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="s2">"1"</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> Database or sync_source do not exist. </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/sync_source_stats/"/> <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/cli-utilities/crdb-cli/crdb/.html
<section class="prose w-full py-12 max-w-none"> <h1> crdb-cli crdb commands </h1> <p class="text-lg -mt-5 mb-10"> Manage Active-Active databases. </p> <p> Use <code> crdb-cli crdb </code> commands to manage Active-Active databases. </p> <h2 id="crdb-cli-crdb-commands"> <code> crdb-cli crdb </code> commands </h2> <table> <thead> <tr> <th style="text-align:left"> Command </th> <th style="text-align:left"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/add-instance/"> add-instance </a> </td> <td style="text-align:left"> Adds a peer replica to an Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/create/"> create </a> </td> <td style="text-align:left"> Creates an Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/delete/"> delete </a> </td> <td style="text-align:left"> Deletes an Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/flush/"> flush </a> </td> <td style="text-align:left"> Clears all keys from an Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/get/"> get </a> </td> <td style="text-align:left"> Shows the current configuration of an Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/health-report/"> health-report </a> </td> <td style="text-align:left"> Shows the health report of an Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/list/"> list </a> </td> <td style="text-align:left"> Shows a list of all Active-Active databases. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/purge-instance/"> purge-instance </a> </td> <td style="text-align:left"> Deletes data from a local instance and removes it from the Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/remove-instance/"> remove-instance </a> </td> <td style="text-align:left"> Removes a peer replica from an Active-Active database. </td> </tr> <tr> <td style="text-align:left"> <a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/update/"> update </a> </td> <td style="text-align:left"> Updates the configuration of an Active-Active database. </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/cli-utilities/crdb-cli/crdb/"/> <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-list/.html
<section class="prose w-full py-12"> <h1 class="command-name"> COMMAND LIST </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">COMMAND LIST [FILTERBY &lt;MODULE module-name | ACLCAT category | PATTERN pattern&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"> 7.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 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 of the server's command names. </p> <p> You can use the optional <em> FILTERBY </em> modifier to apply one of the following filters: </p> <ul> <li> <strong> MODULE module-name </strong> : get the commands that belong to the module specified by <em> module-name </em> . </li> <li> <strong> ACLCAT category </strong> : get the commands in the <a href="/docs/latest/operate/oss_and_stack/management/security/acl#command-categories"> ACL category </a> specified by <em> category </em> . </li> <li> <strong> PATTERN pattern </strong> : get the commands that match the given glob-like <em> pattern </em> . </li> </ul> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a list of command names. <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-list/"/> <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/cluster-myshardid/.html
<section class="prose w-full py-12"> <h1 class="command-name"> CLUSTER MYSHARDID </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CLUSTER MYSHARDID</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.2.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> Returns the node's shard id. </p> <p> The <code> CLUSTER MYSHARDID </code> command returns the unique, auto-generated identifier that is associated with the shard to which the connected cluster node belongs. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> : the node's shard ID. <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/cluster-myshardid/"/> <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/import-data/.html
<section class="prose w-full py-12 max-w-none"> <h1> Import data into a database </h1> <p class="text-lg -mt-5 mb-10"> 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> <p> You can import, <a href="/docs/latest/operate/rs/databases/import-export/export-data/"> export </a> , or <a href="/docs/latest/operate/rs/databases/import-export/schedule-backups/"> backup </a> 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> <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> Importing data erases all existing content in the database. </div> </div> <h2 id="import-data-into-a-database"> Import data into a database </h2> <p> To import data into a database using the Cluster Manager UI: </p> <ol> <li> <p> On the <strong> Databases </strong> screen, select the database from the list, then select <strong> Configuration </strong> . </p> </li> <li> <p> Click <a href="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" sdata-lightbox="/images/rs/buttons/button-toggle-actions-vertical.png#no-click"> <img alt="Toggle actions button" class="inline" src="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" width="22px"/> </a> to open a list of additional actions. </p> </li> <li> <p> Select <strong> Import </strong> . </p> </li> <li> <p> Select the tab that corresponds to your storage location type and enter the location details. </p> <p> See <a href="#supported-storage-locations"> Supported storage locations </a> for more information about each storage location type. </p> </li> <li> <p> Select <strong> Import </strong> . </p> </li> </ol> <h2 id="supported-storage-services"> Supported storage locations </h2> <p> Data can be imported from a local mount point, transferred to <a href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier"> a URI </a> using FTP/SFTP, or stored on cloud provider storage. </p> <p> When importing from a local mount point or a cloud provider, import locations need to be available to <a href="/docs/latest/operate/rs/installing-upgrading/install/customize-user-and-group/"> the group and user </a> running Redis Enterprise Software, <code> redislabs:redislabs </code> by default. </p> <p> Redis Enterprise Software needs the ability to view objects in the storage location. Implementation details vary according to the provider and your configuration. To learn more, consult the provider's documentation. </p> <p> The following sections provide general guidelines. Because provider features change frequently, use your provider's documentation for the latest info. </p> <h3 id="ftp-server"> FTP server </h3> <p> Before importing data from an FTP server, make sure that: </p> <ul> <li> Your Redis Enterprise cluster can connect and authenticate to the FTP server. </li> <li> The user that you specify in the FTP server location has permission to read files from the server. </li> </ul> <p> To import data from an FTP server, set <strong> RDB file path/s </strong> using the following syntax: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="o">[</span>protocol<span class="o">]</span>://<span class="o">[</span>username<span class="o">]</span>:<span class="o">[</span>password<span class="o">]</span>@<span class="o">[</span>host<span class="o">]</span>:<span class="o">[</span>port<span class="o">]</span>/<span class="o">[</span>path<span class="o">]</span>/<span class="o">[</span>filename<span class="o">]</span>.rdb </span></span></code></pre> </div> <p> Where: </p> <ul> <li> <em> protocol </em> : the server's protocol, can be either <code> ftp </code> or <code> ftps </code> . </li> <li> <em> username </em> : your username, if needed. </li> <li> <em> password </em> : your password, if needed. </li> <li> <em> hostname </em> : the hostname or IP address of the server. </li> <li> <em> port </em> : the port number of the server, if needed. </li> <li> <em> path </em> : the file's location path. </li> <li> <em> filename </em> : the name of the file. </li> </ul> <p> Example: <code> ftp://username:[email protected]/home/backups/&lt;filename&gt;.rdb </code> </p> <p> Select <strong> Add path </strong> to add another import file path. </p> <h3 id="local-mount-point"> Local mount point </h3> <p> Before importing data from a local mount point, make sure that: </p> <ul> <li> <p> The node can connect to the server hosting the mount point. </p> </li> <li> <p> The <code> redislabs:redislabs </code> user has permission to read files on the local mount point and on the destination server. </p> </li> <li> <p> You must mount the storage in the same path on all cluster nodes. You can also use local storage, but you must copy the imported files manually to all nodes because the import source folders on the nodes are not synchronized. </p> </li> </ul> <p> To import from a local mount point: </p> <ol> <li> <p> On each node in the cluster, create the mount point: </p> <ol> <li> <p> Connect to the node's terminal. </p> </li> <li> <p> Mount the remote storage to a local mount point. </p> <p> For example: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo mount -t nfs 192.168.10.204:/DataVolume/Public /mnt/Public </span></span></code></pre> </div> </li> </ol> </li> <li> <p> In the path for the import location, enter the mount point. </p> <p> For example: <code> /mnt/Public/&lt;filename&gt;.rdb </code> </p> </li> </ol> <p> As of version 6.2.12, Redis Enterprise reads files directly from the mount point using a <a href="https://en.wikipedia.org/wiki/Symbolic_link"> symbolic link </a> (symlink) instead of copying them to a temporary directory on the node. </p> <p> Select <strong> Add path </strong> to add another import file path. </p> <h3 id="sftp-server"> SFTP server </h3> <p> Before importing data from an SFTP server, make sure that: </p> <ul> <li> <p> Your Redis Enterprise cluster can connect and authenticate to the SFTP server. </p> </li> <li> <p> The user that you specify in the SFTP server location has permission to read files from the server. </p> </li> <li> <p> The SSH private keys are specified correctly. You can use the key generated by the cluster or specify a custom key. </p> <p> To use the cluster auto generated key: </p> <ol> <li> <p> Go to <strong> Cluster &gt; Security &gt; Certificates </strong> . </p> </li> <li> <p> Expand <strong> Cluster SSH Public Key </strong> . </p> </li> <li> <p> Download or copy the cluster SSH public key to the appropriate location on the SFTP server. </p> <p> Use the server documentation to determine the appropriate location for the SSH public key. </p> </li> </ol> </li> </ul> <p> To import data from an SFTP server, enter the SFTP server location in the format: </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="o">[</span>protocol<span class="o">]</span>://<span class="o">[</span>username<span class="o">]</span>:<span class="o">[</span>password<span class="o">]</span>@<span class="o">[</span>host<span class="o">]</span>:<span class="o">[</span>port<span class="o">]</span>/<span class="o">[</span>path<span class="o">]</span>/<span class="o">[</span>filename<span class="o">]</span>.rdb </span></span></code></pre> </div> <p> Where: </p> <ul> <li> <em> protocol </em> : the server's protocol, can be either <code> ftp </code> or <code> ftps </code> . </li> <li> <em> username </em> : your username, if needed. </li> <li> <em> password </em> : your password, if needed. </li> <li> <em> hostname </em> : the hostname or IP address of the server. </li> <li> <em> port </em> : the port number of the server, if needed. </li> <li> <em> path </em> : the file's location path. </li> <li> <em> filename </em> : the name of the file. </li> </ul> <p> Example: <code> sftp://username:[email protected]/home/backups/[filename].rdb </code> </p> <p> Select <strong> Add path </strong> to add another import file path. </p> <h3 id="aws-s3"> AWS Simple Storage Service </h3> <p> Before you choose to import data from an <a href="https://aws.amazon.com/"> Amazon Web Services </a> (AWS) Simple Storage Service (S3) bucket, make sure you have: </p> <ul> <li> The path to the file in your bucket in the format: <code> s3://[bucketname]/[path]/[filename].rdb </code> </li> <li> <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey"> Access key ID and Secret access key </a> for an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console"> IAM user </a> with permission to read files from the bucket. </li> </ul> <p> In the Redis Enterprise Software Cluster Manager UI, when you enter the export location details: </p> <ul> <li> <p> Select <strong> AWS S3 </strong> . </p> </li> <li> <p> In the <strong> RDB file path/s </strong> field, enter the path of your bucket. Select <strong> Add path </strong> to add another import file path. </p> </li> <li> <p> In the <strong> Access key ID </strong> field, enter the access key ID. </p> </li> <li> <p> In the <strong> Secret access key </strong> field, enter the secret access key. </p> </li> </ul> <p> You can also connect to a storage service that uses the S3 protocol but is not hosted by Amazon AWS. The storage service must have a valid SSL certificate. To connect to an S3-compatible storage location, run <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/config/"> <code> rladmin cluster config </code> </a> : </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config s3_url &lt;URL&gt; </span></span></code></pre> </div> <p> Replace <code> &lt;URL&gt; </code> with the hostname or IP address of the S3-compatible storage location. </p> <h3 id="google-cloud-storage"> Google Cloud Storage </h3> <p> Before you import data from a <a href="https://developers.google.com/console/"> Google Cloud </a> storage bucket, make sure you have: </p> <ul> <li> Storage location path in the format: <code> /bucket_name/[path]/[filename].rdb </code> </li> <li> A <a href="https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating"> JSON service account key </a> for your account </li> <li> A <a href="https://cloud.google.com/storage/docs/access-control/using-iam-permissions#bucket-add"> principal </a> for your bucket with the <code> client_email </code> from the service account key and a <a href="https://cloud.google.com/storage/docs/access-control/iam-roles"> role </a> with permissions to get files from the bucket (such as the <strong> Storage Legacy Object Reader </strong> role, which grants <code> storage.objects.get </code> permissions) </li> </ul> <p> In the Redis Enterprise Software Cluster Manager UI, when you enter the import location details: </p> <ul> <li> <p> Select <strong> Google Cloud Storage </strong> . </p> </li> <li> <p> In the <strong> RDB file path/s </strong> field, enter the path of your file. Select <strong> Add path </strong> to add another import file path. </p> </li> <li> <p> In the <strong> Client ID </strong> field, enter the <code> client_id </code> from the service account key. </p> </li> <li> <p> In the <strong> Client email </strong> field, enter the <code> client_email </code> from the service account key. </p> </li> <li> <p> In the <strong> Private key id </strong> field, enter the <code> private_key_id </code> from the service account key. </p> </li> <li> <p> In the <strong> Private key </strong> field, enter the <code> private_key </code> from the service account key. Replace <code> \n </code> with new lines. </p> </li> </ul> <h3 id="azure-blob-storage"> Azure Blob Storage </h3> <p> Before you choose to import from Azure Blob Storage, make sure that you have: </p> <ul> <li> <p> Storage location path in the format: <code> /container_name/[path/]/&lt;filename&gt;.rdb </code> </p> </li> <li> <p> Account name </p> </li> <li> <p> An authentication token, either an account key or an Azure <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/delegate-access-with-shared-access-signature"> shared access signature </a> (SAS). </p> <p> To find the account name and account key, see <a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage"> Manage storage account access keys </a> . </p> <p> Azure SAS support requires Redis Software version 6.0.20. To learn more about Azure SAS, see <a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview"> Grant limited access to Azure Storage resources using shared access signatures </a> . </p> </li> </ul> <p> In the Redis Enterprise Software Cluster Manager UI, when you enter the import location details: </p> <ul> <li> <p> Select <strong> Azure Blob Storage </strong> . </p> </li> <li> <p> In the <strong> RDB file path/s </strong> field, enter the path of your file. Select <strong> Add path </strong> to add another import file path. </p> </li> <li> <p> In the <strong> Azure Account Name </strong> field, enter your storage account name. </p> </li> <li> <p> In the <strong> Azure Account Key </strong> field, enter the storage account key. </p> </li> </ul> <h2 id="importing-into-an-active-active-database"> Importing into an Active-Active database </h2> <p> When importing data into an Active-Active database, there are two options: </p> <ul> <li> <a href="/docs/latest/operate/rs/databases/import-export/flush/#flush-data-from-an-active-active-database"> Flush all data </a> from the Active-Active database, then import the data into the database. </li> <li> Import data but merge it into the existing database. </li> </ul> <p> Because Active-Active databases have a numeric counter data type, when you merge the imported data into the existing data RS increments counters by the value that is in the imported data. The import through the Redis Enterprise Cluster Manager UI handles these data types for you. </p> <p> You can import data into an Active-Active database <a href="#import-data-into-a-database"> from the Cluster Manager UI </a> . When you import data into an Active-Active database, there is a special prompt warning that the imported data will be merged into the existing database. </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/import-export/import-data/"/> <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/redisearch/redisearch-1.6-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RediSearch 1.6 release notes </h1> <p class="text-lg -mt-5 mb-10"> Improved performance of full-text search and aggregation queries. Support for aliasing of indices. Added a C API to embed RediSearch in other modules. Forked process garbage collection. </p> <h2 id="requirements"> Requirements </h2> <p> RediSearch v1.6.16 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 4.0.0 </li> <li> Minimum Redis Enterprise Software version (cluster): 5.0.0 </li> </ul> <h2 id="v1616-june-2021"> v1.6.16 (June 2021) </h2> <p> This is a maintenance release for version 1.6. </p> <p> Update urgency: MODERATE - Program an upgrade of the server, but it's not urgent. </p> <p> Details: </p> <ul> <li> <p> Bug fix: </p> <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/2018"> 2018 </a> : FT.ADD REPLACE leaves fields from the previous document that are not included in the new document # <a href="https://github.com/RediSearch/RediSearch/pull/647"> 647 </a> # <a href="https://github.com/RediSearch/RediSearch/pull/1193"> 1193 </a> </li> </ul> </li> </ul> <h2 id="v1615-february-2021"> v1.6.15 (February 2021) </h2> <p> This is a maintenance release for version 1.6. </p> <p> Update urgency: Low </p> <p> Details: </p> <ul> <li> <p> Minor enhancements: </p> <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1225"> 1225 </a> Allow scientific representation of numbers for numeric fields. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1574"> 1574 </a> Allow SORTBY for non-sortable fields. </li> </ul> </li> <li> <p> Minor bugfixes: </p> <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1683"> 1683 </a> Add a module parameter _NUMERIC_COMPRESS which prevent <nobr> double -&gt; float </nobr> compression. It prevents an issue where an exact match on some floating-point numbers is not found. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1757"> 1757 </a> Remove assertion on the limitation of the number of sortable fields, instead return an error. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1668"> 1668 </a> Query words from stopword list on tag fields. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1745"> 1745 </a> Enforce 0 value for count reducer. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1774"> 1774 </a> MINPREFIX &amp; MAXEXPANSION can be changed in runtime. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1761"> 1861 </a> Fix issue for FT.SCOREEXPLAIN where reply array depth can exceed 7. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1689"> 1689 </a> FT.SUGGET results from RSCoordinator are more consistent. </li> <li> Various small tweaks under the hood. </li> </ul> </li> </ul> <h2 id="v1614-september-2020"> v1.6.14 (September 2020) </h2> <ul> <li> This is a maintenance release for version 1.6. </li> </ul> <p> Details: </p> <ul> <li> <p> Minor features: </p> <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1420"> 1420 </a> The hard limit of the number of results produced by FT.SEARCH is now configurable with MAXSEARCHRESULTS. </li> </ul> </li> <li> <p> Bug fixes: </p> <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1313"> 1313 </a> Wrong error of unsupported phonetic field. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1286"> 1286 </a> Possible crash on optional search. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1449"> 1449 </a> Rare file descriptor leak on FORK GC. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1469"> 1469 </a> Endless loop when reaching internal docid above uint32_max. </li> </ul> </li> </ul> <h2 id="v1613-may-2020"> v1.6.13 (May 2020) </h2> <p> This is a maintenance release for version 1.6. </p> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> </ul> <p> Details: </p> <ul> <li> Bugfixes: <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/pull/1186"> 1186 </a> # <a href="https://github.com/RediSearch/RediSearch/pull/1188"> 1188 </a> incorrect values for <code> inverted_sz_mb </code> and <code> num_records </code> in <code> FT.INFO </code> command. </li> </ul> </li> </ul> <h2 id="v1612-april-2020"> v1.6.12 (April 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> </ul> <p> Details: </p> <ul> <li> Features: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1172"> 1172 </a> Added <code> exists </code> function that can be used on conditional updates ( <code> REPLACE PARTIAL </code> ) to check if a field exists in the document. </li> </ul> </li> <li> Minor Enhancements: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1172"> 1172 </a> Lazy evaluation of the right side of 'or'/'and' clauses in IF condition. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1134"> 1134 </a> Remove hard limit on LIMIT when using FT.SEARCH. </li> </ul> </li> <li> Bugfixes: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1124"> 1124 </a> NOINDEX tag fields could not be updated on UPDATE PARTIAL with no indexed fields. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1120"> 1120 </a> Release loop in II_GetCriteriaTester which released the same criteria tester multiple times. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1161"> 1161 </a> Case where setting <code> MAXDOCTABLESIZE </code> had no effect. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1169"> 1169 </a> <code> FIRST_VALUE </code> reducer crashed when value did not exist. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1159"> 1159 </a> Infinite loop on <code> NOT </code> criteria tester.% </li> </ul> </li> </ul> <h2 id="v1611-march-2020"> v1.6.11 (March 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> </ul> <p> Details: </p> <ul> <li> Bugfixes: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1126"> 1126 </a> Memory leak introduced by queries for tag fields that have no results. </li> </ul> </li> </ul> <h2 id="v1610-march-2020"> v1.6.10 (March 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> <li> This release fixes certain backwards compatibility issues compared to 1.4. Although they are rare cases, it is recommended when upgrading to 1.6 to use this version or newer. </li> </ul> <p> Details: </p> <ul> <li> Minor Enhancements: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1062"> 1062 </a> Added Custom stopwords list in <code> FT.INFO </code> </li> </ul> </li> <li> Fixed backwards incompatible issues: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1075"> 1075 </a> Fields should always be returned to the user as a string. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1074"> 1074 </a> Don't truncate possible integral values when printing. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1065"> 1065 </a> Revert "Change how generated reducer aliases are made". </li> </ul> </li> <li> Bugfixes: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1085"> 1085 </a> Min and max value on non leaf nodes in the numeric tree should not be updated. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1106"> 1106 </a> Pipe leak on <code> FORK GC </code> caused by closing the fork without holding the lock. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1114"> 1114 </a> PR # <a href="https://github.com/redisearch/redisearch/issues/986"> 986 </a> reverted the work from # <a href="https://github.com/redisearch/redisearch/issues/985"> 985 </a> , # <a href="https://github.com/redisearch/redisearch/issues/989"> 989 </a> . This PR reintroduces these features. </li> </ul> </li> </ul> <h2 id="v169-february-2020"> v1.6.9 (February 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> </ul> <p> Details: </p> <ul> <li> Bugfixes: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1052"> 1052 </a> Remove wrong optimization on Quantile. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1057"> 1057 </a> Memory pool did not release memory when certain limit was reached. </li> </ul> </li> </ul> <h2 id="v168-february-2020"> v1.6.8 (February 2020) </h2> <p> Headlines: </p> <ul> <li> This release improves overall stability and provides fixes for issues found after the previous release. </li> </ul> <p> Details: </p> <ul> <li> Bugfixes: <ul> <li> # <a href="https://github.com/redisearch/redisearch/issues/1052"> 1052 </a> Remove wrong optimization on Quantile. </li> <li> # <a href="https://github.com/redisearch/redisearch/issues/1057"> 1057 </a> Memory pool did not release memory when certain limit was reached. </li> </ul> </li> </ul> <h2 id="v16-ga-january-2020"> v1.6 GA (January 2020) </h2> <p> This is the General Availability Release of RediSearch 1.6 (v1.6.7). </p> <p> Headlines: </p> <ul> <li> Several performance improvements increasing full-text search queries up to 60% and aggregation queries up to 73%. </li> <li> Support for aliasing of indices. </li> <li> Low-level API in C (and <a href="https://github.com/RediSearch/redisearch-api-rs"> Rust bindings </a> ) to make RediSearch embeddable in other Redis modules. <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/"> RedisGraph </a> is the first GA consumer. </li> <li> Forked process Garbage Collection (FORK GC) allows for stable read latencies. </li> </ul> <p> Full details: </p> <ul> <li> <p> Added functionality </p> <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/658"> 658 </a> <code> FT.ADD … REPLACE … NOCREATE </code> will not add the document if the document does not exist. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/575"> 575 </a> Add index aliasing. This allows users to provide (or remove) ‘links’ to indexes. The commands are <code> FT.ALIASADD </code> , <code> FT.ALIASDEL </code> , and <code> FT.ALIASUPDATE </code> . </li> <li> New C API to make RediSearch embeddable in other Redis modules. This API allows other Redis modules to use functionality of RedisSearch without actually having the “module” functionality active. Note that this must still be used on Redis proper. Modules that are already incorporating this API </li> <li> <a href="https://github.com/RedisGraph/RedisGraph/releases/tag/v2.0.1"> RedisGraph </a> GA </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/186"> RedisTimeSeries </a> (WIP) </li> <li> <a href="https://github.com/RedisJSON/RedisJSON2"> RedisJSON </a> (WIP) </li> </ul> </li> <li> <p> Performance improvements </p> <ul> <li> Improve performance when using many union (|) iterators </li> <li> Improve performance when using many intersect iterators </li> <li> Improve overall index reading performance </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/598"> 598 </a> Do not return <code> foo: NULL </code> if <code> foo </code> is not present in the document. This conserves network bandwidth </li> </ul> </li> <li> <p> Bugfixes - Semantics </p> <ul> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/688"> 688 </a> # <a href="https://github.com/RediSearch/RediSearch/issues/623"> 623 </a> Fix various issues with optional (~) search operator: <ul> <li> Fixes omitted results when using union operators in addition to optional iterators. </li> <li> Allow optional iterator to be used in isolation in promotion-only mode (without a filter query) </li> <li> Fix issue where weight attribute was being ignored </li> </ul> </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/653"> 653 </a> FT.GET will no longer return a document as existing if it was not added by FT.ADD, even if the document exists in the server as a plain redis hash </li> <li> FT.AGGREGATE is now more stringent with its semantics, avoiding nonsensical queries or referencing fields which do not exist in the schema or LOADed. </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/779"> 779 </a> Added <code> to_number() </code> and <code> to_str() </code> functions for ambiguity reasons </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/906"> 906 </a> A description of how scores were calculated can be added by adding 'EXPLAINSCORE' </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/897"> 897 </a> <code> FORK GC </code> has now lowest priority over indexing and read queries </li> <li> Added automated tests to ensure macOs build works </li> </ul> </li> <li> <p> Bugfixes - Crash/Stability </p> <ul> <li> Improved overall architectural stability </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/666"> 666 </a> Fix crash when conflict between internal key name and user key name is encountered; e.g. creating a new document with <code> ft:two/two </code> </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/697"> 697 </a> # <a href="https://github.com/RediSearch/RediSearch/issues/588"> 588 </a> Fix memory leaks </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/691"> 691 </a> Fix crash on <code> FT.EXPLAIN </code> </li> <li> Proper module-level and index-level cleanup functionality </li> <li> Simplified concurrency model </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/898"> 898 </a> Fix rare issue where <code> FORK GC </code> doesn't exists on termination of Redis </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/865"> 865 </a> When using <code> FT.SEARCH </code> with <code> SORTBY </code> , it will only be possible to sort by one field </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/917"> 917 </a> Fix wrong results introduced in a skip optimisation </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/888"> 888 </a> <code> NULL </code> terms cause <code> FORK </code> GC to crash </li> <li> # <a href="https://github.com/RediSearch/RediSearch/issues/887"> 887 </a> Chinese searches not being converted to simplified Chinese. </li> <li> Fix <code> FORK GC </code> issue where read from pipe did not returned all the data </li> </ul> </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/release-notes/redisearch/redisearch-1.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/kubernetes/reference/supported_k8s_distributions/.html
<section class="prose w-full py-12 max-w-none"> <h1> Supported Kubernetes distributions </h1> <p class="text-lg -mt-5 mb-10"> Support matrix for the current Redis Enterprise K8s operator </p> <p> Each release of Redis Enterprise for Kubernetes is thoroughly tested against a set of Kubernetes distributions. The table below lists Redis Enterprise for Kubernetes versions and the Kubernetes distributions they support. </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> <h2 id="community-kubernetes"> Community Kubernetes </h2> <p> For details on this platform, see the Kubernetes <a href="https://kubernetes.io/docs/home/supported-doc-versions/"> documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-3 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.12-1 </nobr> </strong> </th> <th> <strong> <nobr> </nobr> </strong> <nobr> </nobr> <nobr> 6.2.10-4 </nobr> <strong> 5 </strong> </th> <th> <strong> <nobr> 6.2.10-34 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.10-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-15 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-11 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.4-1 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> <td> Nov 2022 </td> <td> Sept 2022 </td> <td> July 2022 </td> <td> May 2022 </td> <td> March 2022 </td> <td> Jan 2022 </td> <td> Jan 2022 </td> <td> Nov 2021 </td> <td> Sept 2021 </td> </tr> <tr> <td> <strong> Community K8s </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.30 </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.29 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.28 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.27 </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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.26 </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </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> <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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.22 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <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> <td> </td> </tr> <tr> <td> 1.21 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.20 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.19 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.18 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <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> </tr> <tr> <td> 1.17 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> </tr> <tr> <td> 1.16 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> </tr> </tbody> </table> </div> <h2 id="openshift-container-platform"> OpenShift Container Platform </h2> <p> For details on this platform, see the <a href="https://docs.openshift.com/container-platform/4.13/welcome/index.html"> OpenShift documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-3 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.12-1 </nobr> </strong> </th> <th> <strong> <nobr> </nobr> </strong> <nobr> </nobr> <nobr> 6.2.10-4 </nobr> <strong> 5 </strong> </th> <th> <strong> <nobr> 6.2.10-34 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.10-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-15 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-11 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.4-1 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> <td> Nov 2022 </td> <td> Sept 2022 </td> <td> July 2022 </td> <td> May 2022 </td> <td> March 2022 </td> <td> Jan 2022 </td> <td> Jan 2022 </td> <td> Nov 2021 </td> <td> Sept 2021 </td> </tr> <tr> <td> <strong> OpenShift </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.16 </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.15 </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.14 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.13 </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> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.12 </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.11 </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> <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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.10 </td> <td> </td> <td> </td> <td> </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 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> <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> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 4.9 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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 class="font-serif" title="Deprecation warning"> ⚠️ </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> <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> 4.8 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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 class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 4.7 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 4.6 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 4.5 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <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> </tr> <tr> <td> 3.11 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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 class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> </tr> </tbody> </table> </div> <h2 id="amazon-elastic-kubernetes-service-eks"> Amazon Elastic Kubernetes Service (EKS) </h2> <p> For details on this platform, see the <a href="https://docs.aws.amazon.com/eks/?icmpid=docs_homepage_containers"> EKS documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-3 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.12-1 </nobr> </strong> </th> <th> <strong> <nobr> </nobr> </strong> <nobr> </nobr> <nobr> 6.2.10-4 </nobr> <strong> 5 </strong> </th> <th> <strong> <nobr> 6.2.10-34 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.10-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-15 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-11 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.4-1 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> <td> Nov 2022 </td> <td> Sept 2022 </td> <td> July 2022 </td> <td> May 2022 </td> <td> March 2022 </td> <td> Jan 2022 </td> <td> Jan 2022 </td> <td> Nov 2021 </td> <td> Sept 2021 </td> </tr> <tr> <td> <strong> Amazon EKS </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.30 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.29 </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.28 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.27 </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> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.26 </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> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </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 class="font-serif" title="Deprecation warning"> ⚠️ </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.22 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.21 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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 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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.20 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.19 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.18 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> </tbody> </table> </div> <h2 id="azure-kubernetes-service-aks"> Azure Kubernetes Service (AKS) </h2> <p> For details on this platform, see the <a href="https://learn.microsoft.com/en-us/azure/aks/"> AKS documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-3 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.12-1 </nobr> </strong> </th> <th> <strong> <nobr> </nobr> </strong> <nobr> </nobr> <nobr> 6.2.10-4 </nobr> <strong> 5 </strong> </th> <th> <strong> <nobr> 6.2.10-34 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.10-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-15 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-11 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.4-1 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> <td> Nov 2022 </td> <td> Sept 2022 </td> <td> July 2022 </td> <td> May 2022 </td> <td> March 2022 </td> <td> Jan 2022 </td> <td> Jan 2022 </td> <td> Nov 2021 </td> <td> Sept 2021 </td> </tr> <tr> <td> <strong> Azure AKS </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.30 </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.29 </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.28 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.27 </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> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.26 </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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 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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.22 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.21 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> </tr> <tr> <td> 1.20 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> </td> </tr> <tr> <td> 1.19 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <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> </tr> <tr> <td> 1.18 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> </tbody> </table> </div> <h2 id="google-kubernetes-engine-gke"> Google Kubernetes Engine (GKE) </h2> <p> For details on this platform, see the <a href="https://cloud.google.com/kubernetes-engine/docs"> GKE documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-3 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.12-1 </nobr> </strong> </th> <th> <strong> <nobr> </nobr> </strong> <nobr> </nobr> <nobr> 6.2.10-4 </nobr> <strong> 5 </strong> </th> <th> <strong> <nobr> 6.2.10-34 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.10-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-15 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-11 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.4-1 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> <td> Nov 2022 </td> <td> Sept 2022 </td> <td> July 2022 </td> <td> May 2022 </td> <td> March 2022 </td> <td> Jan 2022 </td> <td> Jan 2022 </td> <td> Nov 2021 </td> <td> Sept 2021 </td> </tr> <tr> <td> <strong> Google GKE </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.30 </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.29 </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.28 </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.27 </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> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.26 </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </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> <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> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </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> <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> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </td> <td> </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 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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.22 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <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> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.21 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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 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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.20 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.19 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> </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> 1.18 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> </tbody> </table> </div> <h2 id="rancher"> Rancher </h2> <p> For details on this platform, see the <a href="https://ranchermanager.docs.rancher.com/"> Rancher documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-3 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.12-1 </nobr> </strong> </th> <th> <strong> <nobr> </nobr> </strong> <nobr> </nobr> <nobr> 6.2.10-4 </nobr> <strong> 5 </strong> </th> <th> <strong> <nobr> 6.2.10-34 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.10-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-15 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-11 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.4-1 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> <td> Nov 2022 </td> <td> Sept 2022 </td> <td> July 2022 </td> <td> May 2022 </td> <td> March 2022 </td> <td> Jan 2022 </td> <td> Jan 2022 </td> <td> Nov 2021 </td> <td> Sept 2021 </td> </tr> <tr> <td> <strong> Rancher 2.8 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.28 </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.27 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.26 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> Rancher 2.7 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </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> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </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 class="font-serif" title="Deprecation warning"> ⚠️ </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> Rancher 2.6 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.22 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.21 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.20 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.19 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.18 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> Rancher 2.5 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.20 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.19 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.18 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.17 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> <strong> Rancher 2.4 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.18 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.17 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> </tbody> </table> </div> <h2 id="vmware-tanzu-kubernetes-grid-tkg"> VMware Tanzu Kubernetes Grid (TKG) </h2> <p> For details on this platform, see the <a href="https://docs.vmware.com/en/VMware-Tanzu-Kubernetes-Grid/index.html"> TKG documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> </tr> <tr> <td> <strong> VMWare TKG 2.4 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.27 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.26 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </td> <td> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.3 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.26 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </td> <td> <span title="X icon"> ❌ </span> </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> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> <span title="X icon"> ❌ </span> </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> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.2 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.25 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </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> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 2.1 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </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> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </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 class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.22 </td> <td> </td> <td> </td> <td> </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> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> <strong> VMware TKG 1.6 </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.24 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.23 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> 1.22 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> </tbody> </table> </div> <h2 id="vmware-tanzu-kubernetes-grid-integrated-edition-tkgi"> VMware Tanzu Kubernetes Grid Integrated Edition (TKGI) </h2> <p> For details on this platform, see the <a href="https://docs.vmware.com/en/VMware-Tanzu-Kubernetes-Grid-Integrated-Edition/index.html"> TKGI documentation </a> . </p> <div style="overflow-x: auto;"> <table> <thead> <tr> <th> Redis operator </th> <th> <strong> <nobr> 7.4.6-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.4.2-2 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-12 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-7 </nobr> </strong> </th> <th> <strong> <nobr> 7.2.4-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-8 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-6 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-5 </nobr> </strong> </th> <th> <strong> <nobr> 6.4.2-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-41 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.18-3 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.12-1 </nobr> </strong> </th> <th> <strong> <nobr> </nobr> </strong> <nobr> </nobr> <nobr> 6.2.10-4 </nobr> <strong> 5 </strong> </th> <th> <strong> <nobr> 6.2.10-34 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.10-4 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-15 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-11 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.8-2 </nobr> </strong> </th> <th> <strong> <nobr> 6.2.4-1 </nobr> </strong> </th> </tr> </thead> <tbody> <tr> <td> </td> <td> July 2024 </td> <td> May 2024 </td> <td> March 2024 </td> <td> Dec 2023 </td> <td> Oct 2023 </td> <td> Aug 2023 </td> <td> July 2023 </td> <td> June 2023 </td> <td> April 2023 </td> <td> March 2023 </td> <td> Jan 2023 </td> <td> Nov 2022 </td> <td> Sept 2022 </td> <td> July 2022 </td> <td> May 2022 </td> <td> March 2022 </td> <td> Jan 2022 </td> <td> Jan 2022 </td> <td> Nov 2021 </td> <td> Sept 2021 </td> </tr> <tr> <td> <strong> VMware TKGI </strong> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.19 </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.18 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.17 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.16 </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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.15 </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </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> <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> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.14 </td> <td> </td> <td> </td> <td> </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 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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.13 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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 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> <td> <span title="Supported"> ✅ </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.12 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.11 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.10 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </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> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> <td> <span title="Supported"> ✅ </span> </td> </tr> <tr> <td> 1.09 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> 1.08 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> </tr> <tr> <td> 1.07 </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> <span title="X icon"> ❌ </span> </td> <td> <span class="font-serif" title="Deprecation warning"> ⚠️ </span> </td> </tr> </tbody> </table> </div> <h2 id="supported-upgrade-paths"> Supported upgrade paths </h2> <p> If you are using a version earlier than 6.2.10-45, <a href="/docs/latest/operate/kubernetes/upgrade/"> you must upgrade </a> to 6.2.10-45 before you can upgrade to versions 6.2.18 or later. </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/kubernetes/reference/supported_k8s_distributions/"/> <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/import_reset_status/.html
<section class="prose w-full py-12 max-w-none"> <h1> Import reset status database action requests </h1> <p class="text-lg -mt-5 mb-10"> Reset database import status requests </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#put-bdbs-actions-import-reset-status"> PUT </a> </td> <td> <code> /v1/bdbs/{uid}/actions/import_reset_status </code> </td> <td> Reset database import status </td> </tr> </tbody> </table> <h2 id="put-bdbs-actions-import-reset-status"> Reset database import status </h2> <pre><code>PUT /v1/bdbs/{int: uid}/actions/import_reset_status </code></pre> <p> Reset the database’s <code> import_status </code> to idle if a backup is not in progress and clears the value of the <code> import_failure_reason </code> field. </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/#reset_bdb_current_import_status"> reset_bdb_current_import_status </a> </td> <td> admin <br/> cluster_member <br/> db_member </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/import_reset_status </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 database </td> </tr> </tbody> </table> <h3 id="put-response"> Response </h3> <p> Returns a status code. </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> The request is accepted and is being processed. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"> 404 Not Found </a> </td> <td> Attempting to perform an action on a nonexistent database. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"> 406 Not Acceptable </a> </td> <td> Not all the modules loaded to the database support 'backup_restore' capability </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10"> 409 Conflict </a> </td> <td> Database is currently busy with another action. In this context, this is a temporary condition and the request should be reattempted later. </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/import_reset_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/json.objkeys.html
<section class="prose w-full py-12"> <h1 class="command-name"> JSON.OBJKEYS </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">JSON.OBJKEYS 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 number of keys in the object, O(N) when path is evaluated to multiple values, where N is the size of the key </dd> </dl> <p> Return the keys in the object that's referenced by <code> path </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 parse. Returns <code> null </code> for nonexistent keys. </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> . Returns <code> null </code> for nonexistant path. </p> </details> <h2 id="return"> Return </h2> <p> JSON.OBJKEYS returns an array of array replies for each path, an array of the key names in the object as a bulk string reply, or <code> nil </code> if the matching JSON value is not an object. 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> <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":[3], "nested": {"a": {"b":2, "c": 1}}}'</span> </span></span><span class="line"><span class="cl">OK </span></span><span class="line"><span class="cl">redis&gt; JSON.OBJKEYS doc $..a </span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>nil<span class="o">)</span> </span></span><span class="line"><span class="cl">2<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"b"</span> </span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"c"</span></span></span></code></pre> </div> <h2 id="see-also"> See also </h2> <p> <a href="/docs/latest/commands/json.arrindex/"> <code> JSON.ARRINDEX </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.objkeys/"/> <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/reference/data-types-conversion/.html
<section class="prose w-full py-12 max-w-none"> <h1> Data type conversion </h1> <p class="text-lg -mt-5 mb-10"> Data type conversion reference </p> <p> This document describes default conversions of data types of supported databases into target redis data types. </p> <h2 id="general-ansi-sql-data-types"> General ANSI SQL data types </h2> <table> <thead> <tr> <th style="text-align:left"> Source data type </th> <th style="text-align:left"> Target data type for HASH </th> <th style="text-align:left"> Example for HASH </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> array </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> bigint </td> <td style="text-align:left"> string </td> <td style="text-align:left"> 2147483648 will be saved as '2147483648' </td> </tr> <tr> <td style="text-align:left"> binary </td> <td style="text-align:left"> bytes string <br/> bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting <code> binary.handling.mode </code> </td> <td style="text-align:left"> When <code> binary.handling.mode = bytes </code> the string <code> 'hello' </code> will be added to the table as the binary string <code> '0x68656C6C6F' </code> ,will be converted by Debezium to <code> 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' </code> and will be stored in Redis target database as: <code> 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' </code> </td> </tr> <tr> <td style="text-align:left"> bit string </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> blob </td> <td style="text-align:left"> bytes string <br/> bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting <code> binary.handling.mode </code> </td> <td style="text-align:left"> When <code> binary.handling.mode = bytes </code> the binary image file ,which was loaded into the table ,will be converted by Debezium to bytes and will be stored in Redis target database as bytes string </td> </tr> <tr> <td style="text-align:left"> boolean </td> <td style="text-align:left"> string </td> <td style="text-align:left"> The boolean value: false will be converted by the Applier to 0 and will be saved in Redis target database as the string '0' </td> </tr> <tr> <td style="text-align:left"> char </td> <td style="text-align:left"> string </td> <td style="text-align:left"> When PostgreSQL data type is char(14) 'hello world' will be saved as 'hello world   ' </td> </tr> <tr> <td style="text-align:left"> date </td> <td style="text-align:left"> string <br/> Mapped to ms.microsec since epoch </td> <td style="text-align:left"> PG field value: <code> '2021-01-29' </code> will be converted by Debezium to the int <code> 18656 </code> (number of dates since epoch), which will be converted to number of ms since epoch and will be stored in Redis target database as: <code> '1611878400000' </code> </td> </tr> <tr> <td style="text-align:left"> integer </td> <td style="text-align:left"> string </td> <td style="text-align:left"> <code> 2147483640 </code> will be saved as <code> '2147483640' </code> </td> </tr> <tr> <td style="text-align:left"> interval </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> null </td> <td style="text-align:left"> </td> <td style="text-align:left"> The field with <code> null </code> value will be sent by Debezium as <code> null </code> and will not be stored in Redis target database </td> </tr> <tr> <td style="text-align:left"> numeric </td> <td style="text-align:left"> string <br/> Debezium configuration parameter <code> decimal.handling.mode </code> determines how the connector maps decimal values.When <code> decimal.handling.mode = 'precision' </code> the binary string,recieved by Debezium,will be converted to its corresponding numeric value and will be stored in Redis target database as string </td> <td style="text-align:left"> PG field value: <code> 4521398.56 </code> will be converted by Debezium to binary string <code> 'GvMbUA==' </code> , which will be converted to numeric value and will be stored in Redis target database as: <code> '4521398.56' </code> </td> </tr> <tr> <td style="text-align:left"> smallint </td> <td style="text-align:left"> string </td> <td style="text-align:left"> 32767 will be saved as '32767' </td> </tr> <tr> <td style="text-align:left"> text </td> <td style="text-align:left"> string </td> <td style="text-align:left"> 'This is a very long text for the PostgreSQL text column' </td> </tr> <tr> <td style="text-align:left"> time </td> <td style="text-align:left"> string <br/> mapped to number of seconds past midnight </td> <td style="text-align:left"> <code> '14:23:46' </code> will be converted to <code> '51826000000' </code> sec </td> </tr> <tr> <td style="text-align:left"> PostgreSQL, Oracle, Cassandra: timestamp <br/> MySQL, SQL Server: datetime </td> <td style="text-align:left"> string <br/> mapped to ms.microsec since epoch. <br/> SQL Server datetime format: <code> YYYY-MM-DD hh:mm:ss[.nnn] </code> , <br/> range: <code> 1753-01-01 </code> through <code> 9999-12-31 </code> </td> <td style="text-align:left"> PG field value: <code> '2018-06-20 15:13:16.945104' </code> will be converted by Debezium to <code> '1529507596945104' </code> (micro seconds) and will be stored in Redis target database as <code> '1529507596945.104' </code> </td> </tr> <tr> <td style="text-align:left"> PosrgreSQL: timestamptz <br/> Oracle: timestamp with local timezone <br/> MySQL: timestamp </td> <td style="text-align:left"> string <br/> converted to UTC and stored as number of ms.microsec since epoch </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> timetz </td> <td style="text-align:left"> string <br/> converted to UTC and stored as number of seconds past midnight </td> <td style="text-align:left"> PG field value: <code> '14:23:46.12345' </code> will be converted by Debezium to the string <code> '12:23:46.12345Z' </code> and will be stored in Redis target database as: <code> '44638.345' </code> </td> </tr> <tr> <td style="text-align:left"> varbinary </td> <td style="text-align:left"> bytes string <br/> bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting <code> binary.handling.mode </code> </td> <td style="text-align:left"> When <code> binary.handling.mode = bytes </code> the string <code> 'hello' </code> will be added to the table as the binary string <code> '0x68656C6C6F' </code> ,will be converted by Debezium to <code> 'aGVsbG8=' </code> and will be stored in Redis target database as: <code> 'aGVsbG8=' </code> </td> </tr> <tr> <td style="text-align:left"> varchar </td> <td style="text-align:left"> string </td> <td style="text-align:left"> 'hello world' will be saved as 'hello world' </td> </tr> <tr> <td style="text-align:left"> xml </td> <td style="text-align:left"> string </td> <td> </td> </tr> </tbody> </table> <table> <thead> <tr> <th style="text-align:left"> Source data type </th> <th style="text-align:left"> Target data type for JSON </th> <th style="text-align:left"> Example for JSON </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> array </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> bigint </td> <td style="text-align:left"> number </td> <td style="text-align:left"> 2147483648 will be saved as 2147483648 </td> </tr> <tr> <td style="text-align:left"> binary </td> <td style="text-align:left"> bytes string </td> <td style="text-align:left"> When <code> binary.handling.mode = bytes </code> the string <code> 'hello' </code> will be added to the table as the binary string <code> '0x68656C6C6F' </code> ,will be converted by Debezium to <code> 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' </code> and will be stored in Redis target database as: <code> 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' </code> </td> </tr> <tr> <td style="text-align:left"> bit string </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> blob </td> <td style="text-align:left"> bytes string </td> <td style="text-align:left"> When <code> binary.handling.mode = bytes </code> the binary image file ,which was loaded into the table ,will be converted by Debezium to bytes and will be stored in Redis target database as bytes string </td> </tr> <tr> <td style="text-align:left"> boolean </td> <td style="text-align:left"> boolean </td> <td style="text-align:left"> The boolean value:true will be saved in Redis target database as boolean data type with value True </td> </tr> <tr> <td style="text-align:left"> char </td> <td style="text-align:left"> string </td> <td style="text-align:left"> When PostgreSQL data type is char(14) 'hello world' will be saved as 'hello world   ' </td> </tr> <tr> <td style="text-align:left"> date </td> <td style="text-align:left"> number <br/> Mapped to ms.microsec since epoch </td> <td style="text-align:left"> PG field value: <code> 2021-01-29 </code> will be converted by Debezium to the int 18656 (number of dates since epoch), which will be converted to number of ms since epoch and will be stored in Redis target database as: <code> 1611878400000 </code> </td> </tr> <tr> <td style="text-align:left"> integer </td> <td style="text-align:left"> number </td> <td style="text-align:left"> <code> 2147483640 </code> will be saved as <code> 2147483640 </code> </td> </tr> <tr> <td style="text-align:left"> interval </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> null </td> <td style="text-align:left"> </td> <td style="text-align:left"> The field with <code> null </code> value will be sent by Debezium as <code> null </code> and will be stored in Redis target database with the value <code> null </code> </td> </tr> <tr> <td style="text-align:left"> numeric </td> <td style="text-align:left"> Debezium configuration parameter <code> decimal.handling.mode </code> determines how the connector maps decimal values. When <code> decimal.handling.mode = 'precision' </code> the binary string received by Debezium will be converted to its corresponding numeric value and will be stored in Redis target database db as number. When <code> decimal.handling.mode = 'string' </code> the string ,received by Debezium, will be stored in Redis target database as string. When <code> decimal.handling.mode = 'double' </code> the double value received by Debezium will be stored in Redis target database as number. </td> <td style="text-align:left"> <code> decimal.handling.mode = string </code> : PG field value: <code> 4521398.56 </code> will be recieved by Debezium as the string <code> '4521398.56' </code> , and will be stored in Redis target database as the string: ' <code> 4521398.56 </code> ' . </td> </tr> <tr> <td style="text-align:left"> smallint </td> <td style="text-align:left"> number </td> <td style="text-align:left"> 32767 will be saved as 32767 </td> </tr> <tr> <td style="text-align:left"> text </td> <td style="text-align:left"> string </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> time </td> <td style="text-align:left"> number number <br/> mapped to the number of seconds past midnight </td> <td style="text-align:left"> <code> '14:23:46' </code> will be converted to <code> 51826000000 </code> sec </td> </tr> <tr> <td style="text-align:left"> PostgreSQL, Oracle, Cassandra: timestamp <br/> MySQL, SQL Server: datetime </td> <td style="text-align:left"> decimal <br/> mapped to ms.microsec since epoch. <br/> SQL Server datetime format: <code> YYYY-MM-DD hh:mm:ss[.nnn] </code> , <br/> range: <code> 1753-01-01 </code> through <code> 9999-12-31 </code> </td> <td style="text-align:left"> PG field value: <code> '2018-06-20 15:13:16.945104' </code> will be converted by Debezium to <code> '1529507596945104' </code> (micro seconds) and will be stored in Redis target database as `1529507596945.104 </td> </tr> <tr> <td style="text-align:left"> PosrgreSQL: timestamptz <br/> Oracle: timestamp with local timezone <br/> MySQL: timestamp </td> <td style="text-align:left"> number <br/> converted to UTC and stored as number of ms.microsec since epoch </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> timetz </td> <td style="text-align:left"> number <br/> converted to UTC and stored as number of ms.microsec since epoch </td> <td style="text-align:left"> PG field value: <code> '14:23:46.12345' </code> will be converted by Debezium to the string <code> '12:23:46.12345Z' </code> and will be stored in Redis target database as: <code> 44638.345 </code> </td> </tr> <tr> <td style="text-align:left"> varbinary </td> <td style="text-align:left"> bytes string <br/> bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting <code> binary.handling.mode </code> </td> <td style="text-align:left"> When <code> binary.handling.mode = bytes </code> the string <code> 'hello' </code> will be added to the table as the binary string <code> '0x68656C6C6F' </code> ,will be converted by Debezium to <code> 'aGVsbG8=' </code> and will be stored in Redis target database as: <code> 'aGVsbG8=' </code> </td> </tr> <tr> <td style="text-align:left"> varchar </td> <td style="text-align:left"> string </td> <td style="text-align:left"> 'hello world' will be saved as 'hello world’ </td> </tr> <tr> <td style="text-align:left"> xml </td> <td style="text-align:left"> string </td> <td style="text-align:left"> </td> </tr> </tbody> </table> <h2 id="cassandra-data-types"> Cassandra data types </h2> <table> <thead> <tr> <th style="text-align:left"> Source data type </th> <th style="text-align:left"> Target data type for HASH </th> <th style="text-align:left"> Example for HASH </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> ascii </td> <td style="text-align:left"> string </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> counter (64-bit long) </td> <td style="text-align:left"> string </td> <td style="text-align:left"> <code> 2 </code> </td> </tr> <tr> <td style="text-align:left"> date </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> decimal </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> double </td> <td style="text-align:left"> string </td> <td style="text-align:left"> '1.007308023' </td> </tr> <tr> <td style="text-align:left"> duration </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> float </td> <td style="text-align:left"> string </td> <td style="text-align:left"> The number <code> -3.4E+38 </code> will be received by debezium as <code> -3.4E38 </code> , will be converted by the Applier to <code> -340000000000000000000000000000000000000 </code> and will be saved in Redis target database as <code> '-340000000000000000000000000000000000000' </code> </td> </tr> <tr> <td style="text-align:left"> frozen </td> <td style="text-align:left"> string </td> <td style="text-align:left"> <code> {'10.10.11.1', '10.10.10.1', '10.10.12.1'} </code> will be saved in Redis target database as a string: <code> '{'10.10.11.1', '10.10.10.1', '10.10.12.1'}' </code> </td> </tr> <tr> <td style="text-align:left"> frozen udt </td> <td style="text-align:left"> string </td> <td style="text-align:left"> <code> {'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'} </code> will be saved in Redis target database as a string: <code> '{'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'}' </code> </td> </tr> <tr> <td style="text-align:left"> inet </td> <td style="text-align:left"> string <br/> IPv4 and IPv6 network addresses </td> <td style="text-align:left"> The IP address <code> 4.35.221.243 </code> will be converted by debezium to <code> '/4.35.221.243' </code> and will be saved in Redis target database as <code> '/4.35.221.243' </code> </td> </tr> <tr> <td style="text-align:left"> list </td> <td style="text-align:left"> string </td> <td style="text-align:left"> The list <code> ['New York', 'Paris','London','New York'] </code> will be sent by debezium as array of strings: <code> ['New York', 'Paris','London','New York'] </code> and will be saved in Redis target database as the string <code> "['New York', 'Paris','London','New York']" </code> </td> </tr> <tr> <td style="text-align:left"> map </td> <td style="text-align:left"> string </td> <td style="text-align:left"> <code> {'fruit' : 'Apple', 'band' : 'Beatles'} </code> will be saved in Redis target database as a string: <code> '{'fruit' : 'Apple', 'band' : 'Beatles'}' </code> </td> </tr> <tr> <td style="text-align:left"> set </td> <td style="text-align:left"> string </td> <td style="text-align:left"> The set <code> {'y','n'} </code> will be saved in Redis target database as the string `'{'y','n'}' </td> </tr> <tr> <td style="text-align:left"> tinyint </td> <td style="text-align:left"> string </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> uuid </td> <td style="text-align:left"> string </td> <td style="text-align:left"> b9980b96-a85b-411c-b8e7-4be55c123793 </td> </tr> <tr> <td style="text-align:left"> tuple </td> <td style="text-align:left"> string </td> <td style="text-align:left"> The tuple <code> { "field1": 1, "field2": "testing tuple", "field3": 2 } </code> will be saved in Redis target database as a string: <code> ' { "field1": 1, "field2": "testing tuple", "field3": 2 }' </code> </td> </tr> <tr> <td style="text-align:left"> varint </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> </tbody> </table> <table> <thead> <tr> <th style="text-align:left"> Source data type </th> <th style="text-align:left"> Target data type for JSON </th> <th style="text-align:left"> Example for JSON </th> </tr> </thead> <tbody> <tr> <td style="text-align:left"> ascii </td> <td style="text-align:left"> string </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> counter (64-bit long) </td> <td style="text-align:left"> number </td> <td style="text-align:left"> 2 </td> </tr> <tr> <td style="text-align:left"> date </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> decimal </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> double </td> <td style="text-align:left"> number </td> <td style="text-align:left"> 1.007308023 </td> </tr> <tr> <td style="text-align:left"> duration </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> float </td> <td style="text-align:left"> number </td> <td style="text-align:left"> The number -3.4E+38 will be received by debezium as <code> -3.4E38 </code> and will be saved in Redis target database as <code> -1e+38 </code> </td> </tr> <tr> <td style="text-align:left"> frozen </td> <td style="text-align:left"> array </td> <td style="text-align:left"> <code> {'10.10.11.1', '10.10.10.1', '10.10.12.1'} </code> will be saved in Redis target database as an array: <code> {'/10.10.11.1', '/10.10.10.1', '/10.10.12.1'} </code> </td> </tr> <tr> <td style="text-align:left"> frozen udt </td> <td style="text-align:left"> object </td> <td style="text-align:left"> <code> {'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'} </code> will be saved in Redis target database as string will be saved in Redis target database as an object: <code> {'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'} </code> </td> </tr> <tr> <td style="text-align:left"> inet </td> <td style="text-align:left"> string <br/> IPv4 and IPv6 network addresses </td> <td style="text-align:left"> The IP address <code> 4.35.221.243 </code> will be converted by debezium to <code> '/4.35.221.243' </code> and will be saved in Redis target database as <code> '/4.35.221.243' </code> </td> </tr> <tr> <td style="text-align:left"> list </td> <td style="text-align:left"> array </td> <td style="text-align:left"> The list <code> ['New York', 'Paris','London','New York'] </code> will be sent by debezium as array of strings: <code> ['New York', 'Paris','London','New York'] </code> and will be saved in Redis target database as an array: <code> ['New York', 'Paris','London','New York'] </code> </td> </tr> <tr> <td style="text-align:left"> map </td> <td style="text-align:left"> object </td> <td style="text-align:left"> <code> {'fruit' : 'Apple', 'band' : 'Beatles'} </code> will be saved in Redis target database as an object: <code> {'fruit' : 'Apple', 'band' : 'Beatles'} </code> </td> </tr> <tr> <td style="text-align:left"> set </td> <td style="text-align:left"> array </td> <td style="text-align:left"> The set <code> {'y','n'} </code> will be saved in Redis target database as an array: <code> {'y','n'} </code> </td> </tr> <tr> <td style="text-align:left"> tinyint </td> <td style="text-align:left"> </td> <td style="text-align:left"> </td> </tr> <tr> <td style="text-align:left"> uuid </td> <td style="text-align:left"> string </td> <td style="text-align:left"> b9980b96-a85b-411c-b8e7-4be55c123793 </td> </tr> <tr> <td style="text-align:left"> tuple </td> <td style="text-align:left"> object </td> <td style="text-align:left"> The tuple <code> { "field1": 1, "field2": "testing tuple", "field3": 2 } </code> will be saved in Redis target database as an object: <code> { "field1": 1, "field2": "testing tuple", "field3": 2 } </code> </td> </tr> <tr> <td style="text-align:left"> varint </td> <td style="text-align:left"> not supported </td> <td style="text-align:left"> </td> </tr> </tbody> </table> <h2 id="mysql-and-mariadb-data-types"> MySQL and MariaDB data types </h2> <table> <thead> <tr> <th> Source data type </th> <th> Source data type for HASH </th> <th> Example for Hash </th> </tr> </thead> <tbody> <tr> <td> enum </td> <td> string </td> <td> MySQL enum value <code> 'cat' </code> will be stored in Redis target database as <code> 'cat' </code> </td> </tr> <tr> <td> geometry </td> <td> not supported </td> <td> </td> </tr> <tr> <td> geometrycollection </td> <td> not supported </td> <td> </td> </tr> <tr> <td> json </td> <td> string </td> <td> {"pid": 102, "name": "name2"} </td> </tr> <tr> <td> linestring </td> <td> not supported </td> <td> </td> </tr> <tr> <td> multilinestring </td> <td> not supported </td> <td> </td> </tr> <tr> <td> multipoint </td> <td> not supported </td> <td> </td> </tr> <tr> <td> multypolygon </td> <td> not supported </td> <td> </td> </tr> <tr> <td> polygon </td> <td> not supported </td> <td> </td> </tr> <tr> <td> set </td> <td> string </td> <td> <code> '1,2,3' </code> will be stored in Redis target database as: <code> '1,2,3' </code> </td> </tr> <tr> <td> year </td> <td> string </td> <td> The value <code> '55' </code> will be stored in the database as <code> 2055 </code> and will be sent by Debezium as int32 data type with value <code> 2055 </code> . It will be stored in Redis target database as the string <code> '2055' </code> as well </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Source data type </th> <th> Target data type for JSON </th> <th> Example for JSON </th> </tr> </thead> <tbody> <tr> <td> enum </td> <td> string </td> <td> MySQL enum value <code> 'cat' </code> will be stored in Redis target database as <code> 'cat' </code> </td> </tr> <tr> <td> geometry </td> <td> not supported </td> <td> </td> </tr> <tr> <td> geometrycollection </td> <td> not supported </td> <td> </td> </tr> <tr> <td> json </td> <td> object </td> <td> {"pid": 102, "name": "name2"} </td> </tr> <tr> <td> linestring </td> <td> not supported </td> <td> </td> </tr> <tr> <td> multilinestring </td> <td> not supported </td> <td> </td> </tr> <tr> <td> multipoint </td> <td> not supported </td> <td> </td> </tr> <tr> <td> multypolygon </td> <td> not supported </td> <td> </td> </tr> <tr> <td> polygon </td> <td> not supported </td> <td> </td> </tr> <tr> <td> set </td> <td> string </td> <td> <code> '1,2,3' </code> will be stored in Redis target database as: <code> '1,2,3' </code> </td> </tr> <tr> <td> year </td> <td> number </td> <td> The value <code> '55' </code> will be stored in the database as <code> 2055 </code> and will be sent by Debezium as int32 data type with value <code> 2055 </code> . It will be stored in Redis target database as the number <code> 2055 </code> as well </td> </tr> </tbody> </table> <h2 id="oracle-data-types"> Oracle data types </h2> <table> <thead> <tr> <th> Source data type </th> <th> Source data type for HASH </th> <th> Example for Hash </th> </tr> </thead> <tbody> <tr> <td> bfile </td> <td> not supported </td> <td> </td> </tr> <tr> <td> binary_double </td> <td> string </td> <td> '1.7E+308' </td> </tr> <tr> <td> binary_float </td> <td> string </td> <td> '3.40282E38' </td> </tr> <tr> <td> clob </td> <td> string </td> <td> large block of text </td> </tr> <tr> <td> float,real,double precision <br/> real = FLOAT(63),double precision = FLOAT(126). </td> <td> string </td> <td> The value <code> -3.402E+38 </code> will be saved in Redis target database as the string <code> '-340200000000000000000000000000000000000' </code> when Debezium configuration parameter <code> decimal.handling.mode = 'double' </code> </td> </tr> <tr> <td> long raw </td> <td> not supported </td> <td> </td> </tr> <tr> <td> nchar </td> <td> string - is Unicode data type that can store Unicode characters </td> <td> The string <code> 'testing hebrew שלום' </code> will be stored in Redis target database as ' <code> testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d </code> ' </td> </tr> <tr> <td> nclob </td> <td> not supported </td> <td> </td> </tr> <tr> <td> number(p,s) </td> <td> string </td> <td> '10385274000.32' </td> </tr> <tr> <td> nvarchar </td> <td> string - is Unicode data type that can store Unicode characters </td> <td> The string <code> testing hebrew שלום' </code> will be stored in Redis target database as ' <code> testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d </code> ' </td> </tr> <tr> <td> raw </td> <td> not supported </td> <td> </td> </tr> <tr> <td> rowid </td> <td> string </td> <td> AAAR1QAAOAAAACFAAA </td> </tr> <tr> <td> timestamp with tz </td> <td> string </td> <td> <code> '2021-12-30 14:23:46' </code> will be converted by Debezium to the string <code> '2021-12-30T14:23:46+02:00' </code> and will be stored in Redis target database as the string: <code> '1611878400000' </code> which is the number of ms since epoch </td> </tr> <tr> <td> urowid </td> <td> not supported </td> <td> </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Source data type </th> <th> Target data type for JSON </th> <th> Example for JSON </th> </tr> </thead> <tbody> <tr> <td> bfile </td> <td> not supported </td> <td> </td> </tr> <tr> <td> binary_double </td> <td> number </td> <td> 1.7E+308 </td> </tr> <tr> <td> binary_float </td> <td> number </td> <td> 3.40282E38 </td> </tr> <tr> <td> clob </td> <td> string </td> <td> large block of text </td> </tr> <tr> <td> float,real,double precision <br/> real = FLOAT(63),double precision = FLOAT(126). </td> <td> number/string </td> <td> the value <code> -3.402E+38 </code> will be saved in Redis target database as the number <code> -340200000000000000000000000000000000000 </code> when Debezium configuration parameter <code> decimal.handling.mode = 'double' </code> </td> </tr> <tr> <td> long raw </td> <td> not supported </td> <td> </td> </tr> <tr> <td> nchar </td> <td> string - is Unicode data type that can store Unicode characters </td> <td> The string <code> 'testing hebrew שלום' </code> will be stored in Redis target database as ' <code> testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d </code> ' </td> </tr> <tr> <td> nclob </td> <td> not supported </td> <td> </td> </tr> <tr> <td> number(p,s) </td> <td> number </td> <td> 10385274000.32 </td> </tr> <tr> <td> nvarchar </td> <td> string - is Unicode data type that can store Unicode characters </td> <td> The string <code> testing hebrew שלום' </code> will be stored in Redis target database as ' <code> testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d </code> ' </td> </tr> <tr> <td> raw </td> <td> not supported </td> <td> </td> </tr> <tr> <td> rowid </td> <td> string </td> <td> AAAR1QAAOAAAACFAAA </td> </tr> <tr> <td> timestamp with tz </td> <td> number </td> <td> <code> '2021-12-30 14:23:46' </code> will be converted by Debezium to the string <code> '2021-12-30T14:23:46+02:00' </code> and will be stored in Redis target database as the number: <code> 1611878400000 </code> which is the number of ms since epoch </td> </tr> <tr> <td> urowid </td> <td> not supported </td> <td> </td> </tr> </tbody> </table> <h2 id="postgresql-data-types"> PostgreSQL data types </h2> <table> <thead> <tr> <th> Source data type </th> <th> Source data type for HASH </th> <th> Example for Hash </th> </tr> </thead> <tbody> <tr> <td> box </td> <td> not supported </td> <td> </td> </tr> <tr> <td> cidr </td> <td> string <br/> IPv4 and IPv6 networks addresses. </td> <td> '4.35.221.243/32' </td> </tr> <tr> <td> circle </td> <td> not supported </td> <td> </td> </tr> <tr> <td> domain </td> <td> string </td> <td> </td> </tr> <tr> <td> hstore </td> <td> string </td> <td> '{"pages":"368","author":"Katherine Dunn","category":"fiction"}' </td> </tr> <tr> <td> inet </td> <td> string <br/> IPv4 and IPv6 network addresses </td> <td> '4.35.221.243' </td> </tr> <tr> <td> json </td> <td> string </td> <td> "{"guid":  "9c36adc1-7fb5-4d5b-83b4-90356a46061a", <br/> "name": "Angela Barton", <br/> "is_active": null, <br/> "company": "Magnafone" <br/> "address": "178 Howard Place, Gulf, Washington,702", <br/> "registered": "2009-11-07T08:53:22 +08:00", <br/> "latitude": 19.793713, <br/> "longitude": 86.513373, <br/> "tags": ["enim","aliquip","qui" ]}" </td> </tr> <tr> <td> line </td> <td> not supported </td> <td> </td> </tr> <tr> <td> macaddr </td> <td> string <br/> mac addresses </td> <td> '08:00:2b:01:02:03' </td> </tr> <tr> <td> money </td> <td> string </td> <td> When <code> decimal.handling.mode = 'double' </code> the money value <code> -8793780.01 </code> will be received by Debezium as <code> -8793780.01 </code> with double data type, and will be stored in Redis target database as the string' <code> -8793780.01 </code> ' </td> </tr> <tr> <td> path </td> <td> not supported </td> <td> </td> </tr> <tr> <td> point </td> <td> not supported </td> <td> </td> </tr> <tr> <td> polygon </td> <td> not supported </td> <td> </td> </tr> <tr> <td> uuid </td> <td> string </td> <td> 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11' </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Source data type </th> <th> Target data type for JSON </th> <th> Example for JSON </th> </tr> </thead> <tbody> <tr> <td> box </td> <td> not supported </td> <td> </td> </tr> <tr> <td> cidr </td> <td> string <br/> IPv4 and IPv6 networks addresses. </td> <td> '4.35.221.243/32' </td> </tr> <tr> <td> circle </td> <td> not supported </td> <td> </td> </tr> <tr> <td> domain </td> <td> string </td> <td> </td> </tr> <tr> <td> hstore </td> <td> string </td> <td> '{"pages":"368","author":"Katherine Dunn","category":"fiction"} </td> </tr> <tr> <td> inet </td> <td> string <br/> IPv4 and IPv6 network addresses </td> <td> '4.35.221.243' </td> </tr> <tr> <td> json </td> <td> object </td> <td> {"guid":  "9c36adc1-7fb5-4d5b-83b4-90356a46061a", <br/> "name": "Angela Barton", <br/> "is_active": null, <br/> "company": "Magnafone" <br/> "address": "178 Howard Place, Gulf, Washington,702", <br/> "registered": "2009-11-07T08:53:22 +08:00", <br/> "latitude": 19.793713, <br/> "longitude": 86.513373, <br/> "tags": ["enim","aliquip","qui" ]} </td> </tr> <tr> <td> line </td> <td> not supported </td> <td> </td> </tr> <tr> <td> macaddr </td> <td> string <br/> mac addresses </td> <td> '08:00:2b:01:02:03' </td> </tr> <tr> <td> money </td> <td> string </td> <td> When <code> decimal.handling.mode = 'double' </code> the money value <code> -8793780.01 </code> will be received by Debezium as <code> -8793780.01 </code> , with double data type and will be stored in Redis target database as the number <code> -8793780.01 </code> </td> </tr> <tr> <td> path </td> <td> not supported </td> <td> </td> </tr> <tr> <td> point </td> <td> not supported </td> <td> </td> </tr> <tr> <td> polygon </td> <td> not supported </td> <td> </td> </tr> <tr> <td> uuid </td> <td> string </td> <td> 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11' </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table> <h2 id="sql-server-data-types"> SQL server data types </h2> <table> <thead> <tr> <th> Source data type </th> <th> Source data type for HASH </th> <th> Example for Hash </th> </tr> </thead> <tbody> <tr> <td> bit </td> <td> string </td> <td> When value <code> &gt;0 </code> it will be converted by Debezium to true and will be saved in Redis target database as ' <code> 1 </code> ' while when value <code> = 0 </code> it will be converted by Debezium to false and will be saved in Redis target database as ' <code> 0 </code> ' </td> </tr> <tr> <td> datetime2 </td> <td> string <br/> Represents the number of milliseconds since the epoch, and does not include timezone information. </td> <td> When Debezium configuration parameter <code> time.precision.mode='connect' </code> , the value ' <code> 2018-06-20 15:13:16.945104 </code> ' will be converted by Debezium to the value ' <code> 1529507596945104 </code> ' and will be saved in Redis target database database as the string <code> '1529507596945.104 </code> ' </td> </tr> <tr> <td> datetimeoffset </td> <td> string </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'precision' </code> , the datetimeoffset datatype value ' <code> 12-10-25 12:32:10 +01:00 </code> ' will be converted to the string ' <code> 2025-12-10T12:32:10+01:00' </code> and will be saved in Redis target database as <code> 1765366330000 </code> </td> </tr> <tr> <td> decimal,float,real </td> <td> string <br/> range of values: decimal-10^38 +1 to 10^38,float-1.79E+308 to -2.23E-308, 0 and 2.23E-308 to 1.79E+308,real:- 3.40E + 38 to -1.18E - 38, 0 and 1.18E - 38 to 3.40E + 38 </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'precision' </code> the value ' <code> -3.402E+38 </code> ' will be converted by Debezium to the binary string ' <code> /wAP3QCzc/wpiIGe8AAAAAA= </code> ' and will be saved in Redis target database as the string ' <code> -340200000000000000000000000000000000000 </code> ' </td> </tr> <tr> <td> image </td> <td> string <br/> Variable-length binary data from 0 through 2,147,483,647 bytes. </td> <td> </td> </tr> <tr> <td> money </td> <td> string <br/> range of values: -922,337,203,685,477,5808 to 922,337,203,685,477.5807 </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'precision' </code> the value <code> 922337203685477.5807 </code> will be converted by Debezium to the binary ' <code> f/////////8= </code> ' string and will be saved in Redis target database as the string ' <code> 922337203685477.5807 </code> ' </td> </tr> <tr> <td> nchar </td> <td> string - fixed-size string data , Unicode data type that can store Unicode characters </td> <td> </td> </tr> <tr> <td> nvarchar </td> <td> string - variable-size string data, Unicode data type that can store Unicode characters </td> <td> </td> </tr> <tr> <td> numeric </td> <td> string <br/> range of values - 10^38 +1 to 10^38 </td> <td> When Debezium configuration parameter <code> time.precision.mode = 'connect' </code> and <code> decimal.handling.mode = 'precision' </code> , the value <code> 1.00E +33 </code> will be converted by Debezium to the binary string <code> 'SztMqFqGw1MAAAAAAAAAAA==' </code> and will be saved in Redis target database as the string <code> '1000000000000000000000000000000000' </code> </td> </tr> <tr> <td> rowversion </td> <td> string <br/> data type that exposes automatically generated, unique binary numbers within a database. rowversion is generally used as a mechanism for version-stamping table rows. </td> <td> 0x00000000000007D0 </td> </tr> <tr> <td> smalldatetime </td> <td> string <br/> represents the number of milliseconds past the epoch, and does not include timezone information. </td> <td> <code> '2018-06-20 15:13:16 </code> ' will be converted by Debezium to <code> 1529507580000 </code> ms past the epoch and will be saved in Write-behind as the string ' <code> 1529507580000 </code> '. <br/> number of seconds: 16 will be not be included in the convertion and will not be saved in Redis target database </td> </tr> <tr> <td> smallmoney </td> <td> string <br/> range of values: - 214,748.3648 to 214,748.3647 </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'string' </code> the value <code> -214748.3648 </code> will be converted by Debezium to the string <code> '-214748.3648' </code> and will be saved in Redis target database as ' <code> -214748.3648 </code> ' </td> </tr> <tr> <td> Spatial Geometry Types </td> <td> not supported </td> <td> </td> </tr> <tr> <td> Spatial Geography Types </td> <td> not supported </td> <td> </td> </tr> <tr> <td> table </td> <td> not supported </td> <td> </td> </tr> <tr> <td> text </td> <td> Variable-length Unicode data </td> <td> </td> </tr> <tr> <td> uniqueidentifier </td> <td> string </td> <td> 06BEEF00-F859-406B-9A60-0A56AB81A97 </td> </tr> </tbody> </table> <table> <thead> <tr> <th> Source data type </th> <th> Target data type for JSON </th> <th> Example for JSON </th> </tr> </thead> <tbody> <tr> <td> bit </td> <td> boolean </td> <td> When value <code> &gt;0 </code> it will be converted by Debezium to true and will be saved in Redis target database as <code> True </code> while when value <code> = 0 </code> it will be converted by Debezium to false and will be saved in Redis target database as <code> False </code> </td> </tr> <tr> <td> datetime2 </td> <td> number <br/> Represents the number of milliseconds since the epoch, and does not include timezone </td> <td> When Debezium configuration parameter <code> time.precision.mode='connect' </code> , the value ' <code> 2018-06-20 15:13:16.945104 </code> ' will be converted by Debezium to the value ' <code> 1529507596945104 </code> ' and will be saved in Redis target database database as the number <code> 1529507596945.104 </code> </td> </tr> <tr> <td> datetimeoffset </td> <td> number </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'precision' </code> , the datetimeoffset datatype value ' <code> 12-10-25 12:32:10 +01:00 </code> ' will be converted to the string ' <code> 2025-12-10T12:32:10+01:00' </code> and will be saved in Redis target database as the string <code> 1765366330000 </code> </td> </tr> <tr> <td> decimal,float,real </td> <td> number/string </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'precision' </code> the value ' <code> -3.402E+38 </code> ' will be converted by Debezium to the binary string ' <code> /wAP3QCzc/wpiIGe8AAAAAA= </code> ' and will be saved in Redis target database as the number <code> -340200000000000000000000000000000000000 </code> </td> </tr> <tr> <td> image </td> <td> string </td> <td> </td> </tr> <tr> <td> money </td> <td> number/string depending on the value of decimal.handling.mode </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'precision' </code> the value <code> 922337203685477.5807 </code> will be converted by Debezium to the binary ' <code> f/////////8= </code> ' string and will be saved in Redis target database as the number <code> 922337203685477.5807 </code> </td> </tr> <tr> <td> nchar </td> <td> string </td> <td> </td> </tr> <tr> <td> nvarchar </td> <td> string - variable-size string data, Unicode data type that can store Unicode characters </td> <td> </td> </tr> <tr> <td> numeric </td> <td> number </td> <td> When Debezium configuration parameter <code> time.precision.mode = 'connect' </code> and <code> decimal.handling.mode = 'precision' </code> , the value <code> 1.00E +33 </code> will be converted by Debezium to the binary string <code> 'SztMqFqGw1MAAAAAAAAAAA==' </code> and will be saved in Redis target database as the number <code> 1000000000000000000000000000000000 </code> </td> </tr> <tr> <td> rowversion </td> <td> string <br/> data type that exposes automatically generated, unique binary numbers within a database. rowversion is generally used as a mechanism for version-stamping table rows. </td> <td> 0x00000000000007D0 </td> </tr> <tr> <td> smalldatetime </td> <td> number <br/> represents the number of milliseconds past the epoch, and does not include timezone information. </td> <td> <code> '2018-06-20 15:13:16 </code> ' will be converted by Debezium to <code> 1529507580000 </code> ms past the epoch and will be saved in Write-behind as the number <code> 1529507580000 </code> . <br/> number of seconds: 16 will be not be included in the convertion and will not be saved in Redis target database </td> </tr> <tr> <td> smallmoney </td> <td> number </td> <td> When Debezium configuration parameter <code> decimal.handling.mode = 'string' </code> the value <code> -214748.3648 </code> will be converted by Debezium to the string <code> '-214748.3648' </code> and will be saved in Redis target database as ' <code> -214748.3648 </code> ' </td> </tr> <tr> <td> Spatial Geometry Types </td> <td> not supported </td> <td> </td> </tr> <tr> <td> Spatial Geography Types </td> <td> not supported </td> <td> </td> </tr> <tr> <td> table </td> <td> not supported </td> <td> </td> </tr> <tr> <td> text </td> <td> </td> <td> </td> </tr> <tr> <td> uniqueidentifier </td> <td> string </td> <td> 06BEEF00-F859-406B-9A60-0A56AB81A97 </td> </tr> </tbody> </table> <p> * fields with "not supported" data type will not appear in target hash. </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/reference/data-types-conversion/"/> <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-get/.html
<section class="prose w-full py-12"> <h1 class="command-name"> CONFIG GET </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">CONFIG GET parameter [parameter ...]</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) when N is the number of configuration parameters provided </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 GET </code> command is used to read the configuration parameters of a running Redis server. Not all the configuration parameters are supported in Redis 2.4, while Redis 2.6 can read the whole configuration of a server using this command. </p> <p> The symmetric command used to alter the configuration at run time is <code> CONFIG SET </code> . </p> <p> <code> CONFIG GET </code> takes multiple arguments, which are glob-style patterns. Any configuration parameter matching any of the patterns are reported as a list of key-value pairs. Example: </p> <pre tabindex="0"><code>redis&gt; config get *max-*-entries* maxmemory 1) "maxmemory" 2) "0" 3) "hash-max-listpack-entries" 4) "512" 5) "hash-max-ziplist-entries" 6) "512" 7) "set-max-intset-entries" 8) "512" 9) "zset-max-listpack-entries" 10) "128" 11) "zset-max-ziplist-entries" 12) "128" </code></pre> <p> You can obtain a list of all the supported configuration parameters by typing <code> CONFIG GET * </code> in an open <code> redis-cli </code> prompt. </p> <p> All the supported parameters have the same meaning of the equivalent configuration parameter used in the <a href="http://github.com/redis/redis/raw/unstable/redis.conf"> redis.conf </a> file: </p> <p> Note that you should look at the redis.conf file relevant to the version you're working with as configuration options might change between versions. The link above is to the latest development version. </p> <h2 id="resp2-reply"> RESP2 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a list of configuration parameters matching the provided arguments. <h2 id="resp3-reply"> RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#maps"> Map reply </a> : a list of configuration parameters matching the provided arguments. <br/> <h2> History </h2> <ul> <li> Starting with Redis version 7.0.0: Added the ability to pass multiple pattern parameters in one call </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/config-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/develop/reference/protocol-spec/.html
<section class="prose w-full py-12"> <h1> Redis serialization protocol specification </h1> <p class="text-lg -mt-5 mb-10"> Redis serialization protocol (RESP) is the wire protocol that clients implement </p> <p> To communicate with the Redis server, Redis clients use a protocol called Redis Serialization Protocol (RESP). While the protocol was designed specifically for Redis, you can use it for other client-server software projects. </p> <p> RESP is a compromise among the following considerations: </p> <ul> <li> Simple to implement. </li> <li> Fast to parse. </li> <li> Human readable. </li> </ul> <p> RESP can serialize different data types including integers, strings, and arrays. It also features an error-specific type. A client sends a request to the Redis server as an array of strings. The array's contents are the command and its arguments that the server should execute. The server's reply type is command-specific. </p> <p> RESP is binary-safe and uses prefixed length to transfer bulk data so it does not require processing bulk data transferred from one process to another. </p> <p> RESP is the protocol you should implement in your Redis client. </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 protocol outlined here is used only for client-server communication. <a href="/docs/latest/operate/oss_and_stack/reference/cluster-spec/"> Redis Cluster </a> uses a different binary protocol for exchanging messages between nodes. </div> </div> <h2 id="resp-versions"> RESP versions </h2> <p> Support for the first version of the RESP protocol was introduced in Redis 1.2. Using RESP with Redis 1.2 was optional and had mainly served the purpose of working the kinks out of the protocol. </p> <p> In Redis 2.0, the protocol's next version, a.k.a RESP2, became the standard communication method for clients with the Redis server. </p> <p> <a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md"> RESP3 </a> is a superset of RESP2 that mainly aims to make a client author's life a little bit easier. Redis 6.0 introduced experimental opt-in support of RESP3's features (excluding streaming strings and streaming aggregates). In addition, the introduction of the <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command allows clients to handshake and upgrade the connection's protocol version (see <a href="#client-handshake"> Client handshake </a> ). </p> <p> Up to and including Redis 7, both RESP2 and RESP3 clients can invoke all core commands. However, commands may return differently typed replies for different protocol versions. </p> <p> Future versions of Redis may change the default protocol version, but it is unlikely that RESP2 will become entirely deprecated. It is possible, however, that new features in upcoming versions will require the use of RESP3. </p> <h2 id="network-layer"> Network layer </h2> <p> A client connects to a Redis server by creating a TCP connection to its port (the default is 6379). </p> <p> While RESP is technically non-TCP specific, the protocol is used exclusively with TCP connections (or equivalent stream-oriented connections like Unix sockets) in the context of Redis. </p> <h2 id="request-response-model"> Request-Response model </h2> <p> The Redis server accepts commands composed of different arguments. Then, the server processes the command and sends the reply back to the client. </p> <p> This is the simplest model possible; however, there are some exceptions: </p> <ul> <li> Redis requests can be <a href="#multiple-commands-and-pipelining"> pipelined </a> . Pipelining enables clients to send multiple commands at once and wait for replies later. </li> <li> When a RESP2 connection subscribes to a <a href="/docs/latest/develop/interact/pubsub/"> Pub/Sub </a> channel, the protocol changes semantics and becomes a <em> push </em> protocol. The client no longer requires sending commands because the server will automatically send new messages to the client (for the channels the client is subscribed to) as soon as they are received. </li> <li> The <a href="/docs/latest/commands/monitor/"> <code> MONITOR </code> </a> command. Invoking the <a href="/docs/latest/commands/monitor/"> <code> MONITOR </code> </a> command switches the connection to an ad-hoc push mode. The protocol of this mode is not specified but is obvious to parse. </li> <li> <a href="/docs/latest/operate/oss_and_stack/management/security/#protected-mode"> Protected mode </a> . Connections opened from a non-loopback address to a Redis while in protected mode are denied and terminated by the server. Before terminating the connection, Redis unconditionally sends a <code> -DENIED </code> reply, regardless of whether the client writes to the socket. </li> <li> The <a href="#resp3-pushes"> RESP3 Push type </a> . As the name suggests, a push type allows the server to send out-of-band data to the connection. The server may push data at any time, and the data isn't necessarily related to specific commands executed by the client. </li> </ul> <p> Excluding these exceptions, the Redis protocol is a simple request-response protocol. </p> <h2 id="resp-protocol-description"> RESP protocol description </h2> <p> RESP is essentially a serialization protocol that supports several data types. In RESP, the first byte of data determines its type. </p> <p> Redis generally uses RESP as a <a href="#request-response-model"> request-response </a> protocol in the following way: </p> <ul> <li> Clients send commands to a Redis server as an <a href="#arrays"> array </a> of <a href="#bulk-strings"> bulk strings </a> . The first (and sometimes also the second) bulk string in the array is the command's name. Subsequent elements of the array are the arguments for the command. </li> <li> The server replies with a RESP type. The reply's type is determined by the command's implementation and possibly by the client's protocol version. </li> </ul> <p> RESP is a binary protocol that uses control sequences encoded in standard ASCII. The <code> A </code> character, for example, is encoded with the binary byte of value 65. Similarly, the characters CR ( <code> \r </code> ), LF ( <code> \n </code> ) and SP ( <code> </code> ) have binary byte values of 13, 10 and 32, respectively. </p> <p> The <code> \r\n </code> (CRLF) is the protocol's <em> terminator </em> , which <strong> always </strong> separates its parts. </p> <p> The first byte in an RESP-serialized payload always identifies its type. Subsequent bytes constitute the type's contents. </p> <p> We categorize every RESP data type as either <em> simple </em> , <em> bulk </em> or <em> aggregate </em> . </p> <p> Simple types are similar to scalars in programming languages that represent plain literal values. Booleans and Integers are such examples. </p> <p> RESP strings are either <em> simple </em> or <em> bulk </em> . Simple strings never contain carriage return ( <code> \r </code> ) or line feed ( <code> \n </code> ) characters. Bulk strings can contain any binary data and may also be referred to as <em> binary </em> or <em> blob </em> . Note that bulk strings may be further encoded and decoded, e.g. with a wide multi-byte encoding, by the client. </p> <p> Aggregates, such as Arrays and Maps, can have varying numbers of sub-elements and nesting levels. </p> <p> The following table summarizes the RESP data types that Redis supports: </p> <table> <thead> <tr> <th> RESP data type </th> <th> Minimal protocol version </th> <th> Category </th> <th> First byte </th> </tr> </thead> <tbody> <tr> <td> <a href="#simple-strings"> Simple strings </a> </td> <td> RESP2 </td> <td> Simple </td> <td> <code> + </code> </td> </tr> <tr> <td> <a href="#simple-errors"> Simple Errors </a> </td> <td> RESP2 </td> <td> Simple </td> <td> <code> - </code> </td> </tr> <tr> <td> <a href="#integers"> Integers </a> </td> <td> RESP2 </td> <td> Simple </td> <td> <code> : </code> </td> </tr> <tr> <td> <a href="#bulk-strings"> Bulk strings </a> </td> <td> RESP2 </td> <td> Aggregate </td> <td> <code> $ </code> </td> </tr> <tr> <td> <a href="#arrays"> Arrays </a> </td> <td> RESP2 </td> <td> Aggregate </td> <td> <code> * </code> </td> </tr> <tr> <td> <a href="#nulls"> Nulls </a> </td> <td> RESP3 </td> <td> Simple </td> <td> <code> _ </code> </td> </tr> <tr> <td> <a href="#booleans"> Booleans </a> </td> <td> RESP3 </td> <td> Simple </td> <td> <code> # </code> </td> </tr> <tr> <td> <a href="#doubles"> Doubles </a> </td> <td> RESP3 </td> <td> Simple </td> <td> <code> , </code> </td> </tr> <tr> <td> <a href="#big-numbers"> Big numbers </a> </td> <td> RESP3 </td> <td> Simple </td> <td> <code> ( </code> </td> </tr> <tr> <td> <a href="#bulk-errors"> Bulk errors </a> </td> <td> RESP3 </td> <td> Aggregate </td> <td> <code> ! </code> </td> </tr> <tr> <td> <a href="#verbatim-strings"> Verbatim strings </a> </td> <td> RESP3 </td> <td> Aggregate </td> <td> <code> = </code> </td> </tr> <tr> <td> <a href="#maps"> Maps </a> </td> <td> RESP3 </td> <td> Aggregate </td> <td> <code> % </code> </td> </tr> <tr> <td> <a href="#attributes"> Attributes </a> </td> <td> RESP3 </td> <td> Aggregate </td> <td> ` </td> </tr> <tr> <td> <a href="#sets"> Sets </a> </td> <td> RESP3 </td> <td> Aggregate </td> <td> <code> ~ </code> </td> </tr> <tr> <td> <a href="#pushes"> Pushes </a> </td> <td> RESP3 </td> <td> Aggregate </td> <td> <code> &gt; </code> </td> </tr> </tbody> </table> <p> <a name="simple-string-reply"> </a> </p> <h3 id="simple-strings"> Simple strings </h3> <p> Simple strings are encoded as a plus ( <code> + </code> ) character, followed by a string. The string mustn't contain a CR ( <code> \r </code> ) or LF ( <code> \n </code> ) character and is terminated by CRLF (i.e., <code> \r\n </code> ). </p> <p> Simple strings transmit short, non-binary strings with minimal overhead. For example, many Redis commands reply with just "OK" on success. The encoding of this Simple String is the following 5 bytes: </p> <pre><code>+OK\r\n </code></pre> <p> When Redis replies with a simple string, a client library should return to the caller a string value composed of the first character after the <code> + </code> up to the end of the string, excluding the final CRLF bytes. </p> <p> To send binary strings, use <a href="#bulk-strings"> bulk strings </a> instead. </p> <p> <a name="error-reply"> </a> </p> <h3 id="simple-errors"> Simple errors </h3> <p> RESP has specific data types for errors. Simple errors, or simply just errors, are similar to <a href="#simple-strings"> simple strings </a> , but their first character is the minus ( <code> - </code> ) character. The difference between simple strings and errors in RESP is that clients should treat errors as exceptions, whereas the string encoded in the error type is the error message itself. </p> <p> The basic format is: </p> <pre><code>-Error message\r\n </code></pre> <p> Redis replies with an error only when something goes wrong, for example, when you try to operate against the wrong data type, or when the command does not exist. The client should raise an exception when it receives an Error reply. </p> <p> The following are examples of error replies: </p> <pre><code>-ERR unknown command 'asdf' -WRONGTYPE Operation against a key holding the wrong kind of value </code></pre> <p> The first upper-case word after the <code> - </code> , up to the first space or newline, represents the kind of error returned. This word is called an <em> error prefix </em> . Note that the error prefix is a convention used by Redis rather than part of the RESP error type. </p> <p> For example, in Redis, <code> ERR </code> is a generic error, whereas <code> WRONGTYPE </code> is a more specific error that implies that the client attempted an operation against the wrong data type. The error prefix allows the client to understand the type of error returned by the server without checking the exact error message. </p> <p> A client implementation can return different types of exceptions for various errors, or provide a generic way for trapping errors by directly providing the error name to the caller as a string. </p> <p> However, such a feature should not be considered vital as it is rarely useful. Also, simpler client implementations can return a generic error value, such as <code> false </code> . </p> <p> <a name="integer-reply"> </a> </p> <h3 id="integers"> Integers </h3> <p> This type is a CRLF-terminated string that represents a signed, base-10, 64-bit integer. </p> <p> RESP encodes integers in the following way: </p> <pre><code>:[&lt;+|-&gt;]&lt;value&gt;\r\n </code></pre> <ul> <li> The colon ( <code> : </code> ) as the first byte. </li> <li> An optional plus ( <code> + </code> ) or minus ( <code> - </code> ) as the sign. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the integer's unsigned, base-10 value. </li> <li> The CRLF terminator. </li> </ul> <p> For example, <code> :0\r\n </code> and <code> :1000\r\n </code> are integer replies (of zero and one thousand, respectively). </p> <p> Many Redis commands return RESP integers, including <a href="/docs/latest/commands/incr/"> <code> INCR </code> </a> , <a href="/docs/latest/commands/llen/"> <code> LLEN </code> </a> , and <a href="/docs/latest/commands/lastsave/"> <code> LASTSAVE </code> </a> . An integer, by itself, has no special meaning other than in the context of the command that returned it. For example, it is an incremental number for <a href="/docs/latest/commands/incr/"> <code> INCR </code> </a> , a UNIX timestamp for <a href="/docs/latest/commands/lastsave/"> <code> LASTSAVE </code> </a> , and so forth. However, the returned integer is guaranteed to be in the range of a signed 64-bit integer. </p> <p> In some cases, integers can represent true and false Boolean values. For instance, <a href="/docs/latest/commands/sismember/"> <code> SISMEMBER </code> </a> returns 1 for true and 0 for false. </p> <p> Other commands, including <a href="/docs/latest/commands/sadd/"> <code> SADD </code> </a> , <a href="/docs/latest/commands/srem/"> <code> SREM </code> </a> , and <a href="/docs/latest/commands/setnx/"> <code> SETNX </code> </a> , return 1 when the data changes and 0 otherwise. </p> <p> <a name="bulk-string-reply"> </a> </p> <h3 id="bulk-strings"> Bulk strings </h3> <p> A bulk string represents a single binary string. The string can be of any size, but by default, Redis limits it to 512 MB (see the <code> proto-max-bulk-len </code> configuration directive). </p> <p> RESP encodes bulk strings in the following way: </p> <pre><code>$&lt;length&gt;\r\n&lt;data&gt;\r\n </code></pre> <ul> <li> The dollar sign ( <code> $ </code> ) as the first byte. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the string's length, in bytes, as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> <li> The data. </li> <li> A final CRLF. </li> </ul> <p> So the string "hello" is encoded as follows: </p> <pre><code>$5\r\nhello\r\n </code></pre> <p> The empty string's encoding is: </p> <pre><code>$0\r\n\r\n </code></pre> <p> <a name="nil-reply"> </a> </p> <h4 id="null-bulk-strings"> Null bulk strings </h4> <p> Whereas RESP3 has a dedicated data type for <a href="#nulls"> null values </a> , RESP2 has no such type. Instead, due to historical reasons, the representation of null values in RESP2 is via predetermined forms of the <a href="#bulk-strings"> bulk strings </a> and <a href="#arrays"> arrays </a> types. </p> <p> The null bulk string represents a non-existing value. The <a href="/docs/latest/commands/get/"> <code> GET </code> </a> command returns the Null Bulk String when the target key doesn't exist. </p> <p> It is encoded as a bulk string with the length of negative one (-1), like so: </p> <pre><code>$-1\r\n </code></pre> <p> A Redis client should return a nil object when the server replies with a null bulk string rather than the empty string. For example, a Ruby library should return <code> nil </code> while a C library should return <code> NULL </code> (or set a special flag in the reply object). </p> <p> <a name="array-reply"> </a> </p> <h3 id="arrays"> Arrays </h3> <p> Clients send commands to the Redis server as RESP arrays. Similarly, some Redis commands that return collections of elements use arrays as their replies. An example is the <a href="/docs/latest/commands/lrange/"> <code> LRANGE </code> </a> command that returns elements of a list. </p> <p> RESP Arrays' encoding uses the following format: </p> <pre><code>*&lt;number-of-elements&gt;\r\n&lt;element-1&gt;...&lt;element-n&gt; </code></pre> <ul> <li> An asterisk ( <code> * </code> ) as the first byte. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the number of elements in the array as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> <li> An additional RESP type for every element of the array. </li> </ul> <p> So an empty Array is just the following: </p> <pre><code>*0\r\n </code></pre> <p> Whereas the encoding of an array consisting of the two bulk strings "hello" and "world" is: </p> <pre><code>*2\r\n$5\r\nhello\r\n$5\r\nworld\r\n </code></pre> <p> As you can see, after the <code> *&lt;count&gt;CRLF </code> part prefixing the array, the other data types that compose the array are concatenated one after the other. For example, an Array of three integers is encoded as follows: </p> <pre><code>*3\r\n:1\r\n:2\r\n:3\r\n </code></pre> <p> Arrays can contain mixed data types. For instance, the following encoding is of a list of four integers and a bulk string: </p> <pre><code>*5\r\n :1\r\n :2\r\n :3\r\n :4\r\n $5\r\n hello\r\n </code></pre> <p> (The raw RESP encoding is split into multiple lines for readability). </p> <p> The first line the server sent is <code> *5\r\n </code> . This numeric value tells the client that five reply types are about to follow it. Then, every successive reply constitutes an element in the array. </p> <p> All of the aggregate RESP types support nesting. For example, a nested array of two arrays is encoded as follows: </p> <pre><code>*2\r\n *3\r\n :1\r\n :2\r\n :3\r\n *2\r\n +Hello\r\n -World\r\n </code></pre> <p> (The raw RESP encoding is split into multiple lines for readability). </p> <p> The above encodes a two-element array. The first element is an array that, in turn, contains three integers (1, 2, 3). The second element is another array containing a simple string and an error. </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"> Multi bulk reply: </div> In some places, the RESP Array type may be referred to as <em> multi bulk </em> . The two are the same. </div> </div> <p> <a name="nil-array-reply"> </a> </p> <h4 id="null-arrays"> Null arrays </h4> <p> Whereas RESP3 has a dedicated data type for <a href="#nulls"> null values </a> , RESP2 has no such type. Instead, due to historical reasons, the representation of null values in RESP2 is via predetermined forms of the <a href="#bulk-strings"> Bulk Strings </a> and <a href="#arrays"> arrays </a> types. </p> <p> Null arrays exist as an alternative way of representing a null value. For instance, when the <a href="/docs/latest/commands/blpop/"> <code> BLPOP </code> </a> command times out, it returns a null array. </p> <p> The encoding of a null array is that of an array with the length of -1, i.e.: </p> <pre><code>*-1\r\n </code></pre> <p> When Redis replies with a null array, the client should return a null object rather than an empty array. This is necessary to distinguish between an empty list and a different condition (for instance, the timeout condition of the <a href="/docs/latest/commands/blpop/"> <code> BLPOP </code> </a> command). </p> <h4 id="null-elements-in-arrays"> Null elements in arrays </h4> <p> Single elements of an array may be <a href="#null-bulk-strings"> null bulk string </a> . This is used in Redis replies to signal that these elements are missing and not empty strings. This can happen, for example, with the <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> command when used with the <code> GET pattern </code> option if the specified key is missing. </p> <p> Here's an example of an array reply containing a null element: </p> <pre><code>*3\r\n $5\r\n hello\r\n $-1\r\n $5\r\n world\r\n </code></pre> <p> Above, the second element is null. The client library should return to its caller something like this: </p> <pre><code>["hello",nil,"world"] </code></pre> <p> <a name="null-reply"> </a> </p> <h3 id="nulls"> Nulls </h3> <p> The null data type represents non-existent values. </p> <p> Nulls' encoding is the underscore ( <code> _ </code> ) character, followed by the CRLF terminator ( <code> \r\n </code> ). Here's Null's raw RESP encoding: </p> <pre><code>_\r\n </code></pre> <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"> Null Bulk String, Null Arrays and Nulls: </div> <p> Due to historical reasons, RESP2 features two specially crafted values for representing null values of bulk strings and arrays. This duality has always been a redundancy that added zero semantical value to the protocol itself. </p> <p> The null type, introduced in RESP3, aims to fix this wrong. </p> </div> </div> <a name="boolean-reply"> <h3 id="booleans"> Booleans </h3> <p> RESP booleans are encoded as follows: </p> <pre><code>#&lt;t|f&gt;\r\n </code></pre> <ul> <li> The octothorpe character ( <code> # </code> ) as the first byte. </li> <li> A <code> t </code> character for true values, or an <code> f </code> character for false ones. </li> <li> The CRLF terminator. </li> </ul> </a> <p> <a name="boolean-reply"> </a> <a name="double-reply"> </a> </p> <h3 id="doubles"> Doubles </h3> <p> The Double RESP type encodes a double-precision floating point value. Doubles are encoded as follows: </p> <pre><code>,[&lt;+|-&gt;]&lt;integral&gt;[.&lt;fractional&gt;][&lt;E|e&gt;[sign]&lt;exponent&gt;]\r\n </code></pre> <ul> <li> The comma character ( <code> , </code> ) as the first byte. </li> <li> An optional plus ( <code> + </code> ) or minus ( <code> - </code> ) as the sign. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as an unsigned, base-10 integral value. </li> <li> An optional dot ( <code> . </code> ), followed by one or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as an unsigned, base-10 fractional value. </li> <li> An optional capital or lowercase letter E ( <code> E </code> or <code> e </code> ), followed by an optional plus ( <code> + </code> ) or minus ( <code> - </code> ) as the exponent's sign, ending with one or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as an unsigned, base-10 exponent value. </li> <li> The CRLF terminator. </li> </ul> <p> Here's the encoding of the number 1.23: </p> <pre><code>,1.23\r\n </code></pre> <p> Because the fractional part is optional, the integer value of ten (10) can, therefore, be RESP-encoded both as an integer as well as a double: </p> <pre><code>:10\r\n ,10\r\n </code></pre> <p> In such cases, the Redis client should return native integer and double values, respectively, providing that these types are supported by the language of its implementation. </p> <p> The positive infinity, negative infinity and NaN values are encoded as follows: </p> <pre><code>,inf\r\n ,-inf\r\n ,nan\r\n </code></pre> <p> <a name="big-number-reply"> </a> </p> <h3 id="big-numbers"> Big numbers </h3> <p> This type can encode integer values outside the range of signed 64-bit integers. </p> <p> Big numbers use the following encoding: </p> <pre><code>([+|-]&lt;number&gt;\r\n </code></pre> <ul> <li> The left parenthesis character ( <code> ( </code> ) as the first byte. </li> <li> An optional plus ( <code> + </code> ) or minus ( <code> - </code> ) as the sign. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> </ul> <p> Example: </p> <pre><code>(3492890328409238509324850943850943825024385\r\n </code></pre> <p> Big numbers can be positive or negative but can't include fractionals. Client libraries written in languages with a big number type should return a big number. When big numbers aren't supported, the client should return a string and, when possible, signal to the caller that the reply is a big integer (depending on the API used by the client library). </p> <p> <a name="bulk-error-reply"> </a> </p> <h3 id="bulk-errors"> Bulk errors </h3> <p> This type combines the purpose of <a href="#simple-errors"> simple errors </a> with the expressive power of <a href="#bulk-strings"> bulk strings </a> . </p> <p> It is encoded as: </p> <pre><code>!&lt;length&gt;\r\n&lt;error&gt;\r\n </code></pre> <ul> <li> An exclamation mark ( <code> ! </code> ) as the first byte. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the error's length, in bytes, as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> <li> The error itself. </li> <li> A final CRLF. </li> </ul> <p> As a convention, the error begins with an uppercase (space-delimited) word that conveys the error message. </p> <p> For instance, the error "SYNTAX invalid syntax" is represented by the following protocol encoding: </p> <pre><code>!21\r\n SYNTAX invalid syntax\r\n </code></pre> <p> (The raw RESP encoding is split into multiple lines for readability). </p> <a name="verbatim-string-reply"> <h3 id="verbatim-strings"> Verbatim strings </h3> </a> <p> <a name="verbatim-string-reply"> This type is similar to the </a> <a href="#bulk-strings"> bulk string </a> , with the addition of providing a hint about the data's encoding. </p> <p> A verbatim string's RESP encoding is as follows: </p> <pre><code>=&lt;length&gt;\r\n&lt;encoding&gt;:&lt;data&gt;\r\n </code></pre> <ul> <li> An equal sign ( <code> = </code> ) as the first byte. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the string's total length, in bytes, as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> <li> Exactly three (3) bytes represent the data's encoding. </li> <li> The colon ( <code> : </code> ) character separates the encoding and data. </li> <li> The data. </li> <li> A final CRLF. </li> </ul> <p> Example: </p> <pre><code>=15\r\n txt:Some string\r\n </code></pre> <p> (The raw RESP encoding is split into multiple lines for readability). </p> <p> Some client libraries may ignore the difference between this type and the string type and return a native string in both cases. However, interactive clients, such as command line interfaces (e.g., <a href="/docs/latest/develop/tools/cli/"> <code> redis-cli </code> </a> ), can use this type and know that their output should be presented to the human user as is and without quoting the string. </p> <p> For example, the Redis command <a href="/docs/latest/commands/info/"> <code> INFO </code> </a> outputs a report that includes newlines. When using RESP3, <code> redis-cli </code> displays it correctly because it is sent as a Verbatim String reply (with its three bytes being "txt"). When using RESP2, however, the <code> redis-cli </code> is hard-coded to look for the <a href="/docs/latest/commands/info/"> <code> INFO </code> </a> command to ensure its correct display to the user. </p> <p> <a name="map-reply"> </a> </p> <h3 id="maps"> Maps </h3> <p> The RESP map encodes a collection of key-value tuples, i.e., a dictionary or a hash. </p> <p> It is encoded as follows: </p> <pre><code>%&lt;number-of-entries&gt;\r\n&lt;key-1&gt;&lt;value-1&gt;...&lt;key-n&gt;&lt;value-n&gt; </code></pre> <ul> <li> A percent character ( <code> % </code> ) as the first byte. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the number of entries, or key-value tuples, in the map as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> <li> Two additional RESP types for every key and value in the map. </li> </ul> <p> For example, the following JSON object: </p> <pre><code>{ "first": 1, "second": 2 } </code></pre> <p> Can be encoded in RESP like so: </p> <pre><code>%2\r\n +first\r\n :1\r\n +second\r\n :2\r\n </code></pre> <p> (The raw RESP encoding is split into multiple lines for readability). </p> <p> Both map keys and values can be any of RESP's types. </p> <p> Redis clients should return the idiomatic dictionary type that their language provides. However, low-level programming languages (such as C, for example) will likely return an array along with type information that indicates to the caller that it is a dictionary. </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"> Map pattern in RESP2: </div> RESP2 doesn't have a map type. A map in RESP2 is represented by a flat array containing the keys and the values. The first element is a key, followed by the corresponding value, then the next key and so on, like this: <code> key1, value1, key2, value2, ... </code> . </div> </div> <p> <a name="attribute-reply"> </a> </p> <h3 id="attributes"> Attributes </h3> <p> The attribute type is exactly like the Map type, but instead of a <code> % </code> character as the first byte, the <code> | </code> character is used. Attributes describe a dictionary exactly like the Map type. However the client should not consider such a dictionary part of the reply, but as auxiliary data that augments the reply. </p> <p> Note: in the examples below, indentation is shown only for clarity; the additional whitespace would not be part of a real reply. </p> <p> For example, newer versions of Redis may include the ability to report the popularity of keys for every executed command. The reply to the command <code> MGET a b </code> may be the following: </p> <pre><code>|1\r\n +key-popularity\r\n %2\r\n $1\r\n a\r\n ,0.1923\r\n $1\r\n b\r\n ,0.0012\r\n *2\r\n :2039123\r\n :9543892\r\n </code></pre> <p> The actual reply to <code> MGET </code> is just the two item array <code> [2039123, 9543892] </code> . The returned attributes specify the popularity, or frequency of requests, given as floating point numbers ranging from <code> 0.0 </code> to <code> 1.0 </code> , of the keys mentioned in the original command. Note: the actual implementation in Redis may differ. </p> <p> When a client reads a reply and encounters an attribute type, it should read the attribute, and continue reading the reply. The attribute reply should be accumulated separately, and the user should have a way to access such attributes. For instance, if we imagine a session in an higher level language, something like this could happen: </p> <div class="highlight"> <pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="o">&gt;</span> <span class="n">r</span> <span class="o">=</span> <span class="n">Redis</span><span class="o">.</span><span class="n">new</span> </span></span><span class="line"><span class="cl"><span class="c1">#&lt;Redis client&gt;</span> </span></span><span class="line"><span class="cl"><span class="o">&gt;</span> <span class="n">r</span><span class="o">.</span><span class="n">mget</span><span class="p">(</span><span class="s2">"a"</span><span class="p">,</span><span class="s2">"b"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1">#&lt;Redis reply&gt;</span> </span></span><span class="line"><span class="cl"><span class="o">&gt;</span> <span class="n">r</span> </span></span><span class="line"><span class="cl"><span class="p">[</span><span class="mi">2039123</span><span class="p">,</span><span class="mi">9543892</span><span class="p">]</span> </span></span><span class="line"><span class="cl"><span class="o">&gt;</span> <span class="n">r</span><span class="o">.</span><span class="n">attribs</span> </span></span><span class="line"><span class="cl"><span class="p">{:</span><span class="n">key</span><span class="o">-</span><span class="n">popularity</span> <span class="o">=&gt;</span> <span class="p">{:</span><span class="n">a</span> <span class="o">=&gt;</span> <span class="mf">0.1923</span><span class="p">,</span> <span class="p">:</span><span class="n">b</span> <span class="o">=&gt;</span> <span class="mf">0.0012</span><span class="p">}}</span> </span></span></code></pre> </div> <p> Attributes can appear anywhere before a valid part of the protocol identifying a given type, and supply information only about the part of the reply that immediately follows. For example: </p> <pre><code>*3\r\n :1\r\n :2\r\n |1\r\n +ttl\r\n :3600\r\n :3\r\n </code></pre> <p> In the above example the third element of the array has associated auxiliary information of <code> {ttl:3600} </code> . Note that it's not up to the client library to interpret the attributes, but it should pass them to the caller in a sensible way. </p> <p> <a name="set-reply"> </a> </p> <h3 id="sets"> Sets </h3> <p> Sets are somewhat like <a href="#arrays"> Arrays </a> but are unordered and should only contain unique elements. </p> <p> RESP set's encoding is: </p> <pre><code>~&lt;number-of-elements&gt;\r\n&lt;element-1&gt;...&lt;element-n&gt; </code></pre> <ul> <li> A tilde ( <code> ~ </code> ) as the first byte. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the number of elements in the set as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> <li> An additional RESP type for every element of the Set. </li> </ul> <p> Clients should return the native set type if it is available in their programming language. Alternatively, in the absence of a native set type, an array coupled with type information can be used (in C, for example). </p> <p> <a name="push-event"> </a> </p> <h3 id="pushes"> Pushes </h3> <p> RESP's pushes contain out-of-band data. They are an exception to the protocol's request-response model and provide a generic <em> push mode </em> for connections. </p> <p> Push events are encoded similarly to <a href="#arrays"> arrays </a> , differing only in their first byte: </p> <pre><code>&gt;&lt;number-of-elements&gt;\r\n&lt;element-1&gt;...&lt;element-n&gt; </code></pre> <ul> <li> A greater-than sign ( <code> &gt; </code> ) as the first byte. </li> <li> One or more decimal digits ( <code> 0 </code> .. <code> 9 </code> ) as the number of elements in the message as an unsigned, base-10 value. </li> <li> The CRLF terminator. </li> <li> An additional RESP type for every element of the push event. </li> </ul> <p> Pushed data may precede or follow any of RESP's data types but never inside them. That means a client won't find push data in the middle of a map reply, for example. It also means that pushed data may appear before or after a command's reply, as well as by itself (without calling any command). </p> <p> Clients should react to pushes by invoking a callback that implements their handling of the pushed data. </p> <h2 id="client-handshake"> Client handshake </h2> <p> New RESP connections should begin the session by calling the <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command. This practice accomplishes two things: </p> <ol> <li> It allows servers to be backward compatible with RESP2 versions. This is needed in Redis to make the transition to version 3 of the protocol gentler. </li> <li> The <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command returns information about the server and the protocol that the client can use for different goals. </li> </ol> <p> The <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command has the following high-level syntax: </p> <pre><code>HELLO &lt;protocol-version&gt; [optional-arguments] </code></pre> <p> The first argument of the command is the protocol version we want the connection to be set. By default, the connection starts in RESP2 mode. If we specify a connection version that is too big and unsupported by the server, it should reply with a <code> -NOPROTO </code> error. Example: </p> <pre><code>Client: HELLO 4 Server: -NOPROTO sorry, this protocol version is not supported. </code></pre> <p> At that point, the client may retry with a lower protocol version. </p> <p> Similarly, the client can easily detect a server that is only able to speak RESP2: </p> <pre><code>Client: HELLO 3 Server: -ERR unknown command 'HELLO' </code></pre> <p> The client can then proceed and use RESP2 to communicate with the server. </p> <p> Note that even if the protocol's version is supported, the <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command may return an error, perform no action and remain in RESP2 mode. For example, when used with invalid authentication credentials in the command's optional <code> AUTH </code> clause: </p> <pre><code>Client: HELLO 3 AUTH default mypassword Server: -ERR invalid password (the connection remains in RESP2 mode) </code></pre> <p> A successful reply to the <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> command is a map reply. The information in the reply is partly server-dependent, but certain fields are mandatory for all the RESP3 implementations: </p> <ul> <li> <strong> server </strong> : "redis" (or other software name). </li> <li> <strong> version </strong> : the server's version. </li> <li> <strong> proto </strong> : the highest supported version of the RESP protocol. </li> </ul> <p> In Redis' RESP3 implementation, the following fields are also emitted: </p> <ul> <li> <strong> id </strong> : the connection's identifier (ID). </li> <li> <strong> mode </strong> : "standalone", "sentinel" or "cluster". </li> <li> <strong> role </strong> : "master" or "replica". </li> <li> <strong> modules </strong> : list of loaded modules as an Array of Bulk Strings. </li> </ul> <h2 id="sending-commands-to-a-redis-server"> Sending commands to a Redis server </h2> <p> Now that you are familiar with the RESP serialization format, you can use it to help write a Redis client library. We can further specify how the interaction between the client and the server works: </p> <ul> <li> A client sends the Redis server an <a href="#arrays"> array </a> consisting of only bulk strings. </li> <li> A Redis server replies to clients, sending any valid RESP data type as a reply. </li> </ul> <p> So, for example, a typical interaction could be the following. </p> <p> The client sends the command <code> LLEN mylist </code> to get the length of the list stored at the key <em> mylist </em> . Then the server replies with an <a href="#integers"> integer </a> reply as in the following example ( <code> C: </code> is the client, <code> S: </code> the server). </p> <pre><code>C: *2\r\n C: $4\r\n C: LLEN\r\n C: $6\r\n C: mylist\r\n S: :48293\r\n </code></pre> <p> As usual, we separate different parts of the protocol with newlines for simplicity, but the actual interaction is the client sending <code> *2\r\n$4\r\nLLEN\r\n$6\r\nmylist\r\n </code> as a whole. </p> <h2 id="multiple-commands-and-pipelining"> Multiple commands and pipelining </h2> <p> A client can use the same connection to issue multiple commands. Pipelining is supported, so multiple commands can be sent with a single write operation by the client. The client can skip reading replies and continue to send the commands one after the other. All the replies can be read at the end. </p> <p> For more information, see <a href="/docs/latest/develop/use/pipelining/"> Pipelining </a> . </p> <h2 id="inline-commands"> Inline commands </h2> <p> Sometimes you may need to send a command to the Redis server but only have <code> telnet </code> available. While the Redis protocol is simple to implement, it is not ideal for interactive sessions, and <code> redis-cli </code> may not always be available. For this reason, Redis also accepts commands in the <em> inline command </em> format. </p> <p> The following example demonstrates a server/client exchange using an inline command (the server chat starts with <code> S: </code> , the client chat with <code> C: </code> ): </p> <pre><code>C: PING S: +PONG </code></pre> <p> Here's another example of an inline command where the server returns an integer: </p> <pre><code>C: EXISTS somekey S: :0 </code></pre> <p> Basically, to issue an inline command, you write space-separated arguments in a telnet session. Since no command starts with <code> * </code> (the identifying byte of RESP Arrays), Redis detects this condition and parses your command inline. </p> <h2 id="high-performance-parser-for-the-redis-protocol"> High-performance parser for the Redis protocol </h2> <p> While the Redis protocol is human-readable and easy to implement, its implementation can exhibit performance similar to that of a binary protocol. </p> <p> RESP uses prefixed lengths to transfer bulk data. That makes scanning the payload for special characters unnecessary (unlike parsing JSON, for example). For the same reason, quoting and escaping the payload isn't needed. </p> <p> Reading the length of aggregate types (for example, bulk strings or arrays) can be processed with code that performs a single operation per character while at the same time scanning for the CR character. </p> <p> Example (in C): </p> <div class="highlight"> <pre class="chroma"><code class="language-c" data-lang="c"><span class="line"><span class="cl"><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp"> </span></span></span><span class="line"><span class="cl"><span class="cp"></span> </span></span><span class="line"><span class="cl"><span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">p</span> <span class="o">=</span> <span class="s">"$123</span><span class="se">\r\n</span><span class="s">"</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="kt">int</span> <span class="n">len</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">p</span><span class="o">++</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="k">while</span><span class="p">(</span><span class="o">*</span><span class="n">p</span> <span class="o">!=</span> <span class="sc">'\r'</span><span class="p">)</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">len</span> <span class="o">=</span> <span class="p">(</span><span class="n">len</span><span class="o">*</span><span class="mi">10</span><span class="p">)</span><span class="o">+</span><span class="p">(</span><span class="o">*</span><span class="n">p</span> <span class="o">-</span> <span class="sc">'0'</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="n">p</span><span class="o">++</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="cm">/* Now p points at '\r', and the length is in len. */</span> </span></span><span class="line"><span class="cl"> <span class="nf">printf</span><span class="p">(</span><span class="s">"%d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">len</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre> </div> <p> After the first CR is identified, it can be skipped along with the following LF without further processing. Then, the bulk data can be read with a single read operation that doesn't inspect the payload in any way. Finally, the remaining CR and LF characters are discarded without additional processing. </p> <p> While comparable in performance to a binary protocol, the Redis protocol is significantly more straightforward to implement in most high-level languages, reducing the number of bugs in client software. </p> <h2 id="tips-for-redis-client-authors"> Tips for Redis client authors </h2> <ul> <li> For testing purposes, use <a href="/docs/latest/develop/interact/programmability/lua-api#lua-to-resp3-type-conversion"> Lua's type conversions </a> to have Redis reply with any RESP2/RESP3 needed. As an example, a RESP3 double can be generated like so: <pre tabindex="0"><code>EVAL "return { double = tonumber(ARGV[1]) }" 0 1e0 </code></pre> </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/reference/protocol-spec/"/> <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.26.0/.html
<section class="prose w-full py-12"> <h1> RedisInsight v2.26.0, May 2023 </h1> <p class="text-lg -mt-5 mb-10"> RedisInsight v2.26 </p> <h2 id="226-may-2023"> 2.26 (May 2023) </h2> <p> This is the General Availability (GA) release of RedisInsight 2.26. </p> <h3 id="highlights"> Highlights </h3> <ul> <li> Introducing Insights (Beta): a new right-side panel that displays contextualised database recommendations for optimizing performance and memory usage. The list of recommendations gets updated as you interact with your database. Check out the paired-up tutorials to learn about the recommended feature and vote to provide feedback. This functionality is being rolled out gradually to the user base. </li> <li> Support for bulk data upload in custom tutorials: quickly upload sample datasets from your custom RedisInsight tutorials to share your Redis expertise with your team and the wider community. </li> </ul> <h3 id="details"> Details </h3> <p> <strong> Features and improvements </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/1847"> #1847 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1901"> #1901 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1957"> #1957 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/1972"> #1972 </a> Launching Insights (Beta): a new right-side panel that displays contextualised database recommendations for optimizing performance and memory usage. The list of recommendations gets updated in real-time as you interact with your database taking into account database configuration, user actions and accessed data. Consult the paired-up tutorials to learn more about the recommended feature. This functionality is being rolled out gradually to the user base in order to allow the RedisInsight team to learn and adjust the recommendations. Provide feedback directly in the app or the <a href="https://github.com/RedisInsight/RedisInsight/issues"> GitHub repository </a> . </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/2019"> #2019 </a> Quickly upload sample data sets in bulk from your custom RedisInsight tutorials to share your Redis expertise with your team and the wider community. Use a text file with the list of Redis commands and follow our simple <a href="https://github.com/RedisInsight/Tutorials"> instructions </a> to include example data sets in your custom RedisInsight tutorials </li> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/2010"> #2010 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/2012"> #2012 </a> , <a href="https://github.com/RedisInsight/RedisInsight/pull/2013"> #2013 </a> Optimized the logic when filtering per data type in Browser to avoid unnecessary <a href="https://redis.io/commands/type/"> TYPE </a> commands </li> </ul> <p> <strong> Bugs </strong> </p> <ul> <li> <a href="https://github.com/RedisInsight/RedisInsight/pull/2014"> #2014 </a> Display the actual command processing time in Workbench when results are grouped </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.26.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/develop/reference/key-specs/.html
<section class="prose w-full py-12"> <h1> Command key specifications </h1> <p class="text-lg -mt-5 mb-10"> What are command key specification and how to use them in your client </p> <p> Many of the commands in Redis accept key names as input arguments. The 9th element in the reply of <a href="/docs/latest/commands/command/"> <code> COMMAND </code> </a> (and <a href="/docs/latest/commands/command-info/"> <code> COMMAND INFO </code> </a> ) is an array that consists of the command's key specifications. </p> <p> A <em> key specification </em> describes a rule for extracting the names of one or more keys from the arguments of a given command. Key specifications provide a robust and flexible mechanism, compared to the <em> first key </em> , <em> last key </em> and <em> step </em> scheme employed until Redis 7.0. Before introducing these specifications, Redis clients had no trivial programmatic means to extract key names for all commands. </p> <p> Cluster-aware Redis clients had to have the keys' extraction logic hard-coded in the cases of commands such as <a href="/docs/latest/commands/eval/"> <code> EVAL </code> </a> and <a href="/docs/latest/commands/zunionstore/"> <code> ZUNIONSTORE </code> </a> that rely on a <em> numkeys </em> argument or <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> and its many clauses. Alternatively, the <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> can be used to achieve a similar extraction effect but at a higher latency. </p> <p> A Redis client isn't obligated to support key specifications. It can continue using the legacy <em> first key </em> , <em> last key </em> and <em> step </em> scheme along with the <a href="/docs/latest/commands/command/#flags"> <em> movablekeys </em> flag </a> that remain unchanged. </p> <p> However, a Redis client that implements key specifications support can consolidate most of its keys' extraction logic. Even if the client encounters an unfamiliar type of key specification, it can always revert to the <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> command. </p> <p> That said, most cluster-aware clients only require a single key name to perform correct command routing, so it is possible that although a command features one unfamiliar specification, its other specification may still be usable by the client. </p> <p> Key specifications are maps with the following keys: </p> <ol> <li> <strong> begin_search: </strong> : the starting index for keys' extraction. </li> <li> <strong> find_keys: </strong> the rule for identifying the keys relative to the BS. </li> <li> <strong> notes </strong> : notes about this key spec, if there are any. </li> <li> <strong> flags </strong> : indicate the type of data access. </li> </ol> <h2 id="begin_search"> begin_search </h2> <p> The <em> begin_search </em> value of a specification informs the client of the extraction's beginning. The value is a map. There are three types of <code> begin_search </code> : </p> <ol> <li> <strong> index: </strong> key name arguments begin at a constant index. </li> <li> <strong> keyword: </strong> key names start after a specific keyword (token). </li> <li> <strong> unknown: </strong> an unknown type of specification - see the <a href="#incomplete"> incomplete flag section </a> for more details. </li> </ol> <h3 id="index"> index </h3> <p> The <em> index </em> type of <code> begin_search </code> indicates that input keys appear at a constant index. It is a map under the <em> spec </em> key with a single key: </p> <ol> <li> <strong> index: </strong> the 0-based index from which the client should start extracting key names. </li> </ol> <h3 id="keyword"> keyword </h3> <p> The <em> keyword </em> type of <code> begin_search </code> means a literal token precedes key name arguments. It is a map under the <em> spec </em> with two keys: </p> <ol> <li> <strong> keyword: </strong> the keyword (token) that marks the beginning of key name arguments. </li> <li> <strong> startfrom: </strong> an index to the arguments array from which the client should begin searching. This can be a negative value, which means the search should start from the end of the arguments' array, in reverse order. For example, <em> -2 </em> 's meaning is to search reverse from the penultimate argument. </li> </ol> <p> More examples of the <em> keyword </em> search type include: </p> <ul> <li> <a href="/docs/latest/commands/set/"> <code> SET </code> </a> has a <code> begin_search </code> specification of type <em> index </em> with a value of <em> 1 </em> . </li> <li> <a href="/docs/latest/commands/xread/"> <code> XREAD </code> </a> has a <code> begin_search </code> specification of type <em> keyword </em> with the values <em> "STREAMS" </em> and <em> 1 </em> as <em> keyword </em> and <em> startfrom </em> , respectively. </li> <li> <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> has a <em> start_search </em> specification of type <em> keyword </em> with the values of <em> "KEYS" </em> and <em> -2 </em> . </li> </ul> <h2 id="find_keys"> find_keys </h2> <p> The <code> find_keys </code> value of a key specification tells the client how to continue the search for key names. <code> find_keys </code> has three possible types: </p> <ol> <li> <strong> range: </strong> keys stop at a specific index or relative to the last argument. </li> <li> <strong> keynum: </strong> an additional argument specifies the number of input keys. </li> <li> <strong> unknown: </strong> an unknown type of specification - see the <a href="#incomplete"> incomplete flag section </a> for more details. </li> </ol> <h3 id="range"> range </h3> <p> The <em> range </em> type of <code> find_keys </code> is a map under the <em> spec </em> key with three keys: </p> <ol> <li> <strong> lastkey: </strong> the index, relative to <code> begin_search </code> , of the last key argument. This can be a negative value, in which case it isn't relative. For example, <em> -1 </em> indicates to keep extracting keys until the last argument, <em> -2 </em> until one before the last, and so on. </li> <li> <strong> keystep: </strong> the number of arguments that should be skipped, after finding a key, to find the next one. </li> <li> <strong> limit: </strong> if <em> lastkey </em> is has the value of <em> -1 </em> , we use the <em> limit </em> to stop the search by a factor. <em> 0 </em> and <em> 1 </em> mean no limit. <em> 2 </em> means half of the remaining arguments, 3 means a third, and so on. </li> </ol> <h3 id="keynum"> keynum </h3> <p> The <em> keynum </em> type of <code> find_keys </code> is a map under the <em> spec </em> key with three keys: </p> <ul> <li> <strong> keynumidx: </strong> the index, relative to <code> begin_search </code> , of the argument containing the number of keys. </li> <li> <strong> firstkey: </strong> the index, relative to <code> begin_search </code> , of the first key. This is usually the next argument after <em> keynumidx </em> , and its value, in this case, is greater by one. </li> <li> <strong> keystep: </strong> Tthe number of arguments that should be skipped, after finding a key, to find the next one. </li> </ul> <p> Examples: </p> <ul> <li> The <a href="/docs/latest/commands/set/"> <code> SET </code> </a> command has a <em> range </em> of <em> 0 </em> , <em> 1 </em> and <em> 0 </em> . </li> <li> The <a href="/docs/latest/commands/mset/"> <code> MSET </code> </a> command has a <em> range </em> of <em> -1 </em> , <em> 2 </em> and <em> 0 </em> . </li> <li> The <a href="/docs/latest/commands/xread/"> <code> XREAD </code> </a> command has a <em> range </em> of <em> -1 </em> , <em> 1 </em> and <em> 2 </em> . </li> <li> The <a href="/docs/latest/commands/zunion/"> <code> ZUNION </code> </a> command has a <em> start_search </em> type <em> index </em> with the value <em> 1 </em> , and <code> find_keys </code> of type <em> keynum </em> with values of <em> 0 </em> , <em> 1 </em> and <em> 1 </em> . </li> <li> The <a href="https://oss.redislabs.com/redisai/master/commands/#aidagrun"> <code> AI.DAGRUN </code> </a> command has a <em> start_search </em> of type <em> keyword </em> with values of <em> "LOAD" </em> and <em> 1 </em> , and <code> find_keys </code> of type <em> keynum </em> with values of <em> 0 </em> , <em> 1 </em> and <em> 1 </em> . </li> </ul> <p> <strong> Note: </strong> this isn't a perfect solution as the module writers can come up with anything. However, this mechanism should allow the extraction of key name arguments for the vast majority of commands. </p> <h2 id="notes"> notes </h2> <p> Notes about non-obvious key specs considerations, if applicable. </p> <h2 id="flags"> flags </h2> <p> A key specification can have additional flags that provide more details about the key. These flags are divided into three groups, as described below. </p> <h3 id="access-type-flags"> Access type flags </h3> <p> The following flags declare the type of access the command uses to a key's value or its metadata. A key's metadata includes LRU/LFU counters, type, and cardinality. These flags do not relate to the reply sent back to the client. </p> <p> Every key specification has precisely one of the following flags: </p> <ul> <li> <strong> RW: </strong> the read-write flag. The command modifies the data stored in the value of the key or its metadata. This flag marks every operation that isn't distinctly a delete, an overwrite, or read-only. </li> <li> <strong> RO: </strong> the read-only flag. The command only reads the value of the key (although it doesn't necessarily return it). </li> <li> <strong> OW: </strong> the overwrite flag. The command overwrites the data stored in the value of the key. </li> <li> <strong> RM: </strong> the remove flag. The command deletes the key. </li> </ul> <h3 id="logical-operation-flags"> Logical operation flags </h3> <p> The following flags declare the type of operations performed on the data stored as the key's value and its TTL (if any), not the metadata. These flags describe the logical operation that the command executes on data, driven by the input arguments. The flags do not relate to modifying or returning metadata (such as a key's type, cardinality, or existence). </p> <p> Every key specification may include the following flag: </p> <ul> <li> <strong> access: </strong> the access flag. This flag indicates that the command returns, copies, or somehow uses the user's data that's stored in the key. </li> </ul> <p> In addition, the specification may include precisely one of the following: </p> <ul> <li> <strong> update: </strong> the update flag. The command updates the data stored in the key's value. The new value may depend on the old value. This flag marks every operation that isn't distinctly an insert or a delete. </li> <li> <strong> insert: </strong> the insert flag. The command only adds data to the value; existing data isn't modified or deleted. </li> <li> <strong> delete: </strong> the delete flag. The command explicitly deletes data from the value stored at the key. </li> </ul> <h3 id="miscellaneous-flags"> Miscellaneous flags </h3> <p> Key specifications may have the following flags: </p> <ul> <li> <strong> not_key: </strong> this flag indicates that the specified argument isn't a key. This argument is treated the same as a key when computing which slot a command should be assigned to for Redis cluster. For all other purposes this argument should not be considered a key. </li> <li> <strong> incomplete: </strong> this flag is explained below. </li> <li> <strong> variable_flags: </strong> this flag is explained below. </li> </ul> <h3 id="incomplete"> incomplete </h3> <p> Some commands feature exotic approaches when it comes to specifying their keys, which makes extraction difficult. Consider, for example, what would happen with a call to <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> that includes the literal string <em> "KEYS" </em> as an argument to its <em> AUTH </em> clause. Our key specifications would miss the mark, and extraction would begin at the wrong index. </p> <p> Thus, we recognize that key specifications are incomplete and may fail to extract all keys. However, we assure that even incomplete specifications never yield the wrong names of keys, providing that the command is syntactically correct. </p> <p> In the case of <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> , the search begins at the end ( <em> startfrom </em> has the value of <em> -1 </em> ). If and when we encounter a key named <em> "KEYS" </em> , we'll only extract the subset of the key name arguments after it. That's why <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> has the <em> incomplete </em> flag in its key specification. </p> <p> Another case of incompleteness is the <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> command. Here, the <code> begin_search </code> and <code> find_keys </code> are of type <em> unknown </em> . The client should revert to calling the <a href="/docs/latest/commands/command-getkeys/"> <code> COMMAND GETKEYS </code> </a> command to extract key names from the arguments, short of implementing it natively. The difficulty arises, for example, because the string <em> "STORE" </em> is both a keyword (token) and a valid literal argument for <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> . </p> <p> <strong> Note: </strong> the only commands with <em> incomplete </em> key specifications are <a href="/docs/latest/commands/sort/"> <code> SORT </code> </a> and <a href="/docs/latest/commands/migrate/"> <code> MIGRATE </code> </a> . We don't expect the addition of such commands in the future. </p> <h3 id="variable_flags"> variable_flags </h3> <p> In some commands, the flags for the same key name argument can depend on other arguments. For example, consider the <a href="/docs/latest/commands/set/"> <code> SET </code> </a> command and its optional <em> GET </em> argument. Without the <em> GET </em> argument, <a href="/docs/latest/commands/set/"> <code> SET </code> </a> is write-only, but it becomes a read and write command with it. When this flag is present, it means that the key specification flags cover all possible options, but the effective flags depend on other arguments. </p> <h2 id="examples"> Examples </h2> <h3 id="sethahahugoshortcode-s25-hbhbs-key-specifications"> <a href="/docs/latest/commands/set/"> <code> SET </code> </a> 's key specifications </h3> <pre tabindex="0"><code> 1) 1) "flags" 2) 1) RW 2) access 3) update 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 </code></pre> <h3 id="zunionhahahugoshortcode-s26-hbhbs-key-specifications"> <a href="/docs/latest/commands/zunion/"> <code> ZUNION </code> </a> 's key specifications </h3> <pre tabindex="0"><code> 1) 1) "flags" 2) 1) RO 2) access 3) "begin_search" 4) 1) "type" 2) "index" 3) "spec" 4) 1) "index" 2) (integer) 1 5) "find_keys" 6) 1) "type" 2) "keynum" 3) "spec" 4) 1) "keynumidx" 2) (integer) 0 3) "firstkey" 4) (integer) 1 5) "keystep" 6) (integer) 1 </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/reference/key-specs/"/> <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/pubsub/.html
<section class="prose w-full py-12"> <h1> Redis Pub/Sub </h1> <p class="text-lg -mt-5 mb-10"> How to use pub/sub channels in Redis </p> <p> <a href="/docs/latest/commands/subscribe/"> <code> SUBSCRIBE </code> </a> , <a href="/docs/latest/commands/unsubscribe/"> <code> UNSUBSCRIBE </code> </a> and <a href="/docs/latest/commands/publish/"> <code> PUBLISH </code> </a> implement the <a href="http://en.wikipedia.org/wiki/Publish/subscribe"> Publish/Subscribe messaging paradigm </a> where (citing Wikipedia) senders (publishers) are not programmed to send their messages to specific receivers (subscribers). Rather, published messages are characterized into channels, without knowledge of what (if any) subscribers there may be. Subscribers express interest in one or more channels and only receive messages that are of interest, without knowledge of what (if any) publishers there are. This decoupling of publishers and subscribers allows for greater scalability and a more dynamic network topology. </p> <p> For instance, to subscribe to channels "channel11" and "ch:00" the client issues a <a href="/docs/latest/commands/subscribe/"> <code> SUBSCRIBE </code> </a> providing the names of the channels: </p> <div class="highlight"> <pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">SUBSCRIBE channel11 ch:00 </span></span></code></pre> </div> <p> Messages sent by other clients to these channels will be pushed by Redis to all the subscribed clients. Subscribers receive the messages in the order that the messages are published. </p> <p> A client subscribed to one or more channels shouldn't issue commands, although it can <a href="/docs/latest/commands/subscribe/"> <code> SUBSCRIBE </code> </a> and <a href="/docs/latest/commands/unsubscribe/"> <code> UNSUBSCRIBE </code> </a> to and from other channels. The replies to subscription and unsubscribing operations are sent in the form of messages so that the client can just read a coherent stream of messages where the first element indicates the type of message. The commands that are allowed in the context of a subscribed RESP2 client are: </p> <ul> <li> <a href="/docs/latest/commands/ping/"> <code> PING </code> </a> </li> <li> <a href="/docs/latest/commands/psubscribe/"> <code> PSUBSCRIBE </code> </a> </li> <li> <a href="/docs/latest/commands/punsubscribe/"> <code> PUNSUBSCRIBE </code> </a> </li> <li> <a href="/docs/latest/commands/quit/"> <code> QUIT </code> </a> </li> <li> <a href="/docs/latest/commands/reset/"> <code> RESET </code> </a> </li> <li> <a href="/docs/latest/commands/ssubscribe/"> <code> SSUBSCRIBE </code> </a> </li> <li> <a href="/docs/latest/commands/subscribe/"> <code> SUBSCRIBE </code> </a> </li> <li> <a href="/docs/latest/commands/sunsubscribe/"> <code> SUNSUBSCRIBE </code> </a> </li> <li> <a href="/docs/latest/commands/unsubscribe/"> <code> UNSUBSCRIBE </code> </a> </li> </ul> <p> However, if RESP3 is used (see <a href="/docs/latest/commands/hello/"> <code> HELLO </code> </a> ), a client can issue any commands while in the subscribed state. </p> <p> Please note that when using <code> redis-cli </code> , in subscribed mode commands such as <a href="/docs/latest/commands/unsubscribe/"> <code> UNSUBSCRIBE </code> </a> and <a href="/docs/latest/commands/punsubscribe/"> <code> PUNSUBSCRIBE </code> </a> cannot be used because <code> redis-cli </code> will not accept any commands and can only quit the mode with <code> Ctrl-C </code> . </p> <h2 id="delivery-semantics"> Delivery semantics </h2> <p> Redis' Pub/Sub exhibits <em> at-most-once </em> message delivery semantics. As the name suggests, it means that a message will be delivered once if at all. Once the message is sent by the Redis server, there's no chance of it being sent again. If the subscriber is unable to handle the message (for example, due to an error or a network disconnect) the message is forever lost. </p> <p> If your application requires stronger delivery guarantees, you may want to learn about <a href="/docs/latest/develop/data-types/streams/"> Redis Streams </a> . Messages in streams are persisted, and support both <em> at-most-once </em> as well as <em> at-least-once </em> delivery semantics. </p> <h2 id="format-of-pushed-messages"> Format of pushed messages </h2> <p> A message is an <a href="/docs/latest/develop/reference/protocol-spec/#array-reply"> array-reply </a> with three elements. </p> <p> The first element is the kind of message: </p> <ul> <li> <p> <code> subscribe </code> : means that we successfully subscribed to the channel given as the second element in the reply. The third argument represents the number of channels we are currently subscribed to. </p> </li> <li> <p> <code> unsubscribe </code> : means that we successfully unsubscribed from the channel given as second element in the reply. The third argument represents the number of channels we are currently subscribed to. When the last argument is zero, we are no longer subscribed to any channel, and the client can issue any kind of Redis command as we are outside the Pub/Sub state. </p> </li> <li> <p> <code> message </code> : it is a message received as a result of a <a href="/docs/latest/commands/publish/"> <code> PUBLISH </code> </a> command issued by another client. The second element is the name of the originating channel, and the third argument is the actual message payload. </p> </li> </ul> <h2 id="database--scoping"> Database &amp; Scoping </h2> <p> Pub/Sub has no relation to the key space. It was made to not interfere with it on any level, including database numbers. </p> <p> Publishing on db 10, will be heard by a subscriber on db 1. </p> <p> If you need scoping of some kind, prefix the channels with the name of the environment (test, staging, production...). </p> <h2 id="wire-protocol-example"> Wire protocol example </h2> <pre tabindex="0"><code>SUBSCRIBE first second *3 $9 subscribe $5 first :1 *3 $9 subscribe $6 second :2 </code></pre> <p> At this point, from another client we issue a <a href="/docs/latest/commands/publish/"> <code> PUBLISH </code> </a> operation against the channel named <code> second </code> : </p> <pre tabindex="0"><code>&gt; PUBLISH second Hello </code></pre> <p> This is what the first client receives: </p> <pre tabindex="0"><code>*3 $7 message $6 second $5 Hello </code></pre> <p> Now the client unsubscribes itself from all the channels using the <a href="/docs/latest/commands/unsubscribe/"> <code> UNSUBSCRIBE </code> </a> command without additional arguments: </p> <pre tabindex="0"><code>UNSUBSCRIBE *3 $11 unsubscribe $6 second :1 *3 $11 unsubscribe $5 first :0 </code></pre> <h2 id="pattern-matching-subscriptions"> Pattern-matching subscriptions </h2> <p> The Redis Pub/Sub implementation supports pattern matching. Clients may subscribe to glob-style patterns to receive all the messages sent to channel names matching a given pattern. </p> <p> For instance: </p> <pre tabindex="0"><code>PSUBSCRIBE news.* </code></pre> <p> Will receive all the messages sent to the channel <code> news.art.figurative </code> , <code> news.music.jazz </code> , etc. All the glob-style patterns are valid, so multiple wildcards are supported. </p> <pre tabindex="0"><code>PUNSUBSCRIBE news.* </code></pre> <p> Will then unsubscribe the client from that pattern. No other subscriptions will be affected by this call. </p> <p> Messages received as a result of pattern matching are sent in a different format: </p> <ul> <li> The type of the message is <code> pmessage </code> : it is a message received as a result from a <a href="/docs/latest/commands/publish/"> <code> PUBLISH </code> </a> command issued by another client, matching a pattern-matching subscription. The second element is the original pattern matched, the third element is the name of the originating channel, and the last element is the actual message payload. </li> </ul> <p> Similarly to <a href="/docs/latest/commands/subscribe/"> <code> SUBSCRIBE </code> </a> and <a href="/docs/latest/commands/unsubscribe/"> <code> UNSUBSCRIBE </code> </a> , <a href="/docs/latest/commands/psubscribe/"> <code> PSUBSCRIBE </code> </a> and <a href="/docs/latest/commands/punsubscribe/"> <code> PUNSUBSCRIBE </code> </a> commands are acknowledged by the system sending a message of type <code> psubscribe </code> and <code> punsubscribe </code> using the same format as the <code> subscribe </code> and <code> unsubscribe </code> message format. </p> <h2 id="messages-matching-both-a-pattern-and-a-channel-subscription"> Messages matching both a pattern and a channel subscription </h2> <p> A client may receive a single message multiple times if it's subscribed to multiple patterns matching a published message, or if it is subscribed to both patterns and channels matching the message. This is shown by the following example: </p> <pre tabindex="0"><code>SUBSCRIBE foo PSUBSCRIBE f* </code></pre> <p> In the above example, if a message is sent to channel <code> foo </code> , the client will receive two messages: one of type <code> message </code> and one of type <code> pmessage </code> . </p> <h2 id="the-meaning-of-the-subscription-count-with-pattern-matching"> The meaning of the subscription count with pattern matching </h2> <p> In <code> subscribe </code> , <code> unsubscribe </code> , <code> psubscribe </code> and <code> punsubscribe </code> message types, the last argument is the count of subscriptions still active. This number is the total number of channels and patterns the client is still subscribed to. So the client will exit the Pub/Sub state only when this count drops to zero as a result of unsubscribing from all the channels and patterns. </p> <h2 id="sharded-pubsub"> Sharded Pub/Sub </h2> <p> From Redis 7.0, sharded Pub/Sub is introduced in which shard channels are assigned to slots by the same algorithm used to assign keys to slots. A shard message must be sent to a node that owns the slot the shard channel is hashed to. The cluster makes sure the published shard messages are forwarded to all nodes in the shard, so clients can subscribe to a shard channel by connecting to either the master responsible for the slot, or to any of its replicas. <a href="/docs/latest/commands/ssubscribe/"> <code> SSUBSCRIBE </code> </a> , <a href="/docs/latest/commands/sunsubscribe/"> <code> SUNSUBSCRIBE </code> </a> and <a href="/docs/latest/commands/spublish/"> <code> SPUBLISH </code> </a> are used to implement sharded Pub/Sub. </p> <p> Sharded Pub/Sub helps to scale the usage of Pub/Sub in cluster mode. It restricts the propagation of messages to be within the shard of a cluster. Hence, the amount of data passing through the cluster bus is limited in comparison to global Pub/Sub where each message propagates to each node in the cluster. This allows users to horizontally scale the Pub/Sub usage by adding more shards. </p> <h2 id="programming-example"> Programming example </h2> <p> Pieter Noordhuis provided a great example using EventMachine and Redis to create <a href="https://gist.github.com/pietern/348262"> a multi user high performance web chat </a> . </p> <h2 id="client-library-implementation-hints"> Client library implementation hints </h2> <p> Because all the messages received contain the original subscription causing the message delivery (the channel in the case of message type, and the original pattern in the case of pmessage type) client libraries may bind the original subscription to callbacks (that can be anonymous functions, blocks, function pointers), using a hash table. </p> <p> When a message is received an O(1) lookup can be done to deliver the message to the registered callback. </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/pubsub/"/> <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/logs-reports/.html
<section class="prose w-full py-12 max-w-none"> <h1> View logs and reports </h1> <p> Here, you learn how to use Redis Cloud logs and reports to track activity and usage statistics. </p> <nav> <a href="/docs/latest/operate/rc/logs-reports/system-logs/"> System logs </a> <p> You can view and export system logs to track any activity associated with your subscriptions and databases. </p> <a href="/docs/latest/operate/rc/logs-reports/usage-reports/"> Usage reports </a> <p> You can view usage reports to track the memory usage and shard usage of all your databases. </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/rc/logs-reports/"/> <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-6-2-4-august-2021/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise Software Release Notes 6.2.4 (August 2021) </h1> <p class="text-lg -mt-5 mb-10"> Internode encryption. Nginx replaced by envoy. New upgrade policies/behavior. </p> <p> <a href="https://redislabs.com/redis-enterprise-software/download-center/software/"> Redis Enterprise Software version 6.2.4 </a> is now available! </p> <p> This version offers: </p> <ul> <li> Encryption of all communications within cluster nodes </li> <li> Security enhancements </li> <li> Bug fixes </li> <li> Compatibility with the latest version of open source Redis 6.2.3 </li> </ul> <h2 id="version-changes"> Version changes </h2> <h3 id="prerequisites-and-notes"> Prerequisites and notes </h3> <p> You can <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/"> upgrade to v6.2.4 </a> from Redis Enterprise Software v6.0 and later. </p> <p> Keep the following in mind: </p> <ul> <li> <p> Upgrades from versions earlier than v6.0 are not supported </p> </li> <li> <p> The new internode encryption feature requires port 3342 to be open on all machines in the cluster. </p> </li> <li> <p> <a href="/docs/latest/operate/rs/release-notes/rs-6-0-20-april-2021/"> In v6.0.20 </a> , Redis Enterprise Software replaced Nginx with envoy to improve internal security and communication. As of v6.2.4, Nginx is no longer provided with Redis Enterprise Software. </p> </li> </ul> <h3 id="database-upgrade-default-changes"> Database upgrade default changes </h3> <p> The default behavior of the <code> upgrade db </code> command has changed. It is now controlled by a new cluster policy ( <code> redis_upgrade_policy </code> ), which defines the policy for creating new databases and upgrading existing databases. The policy supports the following values: </p> <ul> <li> <p> When set to <code> major </code> , the policy allows databases to be created or updated to versions of Redis compatible with open source Redis major releases. This allows for longer upgrade cycles by supporting Redis versions across multiple Redis Enterprise Software releases. </p> <p> This is the default value for Redis Enterprise Software. </p> </li> <li> <p> When set to <code> latest </code> , the policy creates new databases and upgrades existing ones to be compatible with the latest (most recent) version of open source Redis, which was the default behavior of earlier versions of Redis Enterprise Software. This is no longer the default behavior. </p> <p> Setting the upgrade policy to <code> latest </code> ensures that the most recent Redis features are available to new databases and ones that are upgraded. It also requires more frequent upgrades, as open source Redis is updated more frequently than Redis Enterprise Software. </p> </li> </ul> <p> The Redis Enterprise Software 6.2.4 package includes compatibility with the most recent major Redis release (v6.0) and the latest (most recent) update to Redis (v6.2.3). </p> <p> By default, compatibility with v6.0 will be installed. To change this, use <code> rladmin </code> to set the upgrade policy and the default Redis version: </p> <div class="highlight"> <pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">$ rladmin tune cluster redis_upgrade_policy latest </span></span><span class="line"><span class="cl">$ rladmin tune cluster default_redis_version 6.2 </span></span></code></pre> </div> <p> To learn more, see the <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/"> upgrade instructions </a> . </p> <h3 id="product-lifecycle-updates"> Product lifecycle updates </h3> <p> Redis Enterprise Software v5.6.0 will reach end of life (EOF) on October 31, 2021. </p> <p> To learn more, see the Redis Enterprise Software <a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/"> product lifecycle </a> , which details the release number and the end-of-life schedule for Redis Enterprise Software. </p> <p> Redis Enterprise modules have individual release numbers <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/modules-lifecycle/"> and lifecycles </a> . </p> <h3 id="deprecation-notices"> Deprecation notices </h3> <ul> <li> <p> <a href="/docs/latest/operate/rs/release-notes/rs-6-0-20-april-2021/"> In v6.0.20 </a> , the SASL-based LDAP mechanism was deprecated in favor of a new <a href="/docs/latest/operate/rs/security/access-control/ldap/"> RBAC-based approach </a> . As of v6.2.12, support for the older mechanism has been removed. </p> <p> For help migrating to the LDAP-based mechanism, see <a href="/docs/latest/operate/rs/security/access-control/ldap/migrate-to-role-based-ldap/"> Migrate to role-based LDAP </a> . </p> </li> <li> <p> <a href="https://wiki.openstack.org/wiki/Swift"> OpenStack Object Storage </a> ("Swift") has reached end-of-life. Consequently, you can no longer use ObjectStack Swift as a target for database backup or export operations. </p> </li> </ul> <h2 id="features-and-enhancements"> Features and enhancements </h2> <h3 id="internode-encryption"> Internode encryption </h3> <p> Internode encryption (INE) encrypts all communication between nodes in a cluster; it is available for the control plane and the data plane. </p> <h4 id="control-plane-internode-encryption"> Control plane internode encryption </h4> <p> Control plane internode encryption encrypts all management communication within a cluster. It is enabled by default for all new clusters and upgraded clusters. </p> <h4 id="data-plane-internode-encryption"> Data plane internode encryption </h4> <p> Data plane internode encryption encrypts communication between nodes within a cluster, such as database replication between nodes. </p> <p> Data plane internode encryption is available for new or fully upgraded clusters. It is not enabled by default. </p> <p> You can enable data plane internode encryption by: </p> <ul> <li> <p> Setting the cluster policy to enable data plane internode encryption by default for new databases </p> <div class="highlight"> <pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">rladmin tune cluster data_internode_encryption enabled </span></span></code></pre> </div> </li> <li> <p> Enabling it for individual existing databases </p> <div class="highlight"> <pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">rladmin tune db &lt;db:id <span class="p">|</span> name&gt; data_internode_encryption enabled </span></span></code></pre> </div> </li> </ul> <h3 id="internal-certificate-management"> Internal certificate management </h3> <p> Internode encryption relies on internal certificates signed by a unique, private CA certificate created for your deployment. The private CA generates and signs leaf certificates for internode encryption only. It's generated when you install or upgrade to Redis Enterprise 6.2.4. It's used only within the cluster and is not exposed outside of the cluster. </p> <p> The leaf certificates expire regularly; they're automatically rotated before expiration and alerts are issued as needed. </p> <h3 id="open-source-redis-compatibility"> Open source Redis compatibility </h3> <p> <a href="https://raw.githubusercontent.com/redis/redis/6.2/00-RELEASENOTES"> Redis 6.2 </a> introduced new commands, feature improvements, and security fixes; it addresses many customer requests. </p> <p> Redis Enterprise Software supports all new commands, except <a href="/docs/latest/commands/reset/"> RESET </a> and [FAILOVER](/docs/latest/commands/failover/. (Redis Enterprise takes a different approach to connectivity; it also separates control plane operations from data plane operations.) </p> <p> To learn more, see Redis Enterprise Software <a href="/docs/latest/operate/rs/references/compatibility/"> compatibility with open source </a> . </p> <h3 id="redis-modules"> Redis modules </h3> <p> Redis Enterprise Software v6.2.4 includes the following Redis modules: </p> <ul> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.0-release-notes/"> RediSearch v2.0.11 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-1.0-release-notes/"> RedisJSON v1.0.8 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.2-release-notes/"> RedisBloom v2.2.6 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.4-release-notes/"> RedisGraph v2.4.7 </a> </li> <li> <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.4-release-notes/"> RedisTimeSeries v1.4.10 </a> </li> </ul> <h3 id="internode-encryption-for-modules"> Internode encryption for modules </h3> <p> To utilize data plane encryption for existing databases with modules, update the module to the latest version prior to enabling data plane encryption. </p> <p> For help, see <a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/"> Upgrade the module for a database </a> . </p> <h3 id="module-related-enhancements"> Module-related enhancements </h3> <p> Added the capability to update current module arguments for an existing database. In earlier versions, you could do this only when upgrading a module. To learn more, see <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/upgrade/"> <code> rladmin upgrade </code> </a> . </p> <h2 id="resolved-issues"> Resolved issues </h2> <ul> <li> <p> RS39954 - Changed the UI status indication for the <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/upgrade/"> default user </a> from <code> Active/Inactive </code> to <code> Enabled/Disabled </code> </p> </li> <li> <p> RS42626 - Increased the max length for modules commands from 23 characters to 64 characters </p> </li> <li> <p> RS54732 - Fixed incorrect reporting of number database connections, which caused the number of connections to be reported as a 20 digit number </p> </li> <li> <p> RS52265 - Fixed excessive log lines reporting when an Active-Active database is on featureset <code> 0 </code> . <a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-active-active/"> Upgrade the featureset </a> version to the latest. </p> </li> <li> <p> RS56122 - Fixed a bug that was causing AOF files to grow when the replicas of two Active-Active databases became disconnected during full synchronization </p> </li> <li> <p> RS58184 - Fixed a bug when trying to create an Active-Active database with expired syncer certificates; participating clusters were creating replicas even though the create operation failed. </p> </li> <li> <p> RS48988 - Add the username description in the log upon an unauthorized REST API request </p> </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <h3 id="installation-limitations"> Installation limitations </h3> <p> Several Redis Enterprise Software installation reference files are installed to the directory <code> /etc/opt/redislabs/ </code> even if you use <a href="/docs/latest/operate/rs/installing-upgrading/install/customize-install-directories/"> custom installation directories </a> . </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> <h2 id="known-issues"> Known issues </h2> <ul> <li> <p> A new command was added as part of Redis 6.2: <a href="/docs/latest/commands/xautoclaim/"> <code> XAUTOCLAIM </code> </a> . When used in an Active-Active configuration, this command may cause Redis shards to crash, potentially resulting in data loss. The issue is fixed in Redis Enterprise Software version 6.2.12. Additionally, we recommend enabling AOF persistence for all Active-Active configurations. </p> </li> <li> <p> The <code> ZRANGESTORE </code> command, with a special <code> zset-max-ziplist-entries </code> configuration can crash Redis 6.2. See <a href="https://github.com/redis/redis/pull/10767"> Redis repository 10767 </a> for more details. </p> </li> <li> <p> RS81463 - A shard may crash when resharding an Active-Active database with Auto Tiering . Specifically, the shard will crash when volatile keys or Active-Active tombstone keys reside in Flash memory. </p> </li> <li> <p> RS40641 - API requests are redirected to an internal IP in case the request arrives from a node which is not the master. To avoid this issue, use <a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/config/"> <code> rladmin cluster config </code> </a> to configure <code> handle_redirects </code> or <code> handle_metrics_redirects </code> . </p> </li> </ul> <h2 id="security"> Security </h2> <ul> <li> <p> The following <a href="https://github.com/redis/redis"> Open Source Redis </a> <a href="https://github.com/redis/redis/security/advisories"> CVE's </a> do not affect Redis Enterprise: </p> <ul> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32625"> CVE-2021-32625 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis since Redis Enterprise does not implement <code> LCS </code> . Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.4, Redis 6.0.14) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32672"> CVE-2021-32672 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the LUA debugger is unsupported in Redis Enterprise. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32675"> CVE-2021-32675 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the proxy in Redis Enterprise does not forward unauthenticated requests. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32762"> CVE-2021-32762 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the memory allocator used in Redis Enterprise is not vulnerable. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) </p> </li> <li> <p> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41099"> CVE-2021-41099 </a> - Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the proto-max-bulk-len CONFIG is blocked in Redis Enterprise. Additional information about the open source Redis fix is on <a href="https://github.com/redis/redis/releases"> the Redis GitHub page </a> (Redis 6.2.6, Redis 6.0.16) </p> </li> </ul> </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-6-2-4-august-2021/"/> <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/node/external-addr/.html
<section class="prose w-full py-12 max-w-none"> <h1> rladmin node external_addr </h1> <p class="text-lg -mt-5 mb-10"> Configures a node's external IP addresses. </p> <p> Configures a node's external IP addresses. </p> <h2 id="node-external_addr-add"> <code> node external_addr add </code> </h2> <p> Adds an external IP address that accepts inbound user connections for the node. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; external_addr </span></span><span class="line"><span class="cl"> add &lt;IP address&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> node </td> <td> integer </td> <td> Adds an external IP address for the specified node </td> </tr> <tr> <td> IP address </td> <td> IP address </td> <td> External IP address of the node </td> </tr> </tbody> </table> <h3 id="returns"> Returns </h3> <p> Returns <code> Updated successfully </code> if the IP address was added. Otherwise, it returns an error. </p> <p> Use <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/#status-nodes"> <code> rladmin status nodes </code> </a> to verify the external IP address was added. </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 node <span class="m">1</span> external_addr add 198.51.100.1 </span></span><span class="line"><span class="cl">Updated successfully. </span></span><span class="line"><span class="cl">$ rladmin status nodes </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 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 fc7a3d332458 0/100 <span class="m">6</span> 14.75GB/19.54GB 11.24GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK </span></span></code></pre> </div> <h2 id="node-external_addr-set"> <code> node external_addr set </code> </h2> <p> Sets one or more external IP addresses that accepts inbound user connections for the node. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; external_addr </span></span><span class="line"><span class="cl"> <span class="nb">set</span> &lt;IP address 1&gt; ... &lt;IP address N&gt; </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> node </td> <td> integer </td> <td> Sets external IP addresses for the specified node </td> </tr> <tr> <td> IP address </td> <td> list of IP addresses </td> <td> Sets specified IP addresses as external addresses </td> </tr> </tbody> </table> <h3 id="returns-1"> Returns </h3> <p> Returns <code> Updated successfully </code> if the IP addresses were set. Otherwise, it returns an error. </p> <p> Use <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/#status-nodes"> <code> rladmin status nodes </code> </a> to verify the external IP address was set. </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 node <span class="m">2</span> external_addr <span class="nb">set</span> 198.51.100.2 198.51.100.3 </span></span><span class="line"><span class="cl">Updated successfully. </span></span><span class="line"><span class="cl">$ rladmin status nodes </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 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 198.51.100.2,198.51.100.3 fc7a3d332458 0/100 <span class="m">6</span> 14.75GB/19.54GB 11.23GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK </span></span></code></pre> </div> <h2 id="node-external_addr-remove"> <code> node external_addr remove </code> </h2> <p> Removes the specified external IP address from the node. </p> <div class="highlight"> <pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node &lt;ID&gt; external_addr </span></span><span class="line"><span class="cl"> remove &lt;IP address&gt; </span></span></code></pre> </div> <h3 id="parameters-2"> Parameters </h3> <table> <thead> <tr> <th> Parameter </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> node </td> <td> integer </td> <td> Removes an external IP address for the specified node </td> </tr> <tr> <td> IP address </td> <td> IP address </td> <td> Removes the specified IP address of the node </td> </tr> </tbody> </table> <h3 id="returns-2"> Returns </h3> <p> Returns <code> Updated successfully </code> if the IP address was removed. Otherwise, it returns an error. </p> <p> Use <a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/#status-nodes"> <code> rladmin status nodes </code> </a> to verify the external IP address was removed. </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 nodes </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 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 198.51.100.2,198.51.100.3 fc7a3d332458 0/100 <span class="m">6</span> 14.75GB/19.54GB 11.23GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">$ rladmin node <span class="m">2</span> external_addr remove 198.51.100.3 </span></span><span class="line"><span class="cl">Updated successfully. </span></span><span class="line"><span class="cl">$ rladmin status nodes </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 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.74GB/19.54GB 11.14GB/16.02GB 6.2.12-37 OK </span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 198.51.100.2 fc7a3d332458 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:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.74GB/19.54GB 11.14GB/16.02GB 6.2.12-37 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/node/external-addr/"/> <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/debuginfo/.html
<section class="prose w-full py-12 max-w-none"> <h1> Database debug info requests </h1> <p class="text-lg -mt-5 mb-10"> Documents the Redis Enterprise Software REST API /bdbs/debuginfo requests. </p> <table> <thead> <tr> <th> Method </th> <th> Path </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <a href="#get-all-debuginfo-bdb"> GET </a> </td> <td> <code> /v1/bdbs/debuginfo </code> </td> <td> Get debug info from all databases </td> </tr> <tr> <td> <a href="#get-debuginfo-bdb"> GET </a> </td> <td> <code> /v1/bdbs/{bdb_uid}/debuginfo </code> </td> <td> Get debug info from a specific database </td> </tr> </tbody> </table> <h2 id="get-all-debuginfo-bdb"> Get debug info from all databases </h2> <pre><code>GET /v1/bdbs/debuginfo </code></pre> <p> Downloads a tar file that contains debug info from all databases. </p> <h4 id="required-permissions"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_debugging_info"> view_debugging_info </a> </td> </tr> </tbody> </table> <h3 id="get-all-request"> Request </h3> <h4 id="example-http-request"> Example HTTP request </h4> <pre><code>GET /bdbs/debuginfo </code></pre> <h3 id="get-all-response"> Response </h3> <p> Downloads the debug info in a tar file called <code> filename.tar.gz </code> . Extract the files from the tar file to access the debug info. </p> <h4 id="response-headers"> Response headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Content-Type </td> <td> application/x-gzip </td> <td> Media type of request/response body </td> </tr> <tr> <td> Content-Length </td> <td> 653350 </td> <td> Length of the response body in octets </td> </tr> <tr> <td> Content-Disposition </td> <td> attachment; filename=debuginfo.tar.gz </td> <td> Display response in browser </td> </tr> </tbody> </table> <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> Success. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> Failed to get debug info. </td> </tr> </tbody> </table> <h2 id="get-debuginfo-bdb"> Get database debug info </h2> <pre><code>GET /v1/bdbs/{int: bdb_uid}/debuginfo </code></pre> <p> Downloads a tar file that contains debug info from the database specified by <code> bdb_uid </code> . </p> <h4 id="required-permissions-1"> Required permissions </h4> <table> <thead> <tr> <th> Permission name </th> </tr> </thead> <tbody> <tr> <td> <a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_debugging_info"> view_debugging_info </a> </td> </tr> </tbody> </table> <h3 id="get-request"> Request </h3> <h4 id="example-http-request-1"> Example HTTP request </h4> <pre><code>GET /bdbs/1/debuginfo </code></pre> <h3 id="get-response"> Response </h3> <p> Downloads the debug info in a tar file called <code> filename.tar.gz </code> . Extract the files from the tar file to access the debug info. </p> <h4 id="response-headers-1"> Response headers </h4> <table> <thead> <tr> <th> Key </th> <th> Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> Content-Type </td> <td> application/x-gzip </td> <td> Media type of request/response body </td> </tr> <tr> <td> Content-Length </td> <td> 653350 </td> <td> Length of the response body in octets </td> </tr> <tr> <td> Content-Disposition </td> <td> attachment; filename=debuginfo.tar.gz </td> <td> Display response in browser </td> </tr> </tbody> </table> <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> Success. </td> </tr> <tr> <td> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"> 500 Internal Server Error </a> </td> <td> Failed to get debug info. </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/debuginfo/"/> <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/search-and-query/query/range/.html
<section class="prose w-full py-12"> <h1> Range queries </h1> <p class="text-lg -mt-5 mb-10"> Perform numeric range queries </p> <p> A range query on a numeric field returns the values that are in between a given start and end value: </p> <pre tabindex="0"><code>FT.SEARCH index "@field:[start end]" </code></pre> <p> You can also use the <code> FILTER </code> argument, but you need to know that the query execution plan is different because the filter is applied after the query string (e.g., <code> * </code> ) is evaluated: </p> <pre tabindex="0"><code>FT.SEARCH index "*" FILTER field start end </code></pre> <h2 id="start-and-end-values"> Start and end values </h2> <p> Start and end values are by default inclusive, but you can prepend <code> ( </code> to a value to exclude it from the range. </p> <p> The values <code> -inf </code> , <code> inf </code> , and <code> +inf </code> are valid values that allow you to define open ranges. </p> <h2 id="result-set"> Result set </h2> <p> An open-range query can lead to a large result set. </p> <p> By default, <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> returns only the first ten results. The <code> LIMIT </code> argument helps you to scroll through the result set. The <code> SORTBY </code> argument ensures that the documents in the result set are returned in the specified order. </p> <pre tabindex="0"><code>FT.SEARCH index "@field:[start end]" SORTBY field LIMIT page_start page_end </code></pre> <p> You can find further details about using the <code> LIMIT </code> and <code> SORTBY </code> in the [ <a href="/docs/latest/commands/ft.search/"> <code> FT.SEARCH </code> </a> command reference](/commands/ft.search/). </p> <h2 id="examples"> Examples </h2> <p> The examples in this section use a schema with the following fields: </p> <table> <thead> <tr> <th> Field name </th> <th> Field type </th> </tr> </thead> <tbody> <tr> <td> <code> price </code> </td> <td> <code> NUMERIC </code> </td> </tr> </tbody> </table> <p> The following query finds bicycles within a price range greater than or equal to 500 USD and smaller than or equal to 1000 USD ( <code> 500 &lt;= price &lt;= 1000 </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="query_range-steprange1"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_range-steprange1" name="query_range-steprange1" 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_query_range-steprange1" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-query_range-steprange1" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_range-steprange1" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; FT.SEARCH idx:bicycle "@price:[500 1000]" </span></span><span class="line hl"><span class="cl">1) (integer) 3 </span></span><span class="line hl"><span class="cl">2) "bicycle:2" </span></span><span class="line hl"><span class="cl">3) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, -87.6848 41.8231, -87.6848 41.9331))\",\"store_location\":\"-87.6298,41.8781\",\"brand\":\"Nord\",\"model\":\"Chook air 5\",\"price\":815,\"description\":\"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.\",\"condition\":\"used\"}" </span></span><span class="line hl"><span class="cl">4) "bicycle:5" </span></span><span class="line hl"><span class="cl">5) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, -0.1778 51.4024, -0.1778 51.5524))\",\"store_location\":\"-0.1278,51.5074\",\"brand\":\"Breakout\",\"model\":\"XBN 2.1 Alloy\",\"price\":810,\"description\":\"The XBN 2.1 Alloy is our entry-level road bike \xe2\x80\x93 but that\xe2\x80\x99s not to say that it\xe2\x80\x99s a basic machine. With an internal weld aluminium frame, a full carbon fork, and the slick-shifting Claris gears from Shimano\xe2\x80\x99s, this is a bike which doesn\xe2\x80\x99t break the bank and delivers craved performance.\",\"condition\":\"new\"}" </span></span><span class="line hl"><span class="cl">6) "bicycle:9" </span></span><span class="line hl"><span class="cl">7) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((12.4464 42.1028, 12.5464 42.1028, 12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\",\"store_location\":\"12.4964,41.9028\",\"model\":\"ThrillCycle\",\"brand\":\"BikeShind\",\"price\":815,\"description\":\"An artsy, retro-inspired bicycle that\xe2\x80\x99s as functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn\xe2\x80\x99t suggest taking it to the mountains. Fenders protect you from mud, and a rear basket lets you transport groceries, flowers and books. The ThrillCycle comes with a limited lifetime warranty, so this little guy will last you long past graduation.\",\"condition\":\"refurbished\"}"</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_query_range-steprange1')" 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_query_range-steprange1" name="query_range-steprange1" 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_query_range-steprange1" title="Open example"> Python </label> <div aria-labelledby="tab-query_range-steprange1" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_query_range-steprange1" 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="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</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.json.path</span> <span class="kn">import</span> <span class="n">Path</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="n">TextField</span><span class="p">,</span> <span class="n">NumericField</span><span class="p">,</span> <span class="n">TagField</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">NumericFilter</span><span class="p">,</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</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">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="c1"># create index</span> </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">"$.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">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">"$.condition"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"condition"</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">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><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">"bicycle:"</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="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data</span> </span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_em.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</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">r</span><span class="o">.</span><span class="n">pipeline</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</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="sa">f</span><span class="s1">'bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s1">'</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</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></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</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="s2">"@price:[500 1000]"</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</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">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="mi">500</span><span class="p">,</span> <span class="mi">1000</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</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">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="s2">"(1000"</span><span class="p">,</span> <span class="s2">"+inf"</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 5</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="s1">'@price:[-inf 2000]'</span><span class="p">)</span><span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s1">'price'</span><span class="p">)</span><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">5</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</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">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{7 total, docs: [Document {'id': 'bicycle:0', ... }, Document {'id': 'bicycle:7', ... }, Document {'id': 'bicycle:5', ... }, ...]</span> </span></span><span class="line"><span class="cl"> </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_query_range-steprange1')" 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_query_range-steprange1" 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/query_range.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> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_query_range-steprange1" name="query_range-steprange1" 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="Nodejs_query_range-steprange1" title="Open example"> Node.js </label> <div aria-labelledby="tab-query_range-steprange1" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_range-steprange1" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span><span class="p">,</span> <span class="nx">SchemaFieldTypes</span><span class="p">,</span> <span class="nx">AggregateGroupByReducers</span><span class="p">,</span> <span class="nx">AggregateSteps</span><span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1">// create index </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.description'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'description'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.price'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">NUMERIC</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'price'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.condition'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TAG</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'condition'</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="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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">// load data </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_em.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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 hl"><span class="cl"><span class="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'@price:[500 1000]'</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 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">// FILTER is not supported </span></span></span><span class="line"><span class="cl"><span class="c1">// const res2 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line"><span class="cl"><span class="c1">// min: 500, </span></span></span><span class="line"><span class="cl"><span class="c1">// max: 1000, </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">// console.log(res2.total); // &gt;&gt;&gt; 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">// FILTER is not supported </span></span></span><span class="line"><span class="cl"><span class="c1">// const res3 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line"><span class="cl"><span class="c1">// min: '(1000', </span></span></span><span class="line"><span class="cl"><span class="c1">// max: '+inf, </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">// console.log(res3.total); // &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s1">'idx:bicycle'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s1">'@price:[-inf 2000]'</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="nx">SORTBY</span><span class="o">:</span> <span class="s1">'price'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">LIMIT</span><span class="o">:</span> <span class="p">{</span> <span class="nx">from</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">size</span><span class="o">:</span> <span class="mi">5</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">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; { total: 7, documents: [ { id: 'bicycle:0', value: [Object: null prototype] }, { id: 'bicycle:7', value: [Object: null prototype] }, { id: 'bicycle:5', value: [Object: null prototype] }, { id: 'bicycle:2', value: [Object: null prototype] }, { id: 'bicycle:9', value: [Object: null prototype] } ] } </span></span></span><span class="line"><span class="cl"><span class="c1"></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_Nodejs_query_range-steprange1')" 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_Nodejs_query_range-steprange1" 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/nodejs/" tabindex="1" title="Quick-Start"> Node.js 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/node-redis/tree/emb-examples/doctests/query-range.js" 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> <input class="radiotab w-0 h-0" data-lang="java" id="Java_query_range-steprange1" name="query_range-steprange1" 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="Java_query_range-steprange1" title="Open example"> Java </label> <div aria-labelledby="tab-query_range-steprange1" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_query_range-steprange1" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</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">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.JedisDataException</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.json.Path2</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.args.SortingOrder</span><span class="o">;</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="kd">public</span> <span class="kd">class</span> <span class="nc">QueryRangeExample</span> <span class="o">{</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="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</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">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</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></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">bicycleJsons</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-74.0610 40.6678, -74.0610 40.7578))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-74.0060,40.7128\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Velorim\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Jigger\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 270,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"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="o">+</span> <span class="s">"This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"is the vehicle of choice for the rare tenacious little rider raring to go.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-118.2887 33.9872, -118.2887 34.0972))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-118.2437,34.0522\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Bicyk\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Hillcraft\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Kids want to ride with as little weight as possible. Especially "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"off a 24'' bike. The Hillcraft 26 is just the solution they need!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-87.6848 41.8231, -87.6848 41.9331))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-87.6298,41.8781\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Nord\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Chook air 5\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The Chook Air 5 gives kids aged six years and older a durable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and uberlight mountain bike for their first experience on tracks and easy cruising through "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"forests and fields. The lower top tube makes it easy to mount and dismount in any "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"situation, giving your kids greater safety on the trails.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-80.2433 25.6967, -80.2433 25.8067))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-80.1918,25.7617\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Eva\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Eva 291\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3400,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The sister company to Nord, Eva launched in 2005 as the first "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"are optimized for the feminine physique using analytics from a body metrics database. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"full-suspension, cross-country ride has been designed for velocity. The 291 has "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"100mm of front and rear travel, a superlight aluminum frame and fast-rolling "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"29-inch wheels. Yippee!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-122.4644 37.7099, -122.4644 37.8199))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-122.4194,37.7749\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Noka Bikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Kahuna\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Whether you want to try your hand at XC racing or are looking "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"for a lively trail bike that's just as inspiring on the climbs as it is over rougher "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ground, the Wilder is one heck of a bike built specifically for short women. Both the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"frames and components have been tweaked to include a women’s saddle, different bars "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and unique colourway.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-0.1778 51.4024, -0.1778 51.5524))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-0.1278,51.5074\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Breakout\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"XBN 2.1 Alloy\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 810,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The XBN 2.1 Alloy is our entry-level road bike – but that’s "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"not to say that it’s a basic machine. With an internal weld aluminium frame, a full "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"doesn’t break the bank and delivers craved performance.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"2.1767 48.5516, 2.1767 48.9016))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.3522,48.8566\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"ScramBikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"WattBike\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 2300,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The WattBike is the best e-bike for people who still "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"charge. It’s great for tackling hilly terrain or if you just fancy a more "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"leisurely ride. With three working modes, you can choose between E-bike, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"assisted bicycle, and normal bike modes.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"13.3260 52.2700, 13.3260 52.5700))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"13.4050,52.5200\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Peaknetic\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Secto\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 430,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"If you struggle with stiff fingers or a kinked neck or "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"back after a few minutes on the road, this lightweight, aluminum bike alleviates "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"those issues and allows you to enjoy the ride. From the ergonomic grips to the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The rear-inclined seat tube facilitates stability by allowing you to put a foot "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on the ground to balance at a stop, and the low step-over frame makes it "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"accessible for all ability and mobility levels. The saddle is very soft, with "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"a wide back to support your hip joints and a cutout in the center to redistribute "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"facilitate setting up the Roll Low-Entry as your preferred commuter, and the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"1.9450 41.1987, 1.9450 41.4301))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.1734, 41.3851\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"nHill\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Summit\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"This budget mountain bike from nHill performs well both "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on bike paths and on the trail. The fork with 100mm of travel absorbs rough "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The Shimano Tourney drivetrain offered enough gears for finding a comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Whether you want an affordable bike that you can take to work, but also take "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"trail in mountains on the weekends or you’re just after a stable, comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ride for the bike path, the Summit gives a good value for money.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((12.4464 42.1028, 12.5464 42.1028, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"12.4964,41.9028\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"ThrillCycle\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"BikeShind\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"An artsy, retro-inspired bicycle that’s as "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"suggest taking it to the mountains. Fenders protect you from mud, and a rear "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"basket lets you transport groceries, flowers and books. The ThrillCycle comes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"with a limited lifetime warranty, so this little guy will last you long "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"past graduation.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"refurbished\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycleJsons</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSet</span><span class="o">(</span><span class="s">"bicycle:"</span> <span class="o">+</span> <span class="n">i</span><span class="o">,</span> <span class="n">Path2</span><span class="o">.</span><span class="na">ROOT_PATH</span><span class="o">,</span> <span class="n">bicycleJsons</span><span class="o">[</span><span class="n">i</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></span><span class="line"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="s">"@price:[500 1000]"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">().</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 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="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs1</span> <span class="o">=</span> <span class="n">res1</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs1</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step. </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">SearchResult</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">500</span><span class="o">,</span> <span class="mi">1000</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs2</span> <span class="o">=</span> <span class="n">res2</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs2</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step. </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">SearchResult</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">1000</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="n">Double</span><span class="o">.</span><span class="na">POSITIVE_INFINITY</span><span class="o">,</span> <span class="kc">false</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs3</span> <span class="o">=</span> <span class="n">res3</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs3</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:1 : price 1200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:4 : price 3200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:6 : price 2300 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:3 : price 3400 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:8 : price 1200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step. </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">SearchResult</span> <span class="n">res4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@price:[-inf 2000]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">sortBy</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="n">SortingOrder</span><span class="o">.</span><span class="na">ASC</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">limit</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">5</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res4</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs4</span> <span class="o">=</span> <span class="n">res4</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs4</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:0 : price 270 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:7 : price 430 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</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></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_Java_query_range-steprange1')" 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_Java_query_range-steprange1" 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/java/jedis/" tabindex="1" title="Quick-Start"> Java 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/jedis/tree/master/src/test/java/io/redis/examples/QueryRangeExample.java" 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> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_query_range-steprange1" name="query_range-steprange1" 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="Csharp_query_range-steprange1" title="Open example"> C# </label> <div aria-labelledby="tab-query_range-steprange1" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_query_range-steprange1" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.RedisStackCommands</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search.Literals.Enums</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</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="k">public</span> <span class="k">class</span> <span class="nc">QueryRangeExample</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="k">public</span> <span class="k">void</span> <span class="n">run</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="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Schema</span> <span class="n">bikeSchema</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Schema</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTextField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.description"</span><span class="p">,</span> <span class="s">"description"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddNumericField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.price"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTagField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.condition"</span><span class="p">,</span> <span class="s">"condition"</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span> <span class="n">bikeParams</span> <span class="p">=</span> <span class="k">new</span> <span class="n">FTCreateParams</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddPrefix</span><span class="p">(</span><span class="s">"bicycle:"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">On</span><span class="p">(</span><span class="n">IndexDataType</span><span class="p">.</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">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Create</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">bikeParams</span><span class="p">,</span> <span class="n">bikeSchema</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">bicycles</span> <span class="p">=</span> <span class="k">new</span> <span class="kt">object</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Velorim"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Jigger"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">270</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Small and powerful, the Jigger is the best ride "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"for the smallest of tikes! This is the tiniest "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"kids’ pedal bike on the market available without"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a coaster brake, the Jigger is the vehicle of "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"choice for the rare tenacious little rider "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"raring to go."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Bicyk"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Hillcraft"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Kids want to ride with as little weight as possible."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Especially on an incline! They may be at the age "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"when a 27.5 inch wheel bike is just too clumsy coming "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"off a 24 inch bike. The Hillcraft 26 is just the solution"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" they need!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Nord"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Chook air 5"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The Chook Air 5 gives kids aged six years and older "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"a durable and uberlight mountain bike for their first"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" experience on tracks and easy cruising through forests"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and fields. The lower top tube makes it easy to mount"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and dismount in any situation, giving your kids greater"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" safety on the trails."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Eva"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Eva 291"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3400</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The sister company to Nord, Eva launched in 2005 as the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" first and only women-dedicated bicycle brand. Designed"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" by women for women, allEva bikes are optimized for the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" feminine physique using analytics from a body metrics"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" database. If you like 29ers, try the Eva 291. It’s a "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand new bike for 2022.. This full-suspension, "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"cross-country ride has been designed for velocity. The"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 291 has 100mm of front and rear travel, a superlight "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"aluminum frame and fast-rolling 29-inch wheels. Yippee!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Noka Bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Kahuna"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Whether you want to try your hand at XC racing or are "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"looking for a lively trail bike that's just as inspiring"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" on the climbs as it is over rougher ground, the Wilder"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" is one heck of a bike built specifically for short women."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Both the frames and components have been tweaked to "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"include a women’s saddle, different bars and unique "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"colourway."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Breakout"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"XBN 2.1 Alloy"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">810</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The XBN 2.1 Alloy is our entry-level road bike – but that’s"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" not to say that it’s a basic machine. With an internal "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"weld aluminium frame, a full carbon fork, and the slick-shifting"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Claris gears from Shimano’s, this is a bike which doesn’t"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" break the bank and delivers craved performance."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"ScramBikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"WattBike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">2300</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The WattBike is the best e-bike for people who still feel young"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" at heart. It has a Bafang 1000W mid-drive system and a 48V"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 17.5AH Samsung Lithium-Ion battery, allowing you to ride for"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" more than 60 miles on one charge. It’s great for tackling hilly"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" terrain or if you just fancy a more leisurely ride. With three"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" working modes, you can choose between E-bike, assisted bicycle,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and normal bike modes."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Peaknetic"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Secto"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">430</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"If you struggle with stiff fingers or a kinked neck or back after"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a few minutes on the road, this lightweight, aluminum bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" alleviates those issues and allows you to enjoy the ride. From"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" the ergonomic grips to the lumbar-supporting seat position, the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Roll Low-Entry offers incredible comfort. The rear-inclined seat"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" tube facilitates stability by allowing you to put a foot on the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" ground to balance at a stop, and the low step-over frame makes it"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" accessible for all ability and mobility levels. The saddle is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" very soft, with a wide back to support your hip joints and a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" cutout in the center to redistribute that pressure. Rim brakes"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" deliver satisfactory braking control, and the wide tires provide"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a smooth, stable ride on paved roads and gravel. Rack and fender"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mounts facilitate setting up the Roll Low-Entry as your preferred"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" commuter, and the BMX-like handlebar offers space for mounting a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flashlight, bell, or phone holder."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"nHill"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Summit"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"This budget mountain bike from nHill performs well both on bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" paths and on the trail. The fork with 100mm of travel absorbs"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" rough terrain. Fat Kenda Booster tires give you grip in corners"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and on wet trails. The Shimano Tourney drivetrain offered enough"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" gears for finding a comfortable pace to ride uphill, and the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Tektro hydraulic disc brakes break smoothly. Whether you want an"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" affordable bike that you can take to work, but also take trail in"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mountains on the weekends or you’re just after a stable,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" comfortable ride for the bike path, the Summit gives a good value"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" for money."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"ThrillCycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"BikeShind"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"An artsy, retro-inspired bicycle that’s as functional as it is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" pretty: The ThrillCycle steel frame offers a smooth ride. A"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 9-speed drivetrain has enough gears for coasting in the city, but"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" we wouldn’t suggest taking it to the mountains. Fenders protect"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" you from mud, and a rear basket lets you transport groceries,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flowers and books. The ThrillCycle comes with a limited lifetime"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" warranty, so this little guy will last you long past graduation."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"refurbished"</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="k">for</span> <span class="p">(</span><span class="kt">var</span> <span class="n">i</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span> <span class="n">i</span> <span class="p">&lt;</span> <span class="n">bicycles</span><span class="p">.</span><span class="n">Length</span><span class="p">;</span> <span class="n">i</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">db</span><span class="p">.</span><span class="n">JSON</span><span class="p">().</span><span class="n">Set</span><span class="p">(</span><span class="s">$"bicycle:{i}"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="n">bicycles</span><span class="p">[</span><span class="n">i</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></span><span class="line hl"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[500 1000]"</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res1</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step.</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">SearchResult</span> <span class="n">res2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">().</span><span class="n">AddFilter</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s">"price"</span><span class="p">,</span> <span class="m">500</span><span class="p">,</span> <span class="m">1000</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res2</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step.</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">SearchResult</span> <span class="n">res3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"*"</span><span class="p">).</span><span class="n">AddFilter</span><span class="p">(</span><span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"price"</span><span class="p">,</span> <span class="m">1000</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="n">Double</span><span class="p">.</span><span class="n">PositiveInfinity</span><span class="p">,</span> <span class="k">false</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="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res3</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 5</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step.</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">SearchResult</span> <span class="n">res4</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[-inf 2000]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">SetSortBy</span><span class="p">(</span><span class="s">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">Limit</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">5</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res4</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Prices: {string.Join("</span><span class="p">,</span> <span class="s">", res4.Documents.Select(d =&gt; d["</span><span class="n">price</span><span class="s">"]))}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Prices: 270, 430, 810, 815, 815</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step.</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="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </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_Csharp_query_range-steprange1')" 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_Csharp_query_range-steprange1" 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/dotnet/" tabindex="1" title="Quick-Start"> C# 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/NRedisStack/tree/master/tests/Doc/QueryRangeExample.cs" 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> This is semantically equivalent to: </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="query_range-steprange2"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_range-steprange2" name="query_range-steprange2" 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_query_range-steprange2" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-query_range-steprange2" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_range-steprange2" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; FT.SEARCH idx:bicycle "*" FILTER price 500 1000 </span></span><span class="line hl"><span class="cl">1) (integer) 3 </span></span><span class="line hl"><span class="cl">2) "bicycle:2" </span></span><span class="line hl"><span class="cl">3) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, -87.6848 41.8231, -87.6848 41.9331))\",\"store_location\":\"-87.6298,41.8781\",\"brand\":\"Nord\",\"model\":\"Chook air 5\",\"price\":815,\"description\":\"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.\",\"condition\":\"used\"}" </span></span><span class="line hl"><span class="cl">4) "bicycle:5" </span></span><span class="line hl"><span class="cl">5) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, -0.1778 51.4024, -0.1778 51.5524))\",\"store_location\":\"-0.1278,51.5074\",\"brand\":\"Breakout\",\"model\":\"XBN 2.1 Alloy\",\"price\":810,\"description\":\"The XBN 2.1 Alloy is our entry-level road bike \xe2\x80\x93 but that\xe2\x80\x99s not to say that it\xe2\x80\x99s a basic machine. With an internal weld aluminium frame, a full carbon fork, and the slick-shifting Claris gears from Shimano\xe2\x80\x99s, this is a bike which doesn\xe2\x80\x99t break the bank and delivers craved performance.\",\"condition\":\"new\"}" </span></span><span class="line hl"><span class="cl">6) "bicycle:9" </span></span><span class="line hl"><span class="cl">7) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((12.4464 42.1028, 12.5464 42.1028, 12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\",\"store_location\":\"12.4964,41.9028\",\"model\":\"ThrillCycle\",\"brand\":\"BikeShind\",\"price\":815,\"description\":\"An artsy, retro-inspired bicycle that\xe2\x80\x99s as functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn\xe2\x80\x99t suggest taking it to the mountains. Fenders protect you from mud, and a rear basket lets you transport groceries, flowers and books. The ThrillCycle comes with a limited lifetime warranty, so this little guy will last you long past graduation.\",\"condition\":\"refurbished\"}"</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_query_range-steprange2')" 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_query_range-steprange2" name="query_range-steprange2" 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_query_range-steprange2" title="Open example"> Python </label> <div aria-labelledby="tab-query_range-steprange2" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_query_range-steprange2" 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="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</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.json.path</span> <span class="kn">import</span> <span class="n">Path</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="n">TextField</span><span class="p">,</span> <span class="n">NumericField</span><span class="p">,</span> <span class="n">TagField</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">NumericFilter</span><span class="p">,</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</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">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="c1"># create index</span> </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">"$.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">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">"$.condition"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"condition"</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">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><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">"bicycle:"</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="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data</span> </span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_em.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</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">r</span><span class="o">.</span><span class="n">pipeline</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</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="sa">f</span><span class="s1">'bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s1">'</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</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></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</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="s2">"@price:[500 1000]"</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</span> </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="n">Query</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="mi">500</span><span class="p">,</span> <span class="mi">1000</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</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">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="s2">"(1000"</span><span class="p">,</span> <span class="s2">"+inf"</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 5</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="s1">'@price:[-inf 2000]'</span><span class="p">)</span><span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s1">'price'</span><span class="p">)</span><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">5</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</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">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{7 total, docs: [Document {'id': 'bicycle:0', ... }, Document {'id': 'bicycle:7', ... }, Document {'id': 'bicycle:5', ... }, ...]</span> </span></span><span class="line"><span class="cl"> </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_query_range-steprange2')" 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_query_range-steprange2" 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/query_range.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> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_query_range-steprange2" name="query_range-steprange2" 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="Nodejs_query_range-steprange2" title="Open example"> Node.js </label> <div aria-labelledby="tab-query_range-steprange2" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_range-steprange2" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span><span class="p">,</span> <span class="nx">SchemaFieldTypes</span><span class="p">,</span> <span class="nx">AggregateGroupByReducers</span><span class="p">,</span> <span class="nx">AggregateSteps</span><span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1">// create index </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.description'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'description'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.price'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">NUMERIC</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'price'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.condition'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TAG</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'condition'</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="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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">// load data </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_em.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'@price:[500 1000]'</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="c1">// FILTER is not supported </span></span></span><span class="line hl"><span class="cl"><span class="c1">// const res2 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line hl"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line hl"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line hl"><span class="cl"><span class="c1">// min: 500, </span></span></span><span class="line hl"><span class="cl"><span class="c1">// max: 1000, </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">// console.log(res2.total); // &gt;&gt;&gt; 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">// FILTER is not supported </span></span></span><span class="line"><span class="cl"><span class="c1">// const res3 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line"><span class="cl"><span class="c1">// min: '(1000', </span></span></span><span class="line"><span class="cl"><span class="c1">// max: '+inf, </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">// console.log(res3.total); // &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s1">'idx:bicycle'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s1">'@price:[-inf 2000]'</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="nx">SORTBY</span><span class="o">:</span> <span class="s1">'price'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">LIMIT</span><span class="o">:</span> <span class="p">{</span> <span class="nx">from</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">size</span><span class="o">:</span> <span class="mi">5</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">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; { total: 7, documents: [ { id: 'bicycle:0', value: [Object: null prototype] }, { id: 'bicycle:7', value: [Object: null prototype] }, { id: 'bicycle:5', value: [Object: null prototype] }, { id: 'bicycle:2', value: [Object: null prototype] }, { id: 'bicycle:9', value: [Object: null prototype] } ] } </span></span></span><span class="line"><span class="cl"><span class="c1"></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_Nodejs_query_range-steprange2')" 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_Nodejs_query_range-steprange2" 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/nodejs/" tabindex="1" title="Quick-Start"> Node.js 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/node-redis/tree/emb-examples/doctests/query-range.js" 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> <input class="radiotab w-0 h-0" data-lang="java" id="Java_query_range-steprange2" name="query_range-steprange2" 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="Java_query_range-steprange2" title="Open example"> Java </label> <div aria-labelledby="tab-query_range-steprange2" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_query_range-steprange2" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</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">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.JedisDataException</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.json.Path2</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.args.SortingOrder</span><span class="o">;</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="kd">public</span> <span class="kd">class</span> <span class="nc">QueryRangeExample</span> <span class="o">{</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="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</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">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</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></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">bicycleJsons</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-74.0610 40.6678, -74.0610 40.7578))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-74.0060,40.7128\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Velorim\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Jigger\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 270,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"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="o">+</span> <span class="s">"This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"is the vehicle of choice for the rare tenacious little rider raring to go.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-118.2887 33.9872, -118.2887 34.0972))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-118.2437,34.0522\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Bicyk\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Hillcraft\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Kids want to ride with as little weight as possible. Especially "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"off a 24'' bike. The Hillcraft 26 is just the solution they need!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-87.6848 41.8231, -87.6848 41.9331))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-87.6298,41.8781\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Nord\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Chook air 5\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The Chook Air 5 gives kids aged six years and older a durable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and uberlight mountain bike for their first experience on tracks and easy cruising through "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"forests and fields. The lower top tube makes it easy to mount and dismount in any "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"situation, giving your kids greater safety on the trails.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-80.2433 25.6967, -80.2433 25.8067))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-80.1918,25.7617\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Eva\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Eva 291\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3400,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The sister company to Nord, Eva launched in 2005 as the first "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"are optimized for the feminine physique using analytics from a body metrics database. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"full-suspension, cross-country ride has been designed for velocity. The 291 has "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"100mm of front and rear travel, a superlight aluminum frame and fast-rolling "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"29-inch wheels. Yippee!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-122.4644 37.7099, -122.4644 37.8199))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-122.4194,37.7749\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Noka Bikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Kahuna\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Whether you want to try your hand at XC racing or are looking "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"for a lively trail bike that's just as inspiring on the climbs as it is over rougher "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ground, the Wilder is one heck of a bike built specifically for short women. Both the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"frames and components have been tweaked to include a women’s saddle, different bars "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and unique colourway.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-0.1778 51.4024, -0.1778 51.5524))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-0.1278,51.5074\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Breakout\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"XBN 2.1 Alloy\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 810,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The XBN 2.1 Alloy is our entry-level road bike – but that’s "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"not to say that it’s a basic machine. With an internal weld aluminium frame, a full "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"doesn’t break the bank and delivers craved performance.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"2.1767 48.5516, 2.1767 48.9016))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.3522,48.8566\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"ScramBikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"WattBike\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 2300,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The WattBike is the best e-bike for people who still "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"charge. It’s great for tackling hilly terrain or if you just fancy a more "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"leisurely ride. With three working modes, you can choose between E-bike, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"assisted bicycle, and normal bike modes.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"13.3260 52.2700, 13.3260 52.5700))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"13.4050,52.5200\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Peaknetic\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Secto\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 430,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"If you struggle with stiff fingers or a kinked neck or "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"back after a few minutes on the road, this lightweight, aluminum bike alleviates "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"those issues and allows you to enjoy the ride. From the ergonomic grips to the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The rear-inclined seat tube facilitates stability by allowing you to put a foot "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on the ground to balance at a stop, and the low step-over frame makes it "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"accessible for all ability and mobility levels. The saddle is very soft, with "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"a wide back to support your hip joints and a cutout in the center to redistribute "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"facilitate setting up the Roll Low-Entry as your preferred commuter, and the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"1.9450 41.1987, 1.9450 41.4301))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.1734, 41.3851\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"nHill\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Summit\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"This budget mountain bike from nHill performs well both "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on bike paths and on the trail. The fork with 100mm of travel absorbs rough "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The Shimano Tourney drivetrain offered enough gears for finding a comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Whether you want an affordable bike that you can take to work, but also take "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"trail in mountains on the weekends or you’re just after a stable, comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ride for the bike path, the Summit gives a good value for money.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((12.4464 42.1028, 12.5464 42.1028, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"12.4964,41.9028\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"ThrillCycle\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"BikeShind\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"An artsy, retro-inspired bicycle that’s as "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"suggest taking it to the mountains. Fenders protect you from mud, and a rear "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"basket lets you transport groceries, flowers and books. The ThrillCycle comes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"with a limited lifetime warranty, so this little guy will last you long "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"past graduation.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"refurbished\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycleJsons</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSet</span><span class="o">(</span><span class="s">"bicycle:"</span> <span class="o">+</span> <span class="n">i</span><span class="o">,</span> <span class="n">Path2</span><span class="o">.</span><span class="na">ROOT_PATH</span><span class="o">,</span> <span class="n">bicycleJsons</span><span class="o">[</span><span class="n">i</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></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="s">"@price:[500 1000]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">().</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs1</span> <span class="o">=</span> <span class="n">res1</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs1</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step. </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">SearchResult</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">500</span><span class="o">,</span> <span class="mi">1000</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 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="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs2</span> <span class="o">=</span> <span class="n">res2</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs2</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step. </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">SearchResult</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">1000</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="n">Double</span><span class="o">.</span><span class="na">POSITIVE_INFINITY</span><span class="o">,</span> <span class="kc">false</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs3</span> <span class="o">=</span> <span class="n">res3</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs3</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:1 : price 1200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:4 : price 3200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:6 : price 2300 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:3 : price 3400 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:8 : price 1200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step. </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">SearchResult</span> <span class="n">res4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@price:[-inf 2000]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">sortBy</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="n">SortingOrder</span><span class="o">.</span><span class="na">ASC</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">limit</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">5</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res4</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs4</span> <span class="o">=</span> <span class="n">res4</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs4</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:0 : price 270 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:7 : price 430 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</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></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_Java_query_range-steprange2')" 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_Java_query_range-steprange2" 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/java/jedis/" tabindex="1" title="Quick-Start"> Java 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/jedis/tree/master/src/test/java/io/redis/examples/QueryRangeExample.java" 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> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_query_range-steprange2" name="query_range-steprange2" 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="Csharp_query_range-steprange2" title="Open example"> C# </label> <div aria-labelledby="tab-query_range-steprange2" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_query_range-steprange2" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.RedisStackCommands</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search.Literals.Enums</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</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="k">public</span> <span class="k">class</span> <span class="nc">QueryRangeExample</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="k">public</span> <span class="k">void</span> <span class="n">run</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="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Schema</span> <span class="n">bikeSchema</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Schema</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTextField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.description"</span><span class="p">,</span> <span class="s">"description"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddNumericField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.price"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTagField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.condition"</span><span class="p">,</span> <span class="s">"condition"</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span> <span class="n">bikeParams</span> <span class="p">=</span> <span class="k">new</span> <span class="n">FTCreateParams</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddPrefix</span><span class="p">(</span><span class="s">"bicycle:"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">On</span><span class="p">(</span><span class="n">IndexDataType</span><span class="p">.</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">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Create</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">bikeParams</span><span class="p">,</span> <span class="n">bikeSchema</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">bicycles</span> <span class="p">=</span> <span class="k">new</span> <span class="kt">object</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Velorim"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Jigger"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">270</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Small and powerful, the Jigger is the best ride "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"for the smallest of tikes! This is the tiniest "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"kids’ pedal bike on the market available without"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a coaster brake, the Jigger is the vehicle of "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"choice for the rare tenacious little rider "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"raring to go."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Bicyk"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Hillcraft"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Kids want to ride with as little weight as possible."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Especially on an incline! They may be at the age "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"when a 27.5 inch wheel bike is just too clumsy coming "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"off a 24 inch bike. The Hillcraft 26 is just the solution"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" they need!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Nord"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Chook air 5"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The Chook Air 5 gives kids aged six years and older "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"a durable and uberlight mountain bike for their first"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" experience on tracks and easy cruising through forests"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and fields. The lower top tube makes it easy to mount"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and dismount in any situation, giving your kids greater"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" safety on the trails."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Eva"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Eva 291"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3400</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The sister company to Nord, Eva launched in 2005 as the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" first and only women-dedicated bicycle brand. Designed"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" by women for women, allEva bikes are optimized for the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" feminine physique using analytics from a body metrics"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" database. If you like 29ers, try the Eva 291. It’s a "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand new bike for 2022.. This full-suspension, "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"cross-country ride has been designed for velocity. The"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 291 has 100mm of front and rear travel, a superlight "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"aluminum frame and fast-rolling 29-inch wheels. Yippee!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Noka Bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Kahuna"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Whether you want to try your hand at XC racing or are "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"looking for a lively trail bike that's just as inspiring"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" on the climbs as it is over rougher ground, the Wilder"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" is one heck of a bike built specifically for short women."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Both the frames and components have been tweaked to "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"include a women’s saddle, different bars and unique "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"colourway."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Breakout"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"XBN 2.1 Alloy"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">810</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The XBN 2.1 Alloy is our entry-level road bike – but that’s"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" not to say that it’s a basic machine. With an internal "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"weld aluminium frame, a full carbon fork, and the slick-shifting"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Claris gears from Shimano’s, this is a bike which doesn’t"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" break the bank and delivers craved performance."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"ScramBikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"WattBike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">2300</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The WattBike is the best e-bike for people who still feel young"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" at heart. It has a Bafang 1000W mid-drive system and a 48V"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 17.5AH Samsung Lithium-Ion battery, allowing you to ride for"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" more than 60 miles on one charge. It’s great for tackling hilly"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" terrain or if you just fancy a more leisurely ride. With three"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" working modes, you can choose between E-bike, assisted bicycle,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and normal bike modes."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Peaknetic"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Secto"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">430</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"If you struggle with stiff fingers or a kinked neck or back after"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a few minutes on the road, this lightweight, aluminum bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" alleviates those issues and allows you to enjoy the ride. From"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" the ergonomic grips to the lumbar-supporting seat position, the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Roll Low-Entry offers incredible comfort. The rear-inclined seat"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" tube facilitates stability by allowing you to put a foot on the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" ground to balance at a stop, and the low step-over frame makes it"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" accessible for all ability and mobility levels. The saddle is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" very soft, with a wide back to support your hip joints and a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" cutout in the center to redistribute that pressure. Rim brakes"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" deliver satisfactory braking control, and the wide tires provide"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a smooth, stable ride on paved roads and gravel. Rack and fender"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mounts facilitate setting up the Roll Low-Entry as your preferred"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" commuter, and the BMX-like handlebar offers space for mounting a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flashlight, bell, or phone holder."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"nHill"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Summit"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"This budget mountain bike from nHill performs well both on bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" paths and on the trail. The fork with 100mm of travel absorbs"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" rough terrain. Fat Kenda Booster tires give you grip in corners"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and on wet trails. The Shimano Tourney drivetrain offered enough"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" gears for finding a comfortable pace to ride uphill, and the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Tektro hydraulic disc brakes break smoothly. Whether you want an"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" affordable bike that you can take to work, but also take trail in"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mountains on the weekends or you’re just after a stable,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" comfortable ride for the bike path, the Summit gives a good value"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" for money."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"ThrillCycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"BikeShind"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"An artsy, retro-inspired bicycle that’s as functional as it is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" pretty: The ThrillCycle steel frame offers a smooth ride. A"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 9-speed drivetrain has enough gears for coasting in the city, but"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" we wouldn’t suggest taking it to the mountains. Fenders protect"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" you from mud, and a rear basket lets you transport groceries,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flowers and books. The ThrillCycle comes with a limited lifetime"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" warranty, so this little guy will last you long past graduation."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"refurbished"</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="k">for</span> <span class="p">(</span><span class="kt">var</span> <span class="n">i</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span> <span class="n">i</span> <span class="p">&lt;</span> <span class="n">bicycles</span><span class="p">.</span><span class="n">Length</span><span class="p">;</span> <span class="n">i</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">db</span><span class="p">.</span><span class="n">JSON</span><span class="p">().</span><span class="n">Set</span><span class="p">(</span><span class="s">$"bicycle:{i}"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="n">bicycles</span><span class="p">[</span><span class="n">i</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></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[500 1000]"</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res1</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step.</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">SearchResult</span> <span class="n">res2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">().</span><span class="n">AddFilter</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s">"price"</span><span class="p">,</span> <span class="m">500</span><span class="p">,</span> <span class="m">1000</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res2</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step.</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">SearchResult</span> <span class="n">res3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"*"</span><span class="p">).</span><span class="n">AddFilter</span><span class="p">(</span><span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"price"</span><span class="p">,</span> <span class="m">1000</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="n">Double</span><span class="p">.</span><span class="n">PositiveInfinity</span><span class="p">,</span> <span class="k">false</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="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res3</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 5</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step.</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">SearchResult</span> <span class="n">res4</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[-inf 2000]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">SetSortBy</span><span class="p">(</span><span class="s">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">Limit</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">5</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res4</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Prices: {string.Join("</span><span class="p">,</span> <span class="s">", res4.Documents.Select(d =&gt; d["</span><span class="n">price</span><span class="s">"]))}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Prices: 270, 430, 810, 815, 815</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step.</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="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </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_Csharp_query_range-steprange2')" 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_Csharp_query_range-steprange2" 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/dotnet/" tabindex="1" title="Quick-Start"> C# 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/NRedisStack/tree/master/tests/Doc/QueryRangeExample.cs" 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> For bicycles with a price greater than 1000 USD ( <code> price &gt; 1000 </code> ), you can use: </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="query_range-steprange3"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_range-steprange3" name="query_range-steprange3" 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_query_range-steprange3" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-query_range-steprange3" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_range-steprange3" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; FT.SEARCH idx:bicycle "@price:[(1000 +inf]" </span></span><span class="line hl"><span class="cl"> 1) (integer) 5 </span></span><span class="line hl"><span class="cl"> 2) "bicycle:1" </span></span><span class="line hl"><span class="cl"> 3) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, -118.2887 33.9872, -118.2887 34.0972))\",\"store_location\":\"-118.2437,34.0522\",\"brand\":\"Bicyk\",\"model\":\"Hillcraft\",\"price\":1200,\"description\":\"Kids want to ride with as little weight as possible. Especially on an incline! They may be at the age when a 27.5\\\" wheel bike is just too clumsy coming off a 24\\\" bike. The Hillcraft 26 is just the solution they need!\",\"condition\":\"used\"}" </span></span><span class="line hl"><span class="cl"> 4) "bicycle:4" </span></span><span class="line hl"><span class="cl"> 5) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, -122.4644 37.7099, -122.4644 37.8199))\",\"store_location\":\"-122.4194,37.7749\",\"brand\":\"Noka Bikes\",\"model\":\"Kahuna\",\"price\":3200,\"description\":\"Whether you want to try your hand at XC racing or are looking for a lively trail bike that's just as inspiring on the climbs as it is over rougher ground, the Wilder is one heck of a bike built specifically for short women. Both the frames and components have been tweaked to include a women\xe2\x80\x99s saddle, different bars and unique colourway.\",\"condition\":\"used\"}" </span></span><span class="line hl"><span class="cl"> 6) "bicycle:3" </span></span><span class="line hl"><span class="cl"> 7) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, -80.2433 25.6967, -80.2433 25.8067))\",\"store_location\":\"-80.1918,25.7617\",\"brand\":\"Eva\",\"model\":\"Eva 291\",\"price\":3400,\"description\":\"The sister company to Nord, Eva launched in 2005 as the first and only women-dedicated bicycle brand. Designed by women for women, allEva bikes are optimized for the feminine physique using analytics from a body metrics database. If you like 29ers, try the Eva 291. It\xe2\x80\x99s a brand new bike for 2022.. This full-suspension, cross-country ride has been designed for velocity. The 291 has 100mm of front and rear travel, a superlight aluminum frame and fast-rolling 29-inch wheels. Yippee!\",\"condition\":\"used\"}" </span></span><span class="line hl"><span class="cl"> 8) "bicycle:6" </span></span><span class="line hl"><span class="cl"> 9) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, 2.1767 48.5516, 2.1767 48.9016))\",\"store_location\":\"2.3522,48.8566\",\"brand\":\"ScramBikes\",\"model\":\"WattBike\",\"price\":2300,\"description\":\"The WattBike is the best e-bike for people who still feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one charge. It\xe2\x80\x99s great for tackling hilly terrain or if you just fancy a more leisurely ride. With three working modes, you can choose between E-bike, assisted bicycle, and normal bike modes.\",\"condition\":\"new\"}" </span></span><span class="line hl"><span class="cl">10) "bicycle:8" </span></span><span class="line hl"><span class="cl">11) 1) "$" </span></span><span class="line hl"><span class="cl"> 2) "{\"pickup_zone\":\"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, 1.9450 41.1987, 1.9450 41.4301))\",\"store_location\":\"2.1734, 41.3851\",\"brand\":\"nHill\",\"model\":\"Summit\",\"price\":1200,\"description\":\"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 in mountains on the weekends or you\xe2\x80\x99re just after a stable, comfortable ride for the bike path, the Summit gives a good value for money.\",\"condition\":\"new\"}"</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_query_range-steprange3')" 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_query_range-steprange3" name="query_range-steprange3" 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_query_range-steprange3" title="Open example"> Python </label> <div aria-labelledby="tab-query_range-steprange3" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_query_range-steprange3" 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="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</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.json.path</span> <span class="kn">import</span> <span class="n">Path</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="n">TextField</span><span class="p">,</span> <span class="n">NumericField</span><span class="p">,</span> <span class="n">TagField</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">NumericFilter</span><span class="p">,</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</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">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="c1"># create index</span> </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">"$.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">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">"$.condition"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"condition"</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">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><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">"bicycle:"</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="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data</span> </span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_em.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</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">r</span><span class="o">.</span><span class="n">pipeline</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</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="sa">f</span><span class="s1">'bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s1">'</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</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></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</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="s2">"@price:[500 1000]"</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</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">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="mi">500</span><span class="p">,</span> <span class="mi">1000</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</span> </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="n">Query</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="s2">"(1000"</span><span class="p">,</span> <span class="s2">"+inf"</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; 5</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="s1">'@price:[-inf 2000]'</span><span class="p">)</span><span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s1">'price'</span><span class="p">)</span><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">5</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</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">res</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{7 total, docs: [Document {'id': 'bicycle:0', ... }, Document {'id': 'bicycle:7', ... }, Document {'id': 'bicycle:5', ... }, ...]</span> </span></span><span class="line"><span class="cl"> </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_query_range-steprange3')" 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_query_range-steprange3" 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/query_range.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> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_query_range-steprange3" name="query_range-steprange3" 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="Nodejs_query_range-steprange3" title="Open example"> Node.js </label> <div aria-labelledby="tab-query_range-steprange3" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_range-steprange3" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span><span class="p">,</span> <span class="nx">SchemaFieldTypes</span><span class="p">,</span> <span class="nx">AggregateGroupByReducers</span><span class="p">,</span> <span class="nx">AggregateSteps</span><span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1">// create index </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.description'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'description'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.price'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">NUMERIC</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'price'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.condition'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TAG</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'condition'</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="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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">// load data </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_em.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'@price:[500 1000]'</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 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">// FILTER is not supported </span></span></span><span class="line"><span class="cl"><span class="c1">// const res2 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line"><span class="cl"><span class="c1">// min: 500, </span></span></span><span class="line"><span class="cl"><span class="c1">// max: 1000, </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">// console.log(res2.total); // &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="c1">// FILTER is not supported </span></span></span><span class="line hl"><span class="cl"><span class="c1">// const res3 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line hl"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line hl"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line hl"><span class="cl"><span class="c1">// min: '(1000', </span></span></span><span class="line hl"><span class="cl"><span class="c1">// max: '+inf, </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">// console.log(res3.total); // &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s1">'idx:bicycle'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="s1">'@price:[-inf 2000]'</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="nx">SORTBY</span><span class="o">:</span> <span class="s1">'price'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">LIMIT</span><span class="o">:</span> <span class="p">{</span> <span class="nx">from</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">size</span><span class="o">:</span> <span class="mi">5</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">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; { total: 7, documents: [ { id: 'bicycle:0', value: [Object: null prototype] }, { id: 'bicycle:7', value: [Object: null prototype] }, { id: 'bicycle:5', value: [Object: null prototype] }, { id: 'bicycle:2', value: [Object: null prototype] }, { id: 'bicycle:9', value: [Object: null prototype] } ] } </span></span></span><span class="line"><span class="cl"><span class="c1"></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_Nodejs_query_range-steprange3')" 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_Nodejs_query_range-steprange3" 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/nodejs/" tabindex="1" title="Quick-Start"> Node.js 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/node-redis/tree/emb-examples/doctests/query-range.js" 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> <input class="radiotab w-0 h-0" data-lang="java" id="Java_query_range-steprange3" name="query_range-steprange3" 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="Java_query_range-steprange3" title="Open example"> Java </label> <div aria-labelledby="tab-query_range-steprange3" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_query_range-steprange3" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</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">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.JedisDataException</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.json.Path2</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.args.SortingOrder</span><span class="o">;</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="kd">public</span> <span class="kd">class</span> <span class="nc">QueryRangeExample</span> <span class="o">{</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="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</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">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</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></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">bicycleJsons</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-74.0610 40.6678, -74.0610 40.7578))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-74.0060,40.7128\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Velorim\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Jigger\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 270,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"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="o">+</span> <span class="s">"This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"is the vehicle of choice for the rare tenacious little rider raring to go.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-118.2887 33.9872, -118.2887 34.0972))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-118.2437,34.0522\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Bicyk\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Hillcraft\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Kids want to ride with as little weight as possible. Especially "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"off a 24'' bike. The Hillcraft 26 is just the solution they need!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-87.6848 41.8231, -87.6848 41.9331))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-87.6298,41.8781\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Nord\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Chook air 5\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The Chook Air 5 gives kids aged six years and older a durable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and uberlight mountain bike for their first experience on tracks and easy cruising through "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"forests and fields. The lower top tube makes it easy to mount and dismount in any "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"situation, giving your kids greater safety on the trails.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-80.2433 25.6967, -80.2433 25.8067))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-80.1918,25.7617\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Eva\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Eva 291\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3400,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The sister company to Nord, Eva launched in 2005 as the first "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"are optimized for the feminine physique using analytics from a body metrics database. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"full-suspension, cross-country ride has been designed for velocity. The 291 has "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"100mm of front and rear travel, a superlight aluminum frame and fast-rolling "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"29-inch wheels. Yippee!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-122.4644 37.7099, -122.4644 37.8199))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-122.4194,37.7749\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Noka Bikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Kahuna\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Whether you want to try your hand at XC racing or are looking "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"for a lively trail bike that's just as inspiring on the climbs as it is over rougher "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ground, the Wilder is one heck of a bike built specifically for short women. Both the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"frames and components have been tweaked to include a women’s saddle, different bars "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and unique colourway.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-0.1778 51.4024, -0.1778 51.5524))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-0.1278,51.5074\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Breakout\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"XBN 2.1 Alloy\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 810,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The XBN 2.1 Alloy is our entry-level road bike – but that’s "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"not to say that it’s a basic machine. With an internal weld aluminium frame, a full "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"doesn’t break the bank and delivers craved performance.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"2.1767 48.5516, 2.1767 48.9016))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.3522,48.8566\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"ScramBikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"WattBike\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 2300,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The WattBike is the best e-bike for people who still "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"charge. It’s great for tackling hilly terrain or if you just fancy a more "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"leisurely ride. With three working modes, you can choose between E-bike, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"assisted bicycle, and normal bike modes.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"13.3260 52.2700, 13.3260 52.5700))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"13.4050,52.5200\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Peaknetic\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Secto\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 430,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"If you struggle with stiff fingers or a kinked neck or "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"back after a few minutes on the road, this lightweight, aluminum bike alleviates "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"those issues and allows you to enjoy the ride. From the ergonomic grips to the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The rear-inclined seat tube facilitates stability by allowing you to put a foot "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on the ground to balance at a stop, and the low step-over frame makes it "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"accessible for all ability and mobility levels. The saddle is very soft, with "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"a wide back to support your hip joints and a cutout in the center to redistribute "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"facilitate setting up the Roll Low-Entry as your preferred commuter, and the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"1.9450 41.1987, 1.9450 41.4301))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.1734, 41.3851\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"nHill\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Summit\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"This budget mountain bike from nHill performs well both "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on bike paths and on the trail. The fork with 100mm of travel absorbs rough "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The Shimano Tourney drivetrain offered enough gears for finding a comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Whether you want an affordable bike that you can take to work, but also take "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"trail in mountains on the weekends or you’re just after a stable, comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ride for the bike path, the Summit gives a good value for money.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((12.4464 42.1028, 12.5464 42.1028, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"12.4964,41.9028\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"ThrillCycle\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"BikeShind\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"An artsy, retro-inspired bicycle that’s as "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"suggest taking it to the mountains. Fenders protect you from mud, and a rear "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"basket lets you transport groceries, flowers and books. The ThrillCycle comes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"with a limited lifetime warranty, so this little guy will last you long "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"past graduation.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"refurbished\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycleJsons</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSet</span><span class="o">(</span><span class="s">"bicycle:"</span> <span class="o">+</span> <span class="n">i</span><span class="o">,</span> <span class="n">Path2</span><span class="o">.</span><span class="na">ROOT_PATH</span><span class="o">,</span> <span class="n">bicycleJsons</span><span class="o">[</span><span class="n">i</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></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="s">"@price:[500 1000]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">().</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs1</span> <span class="o">=</span> <span class="n">res1</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs1</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step. </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">SearchResult</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">500</span><span class="o">,</span> <span class="mi">1000</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs2</span> <span class="o">=</span> <span class="n">res2</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs2</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step. </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">SearchResult</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">1000</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="n">Double</span><span class="o">.</span><span class="na">POSITIVE_INFINITY</span><span class="o">,</span> <span class="kc">false</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 5 </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="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs3</span> <span class="o">=</span> <span class="n">res3</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs3</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; bicycle:1 : price 1200 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:4 : price 3200 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:6 : price 2300 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:3 : price 3400 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:8 : price 1200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step. </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">SearchResult</span> <span class="n">res4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"@price:[-inf 2000]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">sortBy</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="n">SortingOrder</span><span class="o">.</span><span class="na">ASC</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">limit</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">5</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res4</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 7 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs4</span> <span class="o">=</span> <span class="n">res4</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs4</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:0 : price 270 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:7 : price 430 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</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></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_Java_query_range-steprange3')" 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_Java_query_range-steprange3" 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/java/jedis/" tabindex="1" title="Quick-Start"> Java 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/jedis/tree/master/src/test/java/io/redis/examples/QueryRangeExample.java" 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> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_query_range-steprange3" name="query_range-steprange3" 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="Csharp_query_range-steprange3" title="Open example"> C# </label> <div aria-labelledby="tab-query_range-steprange3" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_query_range-steprange3" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.RedisStackCommands</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search.Literals.Enums</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</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="k">public</span> <span class="k">class</span> <span class="nc">QueryRangeExample</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="k">public</span> <span class="k">void</span> <span class="n">run</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="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Schema</span> <span class="n">bikeSchema</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Schema</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTextField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.description"</span><span class="p">,</span> <span class="s">"description"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddNumericField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.price"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTagField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.condition"</span><span class="p">,</span> <span class="s">"condition"</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span> <span class="n">bikeParams</span> <span class="p">=</span> <span class="k">new</span> <span class="n">FTCreateParams</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddPrefix</span><span class="p">(</span><span class="s">"bicycle:"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">On</span><span class="p">(</span><span class="n">IndexDataType</span><span class="p">.</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">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Create</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">bikeParams</span><span class="p">,</span> <span class="n">bikeSchema</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">bicycles</span> <span class="p">=</span> <span class="k">new</span> <span class="kt">object</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Velorim"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Jigger"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">270</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Small and powerful, the Jigger is the best ride "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"for the smallest of tikes! This is the tiniest "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"kids’ pedal bike on the market available without"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a coaster brake, the Jigger is the vehicle of "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"choice for the rare tenacious little rider "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"raring to go."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Bicyk"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Hillcraft"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Kids want to ride with as little weight as possible."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Especially on an incline! They may be at the age "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"when a 27.5 inch wheel bike is just too clumsy coming "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"off a 24 inch bike. The Hillcraft 26 is just the solution"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" they need!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Nord"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Chook air 5"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The Chook Air 5 gives kids aged six years and older "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"a durable and uberlight mountain bike for their first"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" experience on tracks and easy cruising through forests"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and fields. The lower top tube makes it easy to mount"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and dismount in any situation, giving your kids greater"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" safety on the trails."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Eva"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Eva 291"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3400</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The sister company to Nord, Eva launched in 2005 as the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" first and only women-dedicated bicycle brand. Designed"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" by women for women, allEva bikes are optimized for the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" feminine physique using analytics from a body metrics"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" database. If you like 29ers, try the Eva 291. It’s a "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand new bike for 2022.. This full-suspension, "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"cross-country ride has been designed for velocity. The"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 291 has 100mm of front and rear travel, a superlight "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"aluminum frame and fast-rolling 29-inch wheels. Yippee!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Noka Bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Kahuna"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Whether you want to try your hand at XC racing or are "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"looking for a lively trail bike that's just as inspiring"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" on the climbs as it is over rougher ground, the Wilder"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" is one heck of a bike built specifically for short women."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Both the frames and components have been tweaked to "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"include a women’s saddle, different bars and unique "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"colourway."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Breakout"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"XBN 2.1 Alloy"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">810</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The XBN 2.1 Alloy is our entry-level road bike – but that’s"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" not to say that it’s a basic machine. With an internal "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"weld aluminium frame, a full carbon fork, and the slick-shifting"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Claris gears from Shimano’s, this is a bike which doesn’t"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" break the bank and delivers craved performance."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"ScramBikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"WattBike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">2300</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The WattBike is the best e-bike for people who still feel young"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" at heart. It has a Bafang 1000W mid-drive system and a 48V"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 17.5AH Samsung Lithium-Ion battery, allowing you to ride for"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" more than 60 miles on one charge. It’s great for tackling hilly"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" terrain or if you just fancy a more leisurely ride. With three"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" working modes, you can choose between E-bike, assisted bicycle,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and normal bike modes."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Peaknetic"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Secto"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">430</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"If you struggle with stiff fingers or a kinked neck or back after"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a few minutes on the road, this lightweight, aluminum bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" alleviates those issues and allows you to enjoy the ride. From"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" the ergonomic grips to the lumbar-supporting seat position, the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Roll Low-Entry offers incredible comfort. The rear-inclined seat"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" tube facilitates stability by allowing you to put a foot on the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" ground to balance at a stop, and the low step-over frame makes it"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" accessible for all ability and mobility levels. The saddle is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" very soft, with a wide back to support your hip joints and a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" cutout in the center to redistribute that pressure. Rim brakes"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" deliver satisfactory braking control, and the wide tires provide"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a smooth, stable ride on paved roads and gravel. Rack and fender"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mounts facilitate setting up the Roll Low-Entry as your preferred"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" commuter, and the BMX-like handlebar offers space for mounting a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flashlight, bell, or phone holder."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"nHill"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Summit"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"This budget mountain bike from nHill performs well both on bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" paths and on the trail. The fork with 100mm of travel absorbs"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" rough terrain. Fat Kenda Booster tires give you grip in corners"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and on wet trails. The Shimano Tourney drivetrain offered enough"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" gears for finding a comfortable pace to ride uphill, and the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Tektro hydraulic disc brakes break smoothly. Whether you want an"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" affordable bike that you can take to work, but also take trail in"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mountains on the weekends or you’re just after a stable,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" comfortable ride for the bike path, the Summit gives a good value"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" for money."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"ThrillCycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"BikeShind"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"An artsy, retro-inspired bicycle that’s as functional as it is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" pretty: The ThrillCycle steel frame offers a smooth ride. A"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 9-speed drivetrain has enough gears for coasting in the city, but"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" we wouldn’t suggest taking it to the mountains. Fenders protect"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" you from mud, and a rear basket lets you transport groceries,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flowers and books. The ThrillCycle comes with a limited lifetime"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" warranty, so this little guy will last you long past graduation."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"refurbished"</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="k">for</span> <span class="p">(</span><span class="kt">var</span> <span class="n">i</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span> <span class="n">i</span> <span class="p">&lt;</span> <span class="n">bicycles</span><span class="p">.</span><span class="n">Length</span><span class="p">;</span> <span class="n">i</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">db</span><span class="p">.</span><span class="n">JSON</span><span class="p">().</span><span class="n">Set</span><span class="p">(</span><span class="s">$"bicycle:{i}"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="n">bicycles</span><span class="p">[</span><span class="n">i</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></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[500 1000]"</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res1</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step.</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">SearchResult</span> <span class="n">res2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">().</span><span class="n">AddFilter</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s">"price"</span><span class="p">,</span> <span class="m">500</span><span class="p">,</span> <span class="m">1000</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res2</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step.</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">SearchResult</span> <span class="n">res3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"*"</span><span class="p">).</span><span class="n">AddFilter</span><span class="p">(</span><span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"price"</span><span class="p">,</span> <span class="m">1000</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="n">Double</span><span class="p">.</span><span class="n">PositiveInfinity</span><span class="p">,</span> <span class="k">false</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="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res3</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 5</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step.</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">SearchResult</span> <span class="n">res4</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[-inf 2000]"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">SetSortBy</span><span class="p">(</span><span class="s">"price"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">Limit</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">5</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res4</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7</span> </span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Prices: {string.Join("</span><span class="p">,</span> <span class="s">", res4.Documents.Select(d =&gt; d["</span><span class="n">price</span><span class="s">"]))}"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Prices: 270, 430, 810, 815, 815</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step.</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="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </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_Csharp_query_range-steprange3')" 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_Csharp_query_range-steprange3" 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/dotnet/" tabindex="1" title="Quick-Start"> C# 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/NRedisStack/tree/master/tests/Doc/QueryRangeExample.cs" 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 example below returns bicycles with a price lower than or equal to 2000 USD ( <code> price &lt;= 2000 </code> ) by returning the five cheapest bikes: </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="query_range-steprange4"> <input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_range-steprange4" name="query_range-steprange4" 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_query_range-steprange4" title="Open example"> &gt;_ Redis CLI </label> <div aria-labelledby="tab-query_range-steprange4" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_range-steprange4" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">&gt; FT.SEARCH idx:bicycle "@price:[-inf 2000]" SORTBY price LIMIT 0 5 </span></span><span class="line hl"><span class="cl"> 1) (integer) 7 </span></span><span class="line hl"><span class="cl"> 2) "bicycle:0" </span></span><span class="line hl"><span class="cl"> 3) 1) "price" </span></span><span class="line hl"><span class="cl"> 2) "270" </span></span><span class="line hl"><span class="cl"> 3) "$" </span></span><span class="line hl"><span class="cl"> 4) "{\"pickup_zone\":\"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, -74.0610 40.6678, -74.0610 40.7578))\",\"store_location\":\"-74.0060,40.7128\",\"brand\":\"Velorim\",\"model\":\"Jigger\",\"price\":270,\"description\":\"Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kids\xe2\x80\x99 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.\",\"condition\":\"new\"}" </span></span><span class="line hl"><span class="cl"> 4) "bicycle:7" </span></span><span class="line hl"><span class="cl"> 5) 1) "price" </span></span><span class="line hl"><span class="cl"> 2) "430" </span></span><span class="line hl"><span class="cl"> 3) "$" </span></span><span class="line hl"><span class="cl"> 4) "{\"pickup_zone\":\"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, 13.3260 52.2700, 13.3260 52.5700))\",\"store_location\":\"13.4050,52.5200\",\"brand\":\"Peaknetic\",\"model\":\"Secto\",\"price\":430,\"description\":\"If you struggle with stiff fingers or a kinked neck or back after a few minutes on the road, this lightweight, aluminum bike alleviates those issues and allows you to enjoy the ride. From the ergonomic grips to the lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. The rear-inclined seat tube facilitates stability by allowing you to put a foot on the ground to balance at a stop, and the low step-over frame makes it accessible for all ability and mobility levels. The saddle is very soft, with a wide back to support your hip joints and a cutout in the center to redistribute that pressure. Rim brakes deliver satisfactory braking control, and the wide tires provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts facilitate setting up the Roll Low-Entry as your preferred commuter, and the BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\",\"condition\":\"new\"}" </span></span><span class="line hl"><span class="cl"> 6) "bicycle:5" </span></span><span class="line hl"><span class="cl"> 7) 1) "price" </span></span><span class="line hl"><span class="cl"> 2) "810" </span></span><span class="line hl"><span class="cl"> 3) "$" </span></span><span class="line hl"><span class="cl"> 4) "{\"pickup_zone\":\"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, -0.1778 51.4024, -0.1778 51.5524))\",\"store_location\":\"-0.1278,51.5074\",\"brand\":\"Breakout\",\"model\":\"XBN 2.1 Alloy\",\"price\":810,\"description\":\"The XBN 2.1 Alloy is our entry-level road bike \xe2\x80\x93 but that\xe2\x80\x99s not to say that it\xe2\x80\x99s a basic machine. With an internal weld aluminium frame, a full carbon fork, and the slick-shifting Claris gears from Shimano\xe2\x80\x99s, this is a bike which doesn\xe2\x80\x99t break the bank and delivers craved performance.\",\"condition\":\"new\"}" </span></span><span class="line hl"><span class="cl"> 8) "bicycle:2" </span></span><span class="line hl"><span class="cl"> 9) 1) "price" </span></span><span class="line hl"><span class="cl"> 2) "815" </span></span><span class="line hl"><span class="cl"> 3) "$" </span></span><span class="line hl"><span class="cl"> 4) "{\"pickup_zone\":\"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, -87.6848 41.8231, -87.6848 41.9331))\",\"store_location\":\"-87.6298,41.8781\",\"brand\":\"Nord\",\"model\":\"Chook air 5\",\"price\":815,\"description\":\"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.\",\"condition\":\"used\"}" </span></span><span class="line hl"><span class="cl">10) "bicycle:9" </span></span><span class="line hl"><span class="cl">11) 1) "price" </span></span><span class="line hl"><span class="cl"> 2) "815" </span></span><span class="line hl"><span class="cl"> 3) "$" </span></span><span class="line hl"><span class="cl"> 4) "{\"pickup_zone\":\"POLYGON((12.4464 42.1028, 12.5464 42.1028, 12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\",\"store_location\":\"12.4964,41.9028\",\"model\":\"ThrillCycle\",\"brand\":\"BikeShind\",\"price\":815,\"description\":\"An artsy, retro-inspired bicycle that\xe2\x80\x99s as functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn\xe2\x80\x99t suggest taking it to the mountains. Fenders protect you from mud, and a rear basket lets you transport groceries, flowers and books. The ThrillCycle comes with a limited lifetime warranty, so this little guy will last you long past graduation.\",\"condition\":\"refurbished\"}"</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_query_range-steprange4')" 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_query_range-steprange4" name="query_range-steprange4" 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_query_range-steprange4" title="Open example"> Python </label> <div aria-labelledby="tab-query_range-steprange4" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_query_range-steprange4" 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="kn">import</span> <span class="nn">json</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</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.json.path</span> <span class="kn">import</span> <span class="n">Path</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="n">TextField</span><span class="p">,</span> <span class="n">NumericField</span><span class="p">,</span> <span class="n">TagField</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">NumericFilter</span><span class="p">,</span> <span class="n">Query</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="n">r</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">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="c1"># create index</span> </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">"$.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">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">"$.condition"</span><span class="p">,</span> <span class="n">as_name</span><span class="o">=</span><span class="s2">"condition"</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">index</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ft</span><span class="p">(</span><span class="s2">"idx:bicycle"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create_index</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span><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">"bicycle:"</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="p">)</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1"># load data</span> </span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_em.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</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">r</span><span class="o">.</span><span class="n">pipeline</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">bid</span><span class="p">,</span> <span class="n">bicycle</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">bicycles</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="sa">f</span><span class="s1">'bicycle:</span><span class="si">{</span><span class="n">bid</span><span class="si">}</span><span class="s1">'</span><span class="p">,</span> <span class="n">Path</span><span class="o">.</span><span class="n">root_path</span><span class="p">(),</span> <span class="n">bicycle</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></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</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="s2">"@price:[500 1000]"</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</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">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="mi">500</span><span class="p">,</span> <span class="mi">1000</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 3</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">"*"</span><span class="p">)</span><span class="o">.</span><span class="n">add_filter</span><span class="p">(</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s2">"price"</span><span class="p">,</span> <span class="s2">"(1000"</span><span class="p">,</span> <span class="s2">"+inf"</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</span><span class="p">)</span> </span></span><span class="line"><span class="cl"><span class="c1"># &gt;&gt;&gt; 5</span> </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="n">Query</span><span class="p">(</span><span class="s1">'@price:[-inf 2000]'</span><span class="p">)</span><span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s1">'price'</span><span class="p">)</span><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">5</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">index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</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">res</span><span class="o">.</span><span class="n">total</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">res</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"><span class="c1"># &gt;&gt;&gt; Result{7 total, docs: [Document {'id': 'bicycle:0', ... }, Document {'id': 'bicycle:7', ... }, Document {'id': 'bicycle:5', ... }, ...]</span> </span></span><span class="line"><span class="cl"> </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_query_range-steprange4')" 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_query_range-steprange4" 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/query_range.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> <input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_query_range-steprange4" name="query_range-steprange4" 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="Nodejs_query_range-steprange4" title="Open example"> Node.js </label> <div aria-labelledby="tab-query_range-steprange4" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_range-steprange4" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span><span class="p">,</span> <span class="nx">SchemaFieldTypes</span><span class="p">,</span> <span class="nx">AggregateGroupByReducers</span><span class="p">,</span> <span class="nx">AggregateSteps</span><span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="c1">// create index </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.description'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'description'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.price'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">NUMERIC</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'price'</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="s1">'$.condition'</span><span class="o">:</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TAG</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'condition'</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="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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">// load data </span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_em.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=&gt;</span> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="s1">'@price:[500 1000]'</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 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">// FILTER is not supported </span></span></span><span class="line"><span class="cl"><span class="c1">// const res2 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line"><span class="cl"><span class="c1">// min: 500, </span></span></span><span class="line"><span class="cl"><span class="c1">// max: 1000, </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">// console.log(res2.total); // &gt;&gt;&gt; 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">// FILTER is not supported </span></span></span><span class="line"><span class="cl"><span class="c1">// const res3 = await client.ft.search('idx:bicycle', '*', { </span></span></span><span class="line"><span class="cl"><span class="c1">// FILTER: { </span></span></span><span class="line"><span class="cl"><span class="c1">// field: 'price', </span></span></span><span class="line"><span class="cl"><span class="c1">// min: '(1000', </span></span></span><span class="line"><span class="cl"><span class="c1">// max: '+inf, </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">// console.log(res3.total); // &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s1">'idx:bicycle'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s1">'@price:[-inf 2000]'</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="nx">SORTBY</span><span class="o">:</span> <span class="s1">'price'</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="nx">LIMIT</span><span class="o">:</span> <span class="p">{</span> <span class="nx">from</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">size</span><span class="o">:</span> <span class="mi">5</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="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res4</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; { total: 7, documents: [ { id: 'bicycle:0', value: [Object: null prototype] }, { id: 'bicycle:7', value: [Object: null prototype] }, { id: 'bicycle:5', value: [Object: null prototype] }, { id: 'bicycle:2', value: [Object: null prototype] }, { id: 'bicycle:9', value: [Object: null prototype] } ] } </span></span></span><span class="line"><span class="cl"><span class="c1"></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_Nodejs_query_range-steprange4')" 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_Nodejs_query_range-steprange4" 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/nodejs/" tabindex="1" title="Quick-Start"> Node.js 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/node-redis/tree/emb-examples/doctests/query-range.js" 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> <input class="radiotab w-0 h-0" data-lang="java" id="Java_query_range-steprange4" name="query_range-steprange4" 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="Java_query_range-steprange4" title="Open example"> Java </label> <div aria-labelledby="tab-query_range-steprange4" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_query_range-steprange4" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</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">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.search.schemafields.*</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.exceptions.JedisDataException</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.json.Path2</span><span class="o">;</span> </span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.args.SortingOrder</span><span class="o">;</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="kd">public</span> <span class="kd">class</span> <span class="nc">QueryRangeExample</span> <span class="o">{</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="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</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">SchemaField</span><span class="o">[]</span> <span class="n">schema</span> <span class="o">=</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.brand"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"brand"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.model"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"model"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TextField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.description"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"description"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">NumericField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.price"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"price"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">TagField</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"$.condition"</span><span class="o">).</span><span class="na">as</span><span class="o">(</span><span class="s">"condition"</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></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">ftCreate</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span><span class="o">.</span><span class="na">createParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">on</span><span class="o">(</span><span class="n">IndexDataType</span><span class="o">.</span><span class="na">JSON</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">addPrefix</span><span class="o">(</span><span class="s">"bicycle:"</span><span class="o">),</span> </span></span><span class="line"><span class="cl"> <span class="n">schema</span> </span></span><span class="line"><span class="cl"> <span class="o">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">bicycleJsons</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-74.0610 40.6678, -74.0610 40.7578))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-74.0060,40.7128\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Velorim\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Jigger\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 270,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"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="o">+</span> <span class="s">"This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"is the vehicle of choice for the rare tenacious little rider raring to go.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-118.2887 33.9872, -118.2887 34.0972))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-118.2437,34.0522\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Bicyk\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Hillcraft\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Kids want to ride with as little weight as possible. Especially "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on an incline! They may be at the age when a 27.5'' wheel bike is just too clumsy coming "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"off a 24'' bike. The Hillcraft 26 is just the solution they need!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-87.6848 41.8231, -87.6848 41.9331))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-87.6298,41.8781\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Nord\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Chook air 5\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The Chook Air 5 gives kids aged six years and older a durable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and uberlight mountain bike for their first experience on tracks and easy cruising through "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"forests and fields. The lower top tube makes it easy to mount and dismount in any "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"situation, giving your kids greater safety on the trails.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-80.2433 25.8067, -80.1333 25.8067, -80.1333 25.6967, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-80.2433 25.6967, -80.2433 25.8067))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-80.1918,25.7617\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Eva\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Eva 291\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3400,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The sister company to Nord, Eva launched in 2005 as the first "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and only women-dedicated bicycle brand. Designed by women for women, allEva bikes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"are optimized for the feminine physique using analytics from a body metrics database. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"If you like 29ers, try the Eva 291. It’s a brand new bike for 2022.. This "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"full-suspension, cross-country ride has been designed for velocity. The 291 has "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"100mm of front and rear travel, a superlight aluminum frame and fast-rolling "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"29-inch wheels. Yippee!\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-122.4644 37.8199, -122.3544 37.8199, -122.3544 37.7099, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-122.4644 37.7099, -122.4644 37.8199))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-122.4194,37.7749\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Noka Bikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Kahuna\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 3200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"Whether you want to try your hand at XC racing or are looking "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"for a lively trail bike that's just as inspiring on the climbs as it is over rougher "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ground, the Wilder is one heck of a bike built specifically for short women. Both the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"frames and components have been tweaked to include a women’s saddle, different bars "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"and unique colourway.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"used\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((-0.1778 51.5524, 0.0822 51.5524, 0.0822 51.4024, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"-0.1778 51.4024, -0.1778 51.5524))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"-0.1278,51.5074\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Breakout\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"XBN 2.1 Alloy\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 810,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The XBN 2.1 Alloy is our entry-level road bike – but that’s "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"not to say that it’s a basic machine. With an internal weld aluminium frame, a full "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"carbon fork, and the slick-shifting Claris gears from Shimano’s, this is a bike which "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"doesn’t break the bank and delivers craved performance.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((2.1767 48.9016, 2.5267 48.9016, 2.5267 48.5516, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"2.1767 48.5516, 2.1767 48.9016))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.3522,48.8566\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"ScramBikes\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"WattBike\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 2300,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"The WattBike is the best e-bike for people who still "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"feel young at heart. It has a Bafang 1000W mid-drive system and a 48V 17.5AH "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Samsung Lithium-Ion battery, allowing you to ride for more than 60 miles on one "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"charge. It’s great for tackling hilly terrain or if you just fancy a more "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"leisurely ride. With three working modes, you can choose between E-bike, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"assisted bicycle, and normal bike modes.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((13.3260 52.5700, 13.6550 52.5700, 13.6550 52.2700, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"13.3260 52.2700, 13.3260 52.5700))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"13.4050,52.5200\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"Peaknetic\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Secto\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 430,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"If you struggle with stiff fingers or a kinked neck or "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"back after a few minutes on the road, this lightweight, aluminum bike alleviates "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"those issues and allows you to enjoy the ride. From the ergonomic grips to the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"lumbar-supporting seat position, the Roll Low-Entry offers incredible comfort. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The rear-inclined seat tube facilitates stability by allowing you to put a foot "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on the ground to balance at a stop, and the low step-over frame makes it "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"accessible for all ability and mobility levels. The saddle is very soft, with "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"a wide back to support your hip joints and a cutout in the center to redistribute "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"that pressure. Rim brakes deliver satisfactory braking control, and the wide tires "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"provide a smooth, stable ride on paved roads and gravel. Rack and fender mounts "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"facilitate setting up the Roll Low-Entry as your preferred commuter, and the "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"BMX-like handlebar offers space for mounting a flashlight, bell, or phone holder.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((1.9450 41.4301, 2.4018 41.4301, 2.4018 41.1987, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"1.9450 41.1987, 1.9450 41.4301))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"2.1734, 41.3851\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"nHill\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"Summit\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 1200,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"This budget mountain bike from nHill performs well both "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"on bike paths and on the trail. The fork with 100mm of travel absorbs rough "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"terrain. Fat Kenda Booster tires give you grip in corners and on wet trails. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"The Shimano Tourney drivetrain offered enough gears for finding a comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"pace to ride uphill, and the Tektro hydraulic disc brakes break smoothly. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"Whether you want an affordable bike that you can take to work, but also take "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"trail in mountains on the weekends or you’re just after a stable, comfortable "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"ride for the bike path, the Summit gives a good value for money.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"new\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="s">" {"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"pickup_zone\": \"POLYGON((12.4464 42.1028, 12.5464 42.1028, "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"12.5464 41.7028, 12.4464 41.7028, 12.4464 42.1028))\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"store_location\": \"12.4964,41.9028\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"model\": \"ThrillCycle\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"brand\": \"BikeShind\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"price\": 815,"</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"description\": \"An artsy, retro-inspired bicycle that’s as "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"functional as it is pretty: The ThrillCycle steel frame offers a smooth ride. "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"A 9-speed drivetrain has enough gears for coasting in the city, but we wouldn’t "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"suggest taking it to the mountains. Fenders protect you from mud, and a rear "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"basket lets you transport groceries, flowers and books. The ThrillCycle comes "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"with a limited lifetime warranty, so this little guy will last you long "</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">"past graduation.\","</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" \"condition\": \"refurbished\""</span> </span></span><span class="line"><span class="cl"> <span class="o">+</span> <span class="s">" }"</span> </span></span><span class="line"><span class="cl"> <span class="o">};</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">bicycleJsons</span><span class="o">.</span><span class="na">length</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">jsonSet</span><span class="o">(</span><span class="s">"bicycle:"</span> <span class="o">+</span> <span class="n">i</span><span class="o">,</span> <span class="n">Path2</span><span class="o">.</span><span class="na">ROOT_PATH</span><span class="o">,</span> <span class="n">bicycleJsons</span><span class="o">[</span><span class="n">i</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></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="o">,</span> <span class="s">"@price:[500 1000]"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">().</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res1</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs1</span> <span class="o">=</span> <span class="n">res1</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs1</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step. </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">SearchResult</span> <span class="n">res2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">500</span><span class="o">,</span> <span class="mi">1000</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res2</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 3 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs2</span> <span class="o">=</span> <span class="n">res2</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs2</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step. </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">SearchResult</span> <span class="n">res3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="s">"*"</span><span class="o">,</span> </span></span><span class="line"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="mi">1000</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="n">Double</span><span class="o">.</span><span class="na">POSITIVE_INFINITY</span><span class="o">,</span> <span class="kc">false</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="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res3</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 5 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs3</span> <span class="o">=</span> <span class="n">res3</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs3</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</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="c1">// &gt;&gt;&gt; bicycle:1 : price 1200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:4 : price 3200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:6 : price 2300 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:3 : price 3400 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:8 : price 1200 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step. </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">SearchResult</span> <span class="n">res4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ftSearch</span><span class="o">(</span><span class="s">"idx:bicycle"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"@price:[-inf 2000]"</span><span class="o">,</span> </span></span><span class="line hl"><span class="cl"> <span class="n">FTSearchParams</span><span class="o">.</span><span class="na">searchParams</span><span class="o">()</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">returnFields</span><span class="o">(</span><span class="s">"price"</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">sortBy</span><span class="o">(</span><span class="s">"price"</span><span class="o">,</span> <span class="n">SortingOrder</span><span class="o">.</span><span class="na">ASC</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">.</span><span class="na">limit</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">5</span><span class="o">)</span> </span></span><span class="line hl"><span class="cl"> <span class="o">);</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">res4</span><span class="o">.</span><span class="na">getTotalResults</span><span class="o">());</span> <span class="c1">// &gt;&gt;&gt; 7 </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="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">docs4</span> <span class="o">=</span> <span class="n">res4</span><span class="o">.</span><span class="na">getDocuments</span><span class="o">();</span> </span></span><span class="line hl"><span class="cl"> </span></span><span class="line hl"><span class="cl"> <span class="k">for</span> <span class="o">(</span><span class="n">Document</span> <span class="n">document</span> <span class="o">:</span> <span class="n">docs4</span><span class="o">)</span> <span class="o">{</span> </span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">document</span><span class="o">.</span><span class="na">getId</span><span class="o">()</span> <span class="o">+</span> <span class="s">" : price "</span> <span class="o">+</span> <span class="n">document</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="s">"price"</span><span class="o">));</span> </span></span><span class="line hl"><span class="cl"> <span class="o">}</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; bicycle:0 : price 270 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:7 : price 430 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:5 : price 810 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:2 : price 815 </span></span></span><span class="line hl"><span class="cl"><span class="c1"></span> <span class="c1">// &gt;&gt;&gt; bicycle:9 : price 815 </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step. </span></span></span><span class="line"><span class="cl"><span class="c1"></span> </span></span><span class="line"><span class="cl"> <span class="n">jedis</span><span class="o">.</span><span class="na">close</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></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_Java_query_range-steprange4')" 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_Java_query_range-steprange4" 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/java/jedis/" tabindex="1" title="Quick-Start"> Java 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/jedis/tree/master/src/test/java/io/redis/examples/QueryRangeExample.java" 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> <input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_query_range-steprange4" name="query_range-steprange4" 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="Csharp_query_range-steprange4" title="Open example"> C# </label> <div aria-labelledby="tab-query_range-steprange4" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_query_range-steprange4" role="tabpanel" tabindex="0"> <div class="highlight"> <pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.RedisStackCommands</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Search.Literals.Enums</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</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="k">public</span> <span class="k">class</span> <span class="nc">QueryRangeExample</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="k">public</span> <span class="k">void</span> <span class="n">run</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="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">Schema</span> <span class="n">bikeSchema</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Schema</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTextField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.description"</span><span class="p">,</span> <span class="s">"description"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddNumericField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.price"</span><span class="p">,</span> <span class="s">"price"</span><span class="p">))</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddTagField</span><span class="p">(</span><span class="k">new</span> <span class="n">FieldName</span><span class="p">(</span><span class="s">"$.condition"</span><span class="p">,</span> <span class="s">"condition"</span><span class="p">));</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="n">FTCreateParams</span> <span class="n">bikeParams</span> <span class="p">=</span> <span class="k">new</span> <span class="n">FTCreateParams</span><span class="p">()</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">AddPrefix</span><span class="p">(</span><span class="s">"bicycle:"</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="p">.</span><span class="n">On</span><span class="p">(</span><span class="n">IndexDataType</span><span class="p">.</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">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Create</span><span class="p">(</span><span class="s">"idx:bicycle"</span><span class="p">,</span> <span class="n">bikeParams</span><span class="p">,</span> <span class="n">bikeSchema</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">bicycles</span> <span class="p">=</span> <span class="k">new</span> <span class="kt">object</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Velorim"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Jigger"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">270</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Small and powerful, the Jigger is the best ride "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"for the smallest of tikes! This is the tiniest "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"kids’ pedal bike on the market available without"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a coaster brake, the Jigger is the vehicle of "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"choice for the rare tenacious little rider "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"raring to go."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</span> </span></span><span class="line"><span class="cl"> <span class="p">},</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Bicyk"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Hillcraft"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Kids want to ride with as little weight as possible."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Especially on an incline! They may be at the age "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"when a 27.5 inch wheel bike is just too clumsy coming "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"off a 24 inch bike. The Hillcraft 26 is just the solution"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" they need!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Nord"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Chook air 5"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The Chook Air 5 gives kids aged six years and older "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"a durable and uberlight mountain bike for their first"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" experience on tracks and easy cruising through forests"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and fields. The lower top tube makes it easy to mount"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and dismount in any situation, giving your kids greater"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" safety on the trails."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Eva"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Eva 291"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3400</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The sister company to Nord, Eva launched in 2005 as the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" first and only women-dedicated bicycle brand. Designed"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" by women for women, allEva bikes are optimized for the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" feminine physique using analytics from a body metrics"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" database. If you like 29ers, try the Eva 291. It’s a "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"brand new bike for 2022.. This full-suspension, "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"cross-country ride has been designed for velocity. The"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 291 has 100mm of front and rear travel, a superlight "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"aluminum frame and fast-rolling 29-inch wheels. Yippee!"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Noka Bikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Kahuna"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">3200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"Whether you want to try your hand at XC racing or are "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"looking for a lively trail bike that's just as inspiring"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" on the climbs as it is over rougher ground, the Wilder"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" is one heck of a bike built specifically for short women."</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Both the frames and components have been tweaked to "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"include a women’s saddle, different bars and unique "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"colourway."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"used"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Breakout"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"XBN 2.1 Alloy"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">810</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The XBN 2.1 Alloy is our entry-level road bike – but that’s"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" not to say that it’s a basic machine. With an internal "</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">"weld aluminium frame, a full carbon fork, and the slick-shifting"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Claris gears from Shimano’s, this is a bike which doesn’t"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" break the bank and delivers craved performance."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"ScramBikes"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"WattBike"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">2300</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"The WattBike is the best e-bike for people who still feel young"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" at heart. It has a Bafang 1000W mid-drive system and a 48V"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 17.5AH Samsung Lithium-Ion battery, allowing you to ride for"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" more than 60 miles on one charge. It’s great for tackling hilly"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" terrain or if you just fancy a more leisurely ride. With three"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" working modes, you can choose between E-bike, assisted bicycle,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and normal bike modes."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"Peaknetic"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Secto"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">430</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"If you struggle with stiff fingers or a kinked neck or back after"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a few minutes on the road, this lightweight, aluminum bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" alleviates those issues and allows you to enjoy the ride. From"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" the ergonomic grips to the lumbar-supporting seat position, the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Roll Low-Entry offers incredible comfort. The rear-inclined seat"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" tube facilitates stability by allowing you to put a foot on the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" ground to balance at a stop, and the low step-over frame makes it"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" accessible for all ability and mobility levels. The saddle is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" very soft, with a wide back to support your hip joints and a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" cutout in the center to redistribute that pressure. Rim brakes"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" deliver satisfactory braking control, and the wide tires provide"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" a smooth, stable ride on paved roads and gravel. Rack and fender"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mounts facilitate setting up the Roll Low-Entry as your preferred"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" commuter, and the BMX-like handlebar offers space for mounting a"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flashlight, bell, or phone holder."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"nHill"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"Summit"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">1200</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"This budget mountain bike from nHill performs well both on bike"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" paths and on the trail. The fork with 100mm of travel absorbs"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" rough terrain. Fat Kenda Booster tires give you grip in corners"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" and on wet trails. The Shimano Tourney drivetrain offered enough"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" gears for finding a comfortable pace to ride uphill, and the"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" Tektro hydraulic disc brakes break smoothly. Whether you want an"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" affordable bike that you can take to work, but also take trail in"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" mountains on the weekends or you’re just after a stable,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" comfortable ride for the bike path, the Summit gives a good value"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" for money."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"new"</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="k">new</span> </span></span><span class="line"><span class="cl"> <span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="n">model</span> <span class="p">=</span> <span class="s">"ThrillCycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">brand</span> <span class="p">=</span> <span class="s">"BikeShind"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">price</span> <span class="p">=</span> <span class="m">815</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">description</span> <span class="p">=</span> <span class="s">"An artsy, retro-inspired bicycle that’s as functional as it is"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" pretty: The ThrillCycle steel frame offers a smooth ride. A"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" 9-speed drivetrain has enough gears for coasting in the city, but"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" we wouldn’t suggest taking it to the mountains. Fenders protect"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" you from mud, and a rear basket lets you transport groceries,"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" flowers and books. The ThrillCycle comes with a limited lifetime"</span> <span class="p">+</span> </span></span><span class="line"><span class="cl"> <span class="s">" warranty, so this little guy will last you long past graduation."</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="n">condition</span> <span class="p">=</span> <span class="s">"refurbished"</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="k">for</span> <span class="p">(</span><span class="kt">var</span> <span class="n">i</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span> <span class="n">i</span> <span class="p">&lt;</span> <span class="n">bicycles</span><span class="p">.</span><span class="n">Length</span><span class="p">;</span> <span class="n">i</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">db</span><span class="p">.</span><span class="n">JSON</span><span class="p">().</span><span class="n">Set</span><span class="p">(</span><span class="s">$"bicycle:{i}"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="n">bicycles</span><span class="p">[</span><span class="n">i</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></span><span class="line"><span class="cl"> <span class="n">SearchResult</span> <span class="n">res1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[500 1000]"</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res1</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range1' step.</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">SearchResult</span> <span class="n">res2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">().</span><span class="n">AddFilter</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span><span class="s">"price"</span><span class="p">,</span> <span class="m">500</span><span class="p">,</span> <span class="m">1000</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res2</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 3</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range2' step.</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">SearchResult</span> <span class="n">res3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"*"</span><span class="p">).</span><span class="n">AddFilter</span><span class="p">(</span><span class="k">new</span> <span class="n">Query</span><span class="p">.</span><span class="n">NumericFilter</span><span class="p">(</span> </span></span><span class="line"><span class="cl"> <span class="s">"price"</span><span class="p">,</span> <span class="m">1000</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="n">Double</span><span class="p">.</span><span class="n">PositiveInfinity</span><span class="p">,</span> <span class="k">false</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="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res3</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 5</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range3' step.</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">SearchResult</span> <span class="n">res4</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">FT</span><span class="p">().</span><span class="n">Search</span><span class="p">(</span> </span></span><span class="line hl"><span class="cl"> <span class="s">"idx:bicycle"</span><span class="p">,</span> </span></span><span class="line hl"><span class="cl"> <span class="k">new</span> <span class="n">Query</span><span class="p">(</span><span class="s">"@price:[-inf 2000]"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">.</span><span class="n">SetSortBy</span><span class="p">(</span><span class="s">"price"</span><span class="p">)</span> </span></span><span class="line hl"><span class="cl"> <span class="p">.</span><span class="n">Limit</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">5</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">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">res4</span><span class="p">.</span><span class="n">TotalResults</span><span class="p">);</span> <span class="c1">// &gt;&gt;&gt; 7</span> </span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">$"Prices: {string.Join("</span><span class="p">,</span> <span class="s">", res4.Documents.Select(d =&gt; d["</span><span class="n">price</span><span class="s">"]))}"</span><span class="p">);</span> </span></span><span class="line hl"><span class="cl"> <span class="c1">// &gt;&gt;&gt; Prices: 270, 430, 810, 815, 815</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'range4' step.</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="p">}</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span><span class="line"><span class="cl"> </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_Csharp_query_range-steprange4')" 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_Csharp_query_range-steprange4" 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/dotnet/" tabindex="1" title="Quick-Start"> C# 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/NRedisStack/tree/master/tests/Doc/QueryRangeExample.cs" 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="non-numeric-range-queries"> Non-numeric range queries </h2> <p> You can learn more about non-numeric range queries, such as <a href="/docs/latest/develop/interact/search-and-query/query/geo-spatial/"> geospatial </a> or <a href="/docs/latest/develop/interact/search-and-query/query/vector-search/"> vector search </a> queries, in their dedicated articles. </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/search-and-query/query/range/"/> <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/6-4-2-releases/6-4-2-8-dec23/.html
<section class="prose w-full py-12 max-w-none"> <h1> Redis Enterprise for Kubernetes release notes 6.4.2-8 (Dec 2023) </h1> <p class="text-lg -mt-5 mb-10"> The Redis Enterprise K8s 6.4.2-8 release supports Redis Enterprise Software 6.4.2 and contains new features and feature improvements. </p> <h2 id="overview"> Overview </h2> <p> This is a maintenance release of Redis Enterprise for Kubernetes version 6.4.2-8 and includes an updated Redis Enterprise image. </p> <h2 id="new-in-this-release"> New in this release </h2> <h3 id="feature-enhancements"> Feature enhancements </h3> <ul> <li> New Redis Enterprise software version 6.4.2-103 </li> </ul> <h2 id="upgrade-considerations"> Upgrade considerations </h2> <p> Be aware the following changes included in this release affect the upgrade process. Please read carefully before upgrading to 6.4.2-8. </p> <ul> <li> <p> <strong> Upgrade path to versions 7.2.4-2 or later </strong> </p> <p> Upgrading from this versions 7.2.4-2 or 7.2.4-7 is not possible using the OpenShift Operator Lifecycle Manager (OLM). OLM users will need to skip to version 7.2.4-10 to upgrade from this release version. </p> </li> <li> <p> <strong> ValidatingWebhookConfiguration </strong> </p> <p> This release uses 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> </li> <li> <p> <strong> OpenShift SCC </strong> </p> <p> This release includes a new SCC ( <code> redis-enterprise-scc-v2 </code> ) that you need to bind to your service account before upgrading. OpenShift clusters running version 6.2.12 or earlier upgrading to version 6.2.18 or later might get stuck if you skip this step. See <a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#before-upgrading"> upgrade a Redis Enterprise cluster (REC) </a> for expand. </p> </li> </ul> <h2 id="compatibility"> Compatibility </h2> <p> See <a href="/docs/latest/operate/kubernetes/release-notes/6-4-2-releases/6-4-2-8/#compatibility"> 6.4.2-8 (July 2023) release notes </a> . </p> <h3 id="images"> Images </h3> <ul> <li> <strong> Redis Enterprise </strong> : <code> redislabs/redis:6.4.2-103 </code> </li> <li> <strong> Operator </strong> : <code> redislabs/operator:6.4.2-8 </code> </li> <li> <strong> Services Rigger </strong> : <code> redislabs/k8s-controller:6.4.2-8. </code> </li> </ul> <h4 id="openshift-images"> OpenShift images </h4> <ul> <li> <strong> Redis Enterprise </strong> : <code> registry.connect.redhat.com/redislabs/redis-enterprise:6.4.2-103.rhel8-openshift </code> (or <code> redislabs/redis-enterprise:6.4.2-103.rhel7-openshift </code> if upgrading from RHEL 7) </li> <li> <strong> Operator </strong> : <code> registry.connect.redhat.com/redislabs/redis-enterprise-operator:6.4.2-8 </code> </li> <li> <strong> Services Rigger </strong> : <code> registry.connect.redhat.com/redislabs/services-manager:6.4.2-8 </code> </li> </ul> <h4 id="olm-bundle"> OLM bundle </h4> <ul> <li> <strong> Redis Enterprise operator bundle </strong> : <code> v6.4.2-8.1 </code> </li> </ul> <h2 id="known-limitations"> Known limitations </h2> <p> See <a href="/docs/latest/operate/kubernetes/release-notes/6-4-2-releases/6-4-2-8/#known-limitations"> 6.4.2-8 (July 2023) release notes </a> . </p> <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-6-4-2-releases/rs-6-4-2-103/"> Redis Enterprise 6.4.2-103 release notes </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/kubernetes/release-notes/6-4-2-releases/6-4-2-8-dec23/"/> <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-help/.html
<section class="prose w-full py-12"> <h1 class="command-name"> SCRIPT HELP </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">SCRIPT HELP</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"> 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> <code> @scripting </code> <span class="mr-1 last:hidden"> , </span> </dd> </dl> <p> The <code> SCRIPT HELP </code> command returns a helpful text describing the different subcommands. </p> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : a list of sub-commands and their descriptions. <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/script-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/commands/acl-list/.html
<section class="prose w-full py-12"> <h1 class="command-name"> ACL LIST </h1> <div class="font-semibold text-redis-ink-900"> Syntax </div> <pre class="command-syntax">ACL LIST</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(N). Where N is the number of configured users. </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 command shows the currently active ACL rules in the Redis server. Each line in the returned array defines a different user, and the format is the same used in the redis.conf file or the external ACL file, so you can cut and paste what is returned by the ACL LIST command directly inside a configuration file if you wish (but make sure to check <a href="/docs/latest/commands/acl-save/"> <code> ACL SAVE </code> </a> ). </p> <h2 id="examples"> Examples </h2> <pre tabindex="0"><code>&gt; ACL LIST 1) "user antirez on #9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 ~objects:* &amp;* +@all -@admin -@dangerous" 2) "user default on nopass ~* &amp;* +@all" </code></pre> <h2 id="resp2resp3-reply"> RESP2/RESP3 Reply </h2> <a href="../../develop/reference/protocol-spec#arrays"> Array reply </a> : an array of <a href="../../develop/reference/protocol-spec#bulk-strings"> Bulk string reply </a> elements. <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-list/"/> <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/shard/.html
<section class="prose w-full py-12 max-w-none"> <h1> Shard object </h1> <p class="text-lg -mt-5 mb-10"> An object that represents a database shard </p> <p> An API object that represents a Redis shard in a database. </p> <table> <thead> <tr> <th> Name </th> <th> Type/Value </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> uid </td> <td> string </td> <td> Cluster unique ID of shard </td> </tr> <tr> <td> assigned_slots </td> <td> string </td> <td> Shards hash slot range </td> </tr> <tr> <td> backup </td> <td> <a href="/docs/latest/operate/rs/references/rest-api/objects/shard/backup/"> backup </a> object </td> <td> Current status of scheduled periodic backup process </td> </tr> <tr> <td> bdb_uid </td> <td> integer </td> <td> The ID of the database this shard belongs to </td> </tr> <tr> <td> bigstore_ram_weight </td> <td> number </td> <td> Shards RAM distribution weight </td> </tr> <tr> <td> detailed_status </td> <td> 'busy' <br/> 'down' <br/> 'importing' <br/> 'loading' <br/> 'ok' <br/> 'timeout' <br/> 'trimming' <br/> 'unknown' </td> <td> A more detailed status of the shard </td> </tr> <tr> <td> loading </td> <td> <a href="/docs/latest/operate/rs/references/rest-api/objects/shard/loading/"> loading </a> object </td> <td> Current status of dump file loading </td> </tr> <tr> <td> node_uid </td> <td> string </td> <td> The ID of the node this shard is located on </td> </tr> <tr> <td> redis_info </td> <td> redis_info object </td> <td> A sub-dictionary of the <a href="/docs/latest/commands/info/"> Redis INFO command </a> </td> </tr> <tr> <td> report_timestamp </td> <td> string </td> <td> The time in which the shard's info was collected (read-only) </td> </tr> <tr> <td> role </td> <td> 'master' <br/> 'slave' </td> <td> Role of this shard </td> </tr> <tr> <td> status </td> <td> 'active' <br/> 'inactive' <br/> 'trimming' </td> <td> The current status of the shard </td> </tr> <tr> <td> sync </td> <td> <a href="/docs/latest/operate/rs/references/rest-api/objects/shard/sync/"> sync </a> object </td> <td> Shard's current sync status and progress </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/shard/"/> <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.8-release-notes/.html
<section class="prose w-full py-12 max-w-none"> <h1> RedisTimeSeries 1.8 release notes </h1> <p class="text-lg -mt-5 mb-10"> Added a time-weighted average aggregator, gap filling, ability to control bucket timestamps, ability to control alignment for compaction rules, new reducer types, and ability to include the latest (possibly partial) raw bucket samples when retrieving compactions </p> <h2 id="requirements"> Requirements </h2> <p> RedisTimeSeries v1.8.13 requires: </p> <ul> <li> Minimum Redis compatibility version (database): 6.0.16 </li> <li> Minimum Redis Enterprise Software version (cluster): 6.2.8 </li> </ul> <h2 id="v1813-march-2024"> v1.8.13 (March 2024) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8. </p> <p> Update urgency: <code> LOW </code> : No need to upgrade unless there are new features you want to use. </p> <h3 id="details"> Details </h3> <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> </ul> </li> <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="v1812-december-2023"> v1.8.12 (December 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8. </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> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1494"> #1494 </a> Potential crash when using an invalid argument value </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1516"> #1516 </a> Added support for CBL-Mariner 2 </li> </ul> </li> </ul> <h2 id="v1811-july-2023"> v1.8.11 (July 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8. </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/RedisTimeSeries/RedisTimeSeries/issues/1486"> #1486 </a> When using <code> LATEST </code> , results may contain samples earlier than <code> fromTimestamp </code> ( <code> TS.RANGE </code> , <code> TS.REVRANGE </code> , <code> TS.MRANGE </code> , and <code> TS.MREVRANGE </code> ) </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1471"> #1471 </a> Potential crash on <code> TS.MRANGE </code> when aggregating millions of time series </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1469"> #1469 </a> Potential memory leak in <code> TS.MRANGE </code> after eviction </li> </ul> </li> <li> <p> Performance enhancements: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1476"> #1476 </a> Significant performance improvement when using multiple label filters ( <code> TS.MGET </code> , <code> TS.MRANGE </code> , <code> TS.MREVRANGE </code> , and <code> TS.QUERYINDEX </code> ) (MOD-5338) </li> </ul> </li> </ul> <h2 id="v1810-april-2023"> v1.8.10 (April 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8. </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/RedisTimeSeries/RedisTimeSeries/issues/1455"> #1455 </a> <code> TS.ADD </code> - optional arguments are not replicated (MOD-5110) </li> </ul> </li> </ul> <h2 id="v189-march-2023"> v1.8.9 (March 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8. </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/RedisTimeSeries/RedisTimeSeries/issues/1421"> #1421 </a> Potential crash after deleting from a time series with an <code> AVG </code> compaction (MOD-4972) </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1422"> #1422 </a> Incorrectly return an error when deleting from a time series with a compaction and with no expiry </li> </ul> </li> </ul> <h2 id="v188-march-2023"> v1.8.8 (March 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8 </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/RedisTimeSeries/RedisTimeSeries/issues/1290"> #1290 </a> Potential crash when using <code> FILTER_BY_TS </code> </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1397"> #1397 </a> Memory leak when trying to create an already existing key (MOD-4724, RED-93418) </li> </ul> </li> </ul> <h2 id="v185-january-2023"> v1.8.5 (January 2023) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1388"> #1388 </a> Potential crash when upgrading from v1.6 to 1.8 if there are compactions with <code> min </code> or <code> max </code> aggregation (MOD-4695) </li> </ul> </li> </ul> <h2 id="v184-december-2022"> v1.8.4 (December 2022) </h2> <p> This is a maintenance release for RedisTimeSeries 1.8. </p> <p> Update urgency: <code> HIGH </code> : There is a critical bug that may affect a subset of users. Upgrade! </p> <p> Details: </p> <ul> <li> <p> Bug fixes: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1360"> #1360 </a> Potential crash when upgrading from v1.6 to 1.8 if there are compactions with <code> min </code> or <code> max </code> aggregation (MOD-4559) </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1370"> #1370 </a> Potential crash when using <a href="/docs/latest/commands/ts.revrange"> TS.REVRANGE </a> or <a href="/docs/latest/commands/ts.mrevrange"> TS.MREVRANGE </a> with aggregation </li> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1347"> #1347 </a> When adding samples with <a href="/docs/latest/commands/ts.add"> TS.ADD </a> or <a href="/docs/latest/commands/ts.madd"> TS.MADD </a> using <code> * </code> as timestamp, the timestamp could differ between master and replica shards </li> </ul> </li> <li> <p> Improvements: </p> <ul> <li> <a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1215"> #1215 </a> OSS cluster: Support TLS and IPv6; introduce new configuration parameter: <a href="/docs/latest/develop/data-types/timeseries/configuration/#oss_global_password"> OSS_GLOBAL_PASSWORD </a> </li> </ul> </li> </ul> <h2 id="v18-ga-v183-november-2022"> v1.8 GA (v1.8.3) (November 2022) </h2> <p> This is the General Availability release of RedisTimeSeries 1.8. </p> <h3 id="highlights"> Highlights </h3> <p> RedisTimeSeries 1.8 introduces seven highly requested features, performance improvements, and bug fixes. </p> <h3 id="whats-new-in-18"> What's new in 1.8 </h3> <ul> <li> <p> <strong> Optionally retrieving aggregation results for the latest (still open) bucket for compactions </strong> </p> <p> Till version 1.8, when a time series is a compaction, <a href="/docs/latest/commands/ts.get"> TS.GET </a> , <a href="/docs/latest/commands/ts.mget"> TS.MGET </a> , <a href="/docs/latest/commands/ts.range"> TS.RANGE </a> , <a href="/docs/latest/commands/ts.revrange"> TS.REVRANGE </a> , <a href="/docs/latest/commands/ts.mrange"> TS.MRANGE </a> , <a href="/docs/latest/commands/ts.mrevrange"> TS.MREVRANGE </a> did not report the compacted value of the latest bucket. The reason is that the data in the latest bucket of a compaction is still partial. A bucket is ‘closed’ and compacted only upon the arrival of data that ‘opens’ a ‘new latest’ bucket. </p> <p> There are use cases, however, where the compaction of the latest bucket should be retrieved as well. For example, a user may want to receive the count of events since the start of the decade, and the retention period for raw data is only one month. Till version 1.8, the user would have to run two queries - one on a compaction and one on the latest raw data, and then sum the results. Since version 1.8, by specifying <code> LATEST </code> , it is possible to retrieve the latest (possibly partial) bucket as well. </p> <p> To report aggregations for the latest bucket, use the new optional <code> LATEST </code> flag to <a href="/docs/latest/commands/ts.get"> TS.GET </a> , <a href="/docs/latest/commands/ts.mget"> TS.MGET </a> , <a href="/docs/latest/commands/ts.range"> TS.RANGE </a> , <a href="/docs/latest/commands/ts.revrange"> TS.REVRANGE </a> , <a href="/docs/latest/commands/ts.mrange"> TS.MRANGE </a> , and <a href="/docs/latest/commands/ts.mrevrange"> TS.REVRANGE </a> . </p> </li> <li> <p> <strong> Optionally retrieving aggregation results for empty buckets </strong> </p> <p> The commands <a href="/docs/latest/commands/ts.range"> TS.RANGE </a> , <a href="/docs/latest/commands/ts.revrange"> TS.REVRANGE </a> , <a href="/docs/latest/commands/ts.mrange"> TS.MRANGE </a> , and <a href="/docs/latest/commands/ts.mrevrange"> TS.MREVRANGE </a> have an optional <code> [AGGREGATION aggregator bucketDuration] </code> parameter. When this parameter is specified, raw reports are aggregated per bucket. </p> <p> Till version 1.8, results were not reported for empty buckets. With <code> EMPTY </code> , it is now possible to report aggregations for empty buckets as well. </p> <p> The two primary reasons for wanting to retrieve values for empty buckets: </p> <ul> <li> <p> It is easier to align results from similar queries over multiple time series </p> </li> <li> <p> It is easier to use the retrieved results with some external tools (e.g., charting tools) </p> </li> </ul> <p> For the <code> sum </code> and <code> count </code> aggregators, the value 0 is reported for empty buckets. </p> <p> For the <code> min </code> , <code> max </code> , <code> range </code> , <code> avg </code> , <code> first </code> , <code> std.p </code> , and <code> std.s </code> aggregators, the value NaN (not a number) is reported. </p> <p> For the <code> last </code> aggregator and the new <code> twa </code> aggregator, the <code> EMPTY </code> flag is used for gap filling (see below). </p> <p> To report aggregations for empty buckets, use the new optional <code> EMPTY </code> flag in <a href="/docs/latest/commands/ts.range"> TS.RANGE </a> , <a href="/docs/latest/commands/ts.revrange"> TS.REVRANGE </a> , <a href="/docs/latest/commands/ts.mrange"> TS.MRANGE </a> , and <a href="/docs/latest/commands/ts.mrevrange"> TS.MREVRANGE </a> . </p> <p> Regardless of the values of <code> fromTimestamp </code> and <code> toTimestamp </code> , no data is reported for empty buckets that end before the earliest sample or begin after the latest sample in the time series. </p> </li> <li> <p> <strong> A new aggregator: time-weighted average </strong> </p> <p> When a time series holds discrete samples of a continuous signal (e.g., temperature), using <code> avg </code> to estimate the average value over a given timeframe would produce a good estimate only when the signal is sampled at constant intervals. If, however, samples are available at non-constant intervals (e.g., when some samples are missing), the <code> twa </code> aggregator produces a more accurate estimate by averaging samples over time instead of simply averaging the samples. </p> <a href="/docs/latest/images/modules/twa.png" sdata-lightbox="/images/modules/twa.png"> <img alt="A graph showing the difference between average and time-weighted average." src="/docs/latest/images/modules/twa.png"/> </a> <p> This is an extreme example: the signal in the diagram above has 4 samples in its ‘high’ value and 13 samples in its ‘low’ value. However, the period in each of those states is about the same. It is easy to see that the simple average (avg) of all the 17 samples does not represent the signal’s average over time. </p> <p> Time-weighted average ( <code> twa </code> ) adds weight to each sample. The weight is proportional to the time interval that the sample represents. In the diagram, the time-weighted average over the whole period assigns appropriate weight to each sample, so the result represents the signal’s average value over the whole period much more accurately. </p> </li> <li> <p> <strong> Gap filling: optionally interpolate or repeat last value for empty buckets </strong> </p> <p> Gap filling is performed when using <code> EMPTY </code> together with either <code> last </code> or <code> twa </code> aggregator. </p> <p> Using <code> EMPTY </code> with the <code> twa </code> aggregator allows us to estimate the average of a continuous signal even for buckets where no samples were collected (gap-filling). </p> <a href="/docs/latest/images/modules/GapFilling.png" sdata-lightbox="/images/modules/GapFilling.png"> <img alt="A graph that illustrates gap-filling." src="/docs/latest/images/modules/GapFilling.png"/> </a> <p> Consider we want to use <a href="/docs/latest/commands/ts.range"> TS.RANGE </a> to calculate the average value of each bucket (p1, p2, p3 in the diagram above). Using avg, the value reported for bucket p2 would be NaN, as this bucket contains no samples. If we use <code> EMPTY </code> with <code> twa </code> , on the other hand, the average value for bucket p2 would be calculated based on the linear interpolation of the value left of p2 and the value right of p2. </p> <p> When sampling a continuous signal, we can use this ‘gap-filling’ capability to calculate the average value of the signal over equal-width buckets without concern about bucket alignment or missing samples. </p> <p> Using <code> EMPTY </code> with the last aggregator allows filling empty buckets by repeating the value of the previous sample. This is useful, for example, when values in the time series represent stock prices and the price has not been changed during a bucket’s timeframe. </p> </li> <li> <p> <strong> Ability to control how bucket timestamps are reported </strong> </p> <p> Till version 1.8, <a href="/docs/latest/commands/ts.range"> TS.RANGE </a> , <a href="/docs/latest/commands/ts.revrange"> TS.REVRANGE </a> , <a href="/docs/latest/commands/ts.mrange"> TS.MRANGE </a> , and <a href="/docs/latest/commands/ts.mrevrange"> TS.MREVRANGE </a> returned the start time of each reported bucket as its timestamp. </p> <p> Changing this behavior and reporting each bucket’s start time, end time, or mid-time is now possible. This is required in many use cases. For example, when drawing bars in trading applications, annotating each bar with the end timestamp of the bucket it represents is very common. </p> <p> The way bucket timestamps are reported can be specified with the new optional <code> BUCKETTIMESTAMP </code> parameter of <a href="/docs/latest/commands/ts.range"> TS.RANGE </a> , <a href="/docs/latest/commands/ts.revrange"> TS.REVRANGE </a> , <a href="/docs/latest/commands/ts.mrange"> TS.MRANGE </a> , and <a href="/docs/latest/commands/ts.mrevrange"> TS.MREVRANGE </a> . </p> <p> <code> - </code> or <code> low </code> : the bucket's start time (default) </p> <p> <code> + </code> or <code> high </code> : the bucket's end time </p> <p> <code> ~ </code> or <code> mid </code> : the bucket's mid-time (rounded down if not an integer) </p> </li> <li> <p> <strong> Ability to control alignment for compaction rules </strong> </p> <p> Till version 1.8, compaction rules could not be aligned. One could specify a compaction rule with 24-hour buckets, and as a result, each bucket would aggregate events from midnight till the next midnight. The first bucket always started at the epoch and all other buckets were aligned accordingly. </p> <p> But what if we want to aggregate daily events from 06:00 to 06:00 the next day? We can now specify alignment for compaction rules. </p> <p> Alignment can be specified with the new optional <code> alignTimestamp </code> parameter of <a href="/docs/latest/commands/ts.createrule"> TS.CREATERULE </a> and the <a href="/docs/latest/develop/data-types/timeseries/configuration/"> COMPACTION_POLICY </a> configuration parameter. Specifying <code> alignTimestamp </code> ensures that there is a bucket that starts exactly at <code> alignTimestamp </code> and all other buckets are aligned accordingly. <code> alignTimestamp </code> is expressed in milliseconds. The default value is 0 (aligned with the epoch). </p> </li> <li> <p> <strong> New reducers </strong> </p> <p> Till version 1.8, only the <code> sum </code> , <code> min </code> , and <code> max </code> could be used as reducer types. </p> <p> It is now possible, for example, to calculate the maximal temperature per timeframe for each sensor and then report the average temperature (avg reducer) over groups of sensors (grouped by a given label's value). </p> <p> This can be specified with the new reducer types ( <a href="/docs/latest/commands/ts.mrange"> TS.MRANGE </a> and <a href="/docs/latest/commands/ts.mrevrange"> TS.MREVRANGE </a> : <code> avg </code> , <code> range </code> , <code> count </code> , <code> std.p </code> , <code> std.s </code> , <code> var.p </code> , and <code> var.s </code> . </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> New RDB version (v7). RDB files created with v1.8.3 are not backward compatible. </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.8-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>