An example looks like:
FT.CREATE myindex SCHEMA lastname TEXT WEIGHT 5.0 SORTABLE
The code looks like:
var schema = new Schema();
schema.AddSortableTextField("lastname", 5.0);
var options = new Client.ConfiguredIndexOptions();
await _client.CreateIndexAsync(schema, options);
But this code causes an StackExchange.Redis.RedisServerException with the message:
ERROR: Invalid field type for field WEIGHT
Reason:TextField.SerializeRedisArgs() runs the base class first. So the arguments for sortables fields are in the wrong order. The output is:
FT.CREATE myindex SCHEMA lastname TEXT SORTABLE WEIGHT 5.0
Note: Analysis after code review. Currently no UnitTest available.
Setup:
The syntax of the command for creating a new index is not correct.
Syntax (see documentation):
An example looks like:
FT.CREATE myindex SCHEMA lastname TEXT WEIGHT 5.0 SORTABLE
The code looks like:
But this code causes an
StackExchange.Redis.RedisServerException
with the message:Reason:
TextField.SerializeRedisArgs()
runs the base class first. So the arguments for sortables fields are in the wrong order. The output is:FT.CREATE myindex SCHEMA lastname TEXT SORTABLE WEIGHT 5.0
See
Field class
here and theTextField class
here.