Table of contents
1.
Introduction
2.
Overview of Commands
3.
Redis Search Commands
4.
Frequently Asked Questions
4.1.
How does RediSearch function?
4.2.
How many clients make Redis available?
4.3.
How is data stored in memory by Redis?
4.4.
How much demand can Redis support?
4.5.
Why is Redis so well-liked?
5.
Conclusion
Last Updated: Mar 27, 2024

Commands of Search in Redis

Author Saksham Gupta
0 upvote

Introduction

Redis is an in-memory data structure store that is open source (BSD licensed) and used as a database, cache, and message broker. In this article, we will go through Commands of Search in Redis. 

Redis

Overview of Commands

RediSearch API Details about a specific module or command, such as FT, can be filtered. The specifics also include the commands' syntax, where:

Names of commands and their subcommands are capitalized, such as FT.CREATE.

Square brackets are used to denote optional arguments, such as [NOCONTENT].

Three-period characters, for instance, indicate the presence of additional optional arguments.

The query, in this case, hello|world is the first argument for the query commands FT.

SEARCH and FT.AGGREGATE. The second and third arguments are any additional parameters or characteristics.

Redis Search Commands

RediSearch

Command

Function

FT._LIST Returns a list of all currently used indexes.
FT.ALIASADD alias index An index should have an alias. This enables an administrator to transparently switch the indexes that application queries are sent to. Indexes may include several aliases, but no alias may refer to another alias.
FT.ALIASDEL alias Removes alias out of the index.
FT.ALIASUPDATE alias index Add an index and an alias. When an alias is already connected to another index, FT.ALIASUPDATE will end the connection to the earlier index.
FT.ALTER index SCHEMA ADD field options A new attribute is added to the index. Any subsequent revisions to the document will use the newly added attribute when Indexing and reindexing existing documents if an attribute is added to the index.
FT.CONFIG GET option Retrieves configuration options.
FT.CONFIG HELP option Describes configuration options.
FT.CONFIG SET option value Sets runtime configuration options.
FT.CREATE index Creates an index according to the specified specifications.
FT.CURSOR READ index cursor_id Reads future outcomes from a running cursor
FT.DICTDEL dict term Takes words out of a dictionary.
FT.DROPINDEX index Gets rid of the index. The document hashes connected to the index are not removed by default when using FT.DROPINDEX. The hashes are also deleted when the DD option is added.
FT.SEARCH index query Uses a textual query to search the index and returns either documents or only ids.
FT.SPELLCHECK index query Returns suggestions for misspelled terms after performing spelling correction on a query.

FT.SYNUPDATE index synonym_group_id

FT.TAGVALS index field_name

The command is used to add new terms to an existing synonym group or to create a new one. A scan of all papers is started, and the Tag field's unique collection of values is returned. If your tag indexes things like cities, genres, etc., this is helpful with the command.

Frequently Asked Questions

How does RediSearch function?

Redis has a primary-replica architecture with asynchronous replication, which allows for the image of data across numerous replica servers. As a result, read speed increases (as requests can be distributed among the servers), and the primary server recovers more quickly during an outage.

How many clients make Redis available?

10,000 relationships. Redis has a maximum Redis client connection limit of 10,000 by default. However, it can handle numerous connections. By changing the max client value within Redis, you can specify the maximum number of Redis client connections you wish the Redis server to accept.

How is data stored in memory by Redis?

Redis is an In-Memory Database (IMDB) since it stores data in the computer's main memory instead of traditional databases, which use disc storage. Because disc access is slower than memory access, Redis performs better than databases optimized for the disc.

How much demand can Redis support?

Number of Redis clients at maximum The maximum number of Redis clients that Redis 2.4 could support concurrently had a hard-coded restriction. This limit is dynamic in Redis 2.6 and defaults to 10000 Redis clients unless the max memory directive in Redis specifies otherwise.

Why is Redis so well-liked?

Built for Languages & Speed. Redis uses an in-memory dataset to operate at its current speed. You can periodically save the data to a disc or add all commands to a log to keep the data. If you're utilizing persistence as a temporary cache, you may turn it off as you don't always want it.

Conclusion

This article covers everything you need to know about Commands of Search in Redis.Still have more questions; Here are some articles for rescue:

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enroll in our courses and refer to the mock test and problems available. Take a look at the interview experiences and interview bundle for placement preparations.

Do upvote our blog to help other ninjas grow.

Happy Learning!

Thank You

 

Live masterclass