12 Ağustos 2021 Perşembe

Redis RediSearch - Secondary Index İçindir

Giriş

Açıklaması şöyle
Redis has a versatile set of data structures ranging from simple Strings all the way to powerful abstractions such as Redis Streams. The native data types can take you a long way, but there are certain use cases that may require a workaround. One example is the requirement to use secondary indexes in Redis in order to go beyond the key-based search/lookup for richer query capabilities. Though you can use Sorted Sets, Lists, and so on to get the job done, you’ll need to factor in some trade-offs.

Available as a Redis module, RediSearch provides flexible search capabilities, thanks to a first-class secondary indexing engine. Some of its key features include full-text search, auto completion, and geographical indexing.
Açıklaması şöyle
Two of the most important commands include creating an index and executing search queries:
FT.CREATE is used to create an index with a given schema and associated details.
FT.SEARCH searches the index with a textual query, returning either documents or just ids.

You can execute other operations on indices:
FT.DROPINDEX deletes the index. Note that by default, it does not delete the document hashes associated with the index
FT.INFO returns information and statistics on the index such as number of documents, number of distinct terms and more.
FT.ALTER SCHEMA ADD adds a new field to the index. This causes future document updates to use the new field when indexing and re-indexing of existing documents.

To work with auto-complete features, you can use “suggestions”:
FT.SUGADD adds a suggestion string to an auto-complete suggestion dictionary.
FT.SUGGET gets completion suggestions for a prefix.

RediSearch supports synonyms which is a data structure comprised of a set of groups, each of which contains synonym terms. FT.SYNUPDATE can be used to create or update a synonym group with additional terms.

If you want query spell check correction (similar to “did you mean” feature), you can use FT.SPELLCHECK which performs spelling correction on a query, returning suggestions for misspelled terms.

A dictionary is a set of terms. Dictionaries can be used to modify the behavior of RediSearch’s query spelling correction, by including or excluding their contents from potential spelling correction suggestions. You can use FT.DICTADD and FT.DICTDEL to add and delete terms, respectively.

Hiç yorum yok:

Yorum Gönder