Skip to content

Creating JSON Index with sortable TagField throws exception #175

@hbacharya

Description

@hbacharya

NRedisStack Version: 0.8.1

Redis Stack Version: Redis server v=6.2.12 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=4dbc2487343b0024

Description:
Creating JSON index with sortable TagField throws exception.

Note: The problem only happens if the sortable = true. (It works as expected when sortable = false)

Please check the sample below:

        static void Main(string[] args)
        {
            ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost:6379");
            IDatabase db = redis.GetDatabase();

            SearchCommands ft = db.FT();
            JsonCommands json = db.JSON();

            var sortable = true;
            //Add a tag field with sortable = true
            var schema = new Schema().AddTagField("",sortable, false, false,"|");

            //following line throws exception (Note: sortable = true)
            ft.Create("myIndex", new FTCreateParams().On(IndexDataType.JSON)
                    .Prefix("doc:"), schema);
        }

Exception:

Unhandled exception. StackExchange.Redis.RedisServerException: Invalid field type for field `SEPARATOR`
   at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server, T defaultValue) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1992
   at StackExchange.Redis.RedisDatabase.Execute(String command, ICollection`1 args, CommandFlags flags) in /_/src/StackExchange.Redis/RedisDatabase.cs:line 1502
   at NRedisStack.SearchCommands.Create(String indexName, FTCreateParams parameters, Schema schema)
   at RedisSortTest.Program.Main(String[] args)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions