RediSearch / redisearch-go

Go client for RediSearch
https://redisearch.io
BSD 3-Clause "New" or "Revised" License
288 stars 65 forks source link

Enabling Exact Match Search in Existing Redisearch Schema Using redisearch-go #191

Open Li-Khan opened 2 months ago

Li-Khan commented 2 months ago

Hello, I've been exploring the capabilities of redisearch-go for integrating Redisearch into my Go applications, and I came across an interesting feature mentioned in the Redisearch GitHub discussions regarding aliasing fields during index creation.

In a GitHub issue discussion 1130, a user brought up the need for being able to perform exact match searches on text fields without tokenization, similar to SQL's WHERE clause functionality. The proposed solution involved creating an alias for the text field during index creation to enable different indexing strategies for the same field.

Here's an example of how this was achieved in Redisearch:

FT.CREATE idx1 NOHL NOFREQS SCHEMA f1 AS f1_text TEXT NOSTEM f1 AS f1_tag TAG

This syntax allowed for the creation of two representations of the same field "f1": one for full-text search (f1_text) and another for exact match search (f1_tag).

My question is whether it's possible to achieve a similar behavior in redisearch-go without modifying the index schema during creation. Specifically, I already have an existing schema in place, and I would like to add a new field with similar aliasing functionality as demonstrated above without recreating the entire schema.

Is there a way to accomplish this programmatically using redisearch-go, or would it require a modification to the library itself?

Any insights or suggestions would be greatly appreciated.

Thank you!