StackExchange / NRediSearch

Other
31 stars 9 forks source link

NRediSearch : alias AS feature when creating an index #14

Open nad0u opened 3 years ago

nad0u commented 3 years ago

Hi everyone,

I'm new to Redis and RediSearch. I saw that it was possible to create a schema with NRediSearch, however it doesn't seem possible to add alias (see discussion under this issue).

How can I create the following schema using NRedisSearch :

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

Am I missing something? If not, is it planned to add this feature?

For now I execute the command directly to redis instead of using CreatinIndexAsync() with the schema.

My setup (I'm using this docker image: redislabs/redisearch:2.2.0):

Thanks!

AvitalFineRedis commented 3 years ago

Now you can add an alias (after this PR)

Schema sc = new Schema().AddField(new TextField(FieldName.Of("f1").As("f1_text"), noStem: true)).AddTagField(FieldName.Of("f1").As("f1_tag"));
nad0u commented 3 years ago

That's great news ! Thank you for the feedback, I need to try this now !