NRediSearch icon indicating copy to clipboard operation
NRediSearch copied to clipboard

NRediSearch : alias AS feature when creating an index

Open nad0u opened this issue 4 years ago • 2 comments

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):

  • Redis 6.2.4
  • NRediSearch 2.2.62
  • RediSearch 2.2.0

Thanks!

nad0u avatar Aug 11 '21 12:08 nad0u

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"));

AvitalFineRedis avatar Aug 23 '21 09:08 AvitalFineRedis

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

nad0u avatar Aug 31 '21 15:08 nad0u