I added a JSON value to redis using this command
JSON.SET queue:ID_HERE $ '{"Id": "SAME_ID", "JoinCode": "random", "MemberCount": 1, "Players": [], "MatchType": 0, "MatchPrivacy": 0}'
And I create an index with NRediSearch using this code
Schema schema = new();
schema.AddTagField("Id");
schema.AddTagField("JoinCode");
schema.AddSortableNumericField("MemberCount");
schema.AddNumericField("MatchType");
schema.AddNumericField("MatchPrivacy");
client.CreateIndex(schema, new Client.ConfiguredIndexOptions(Client.IndexOptions.Default));
But when I use this command to index the value I set it returns nothing
FT.SEARCH queueIdx "@MatchPrivacy:[0 0]" SORTBY MemberCount DESC
Same goes when done through code
Query query = new($"@MemberCount:[0 {requiredQueueSize - 1}] @MatchType:[0 0] @MatchPrivacy:[0 0]");
query.SetSortBy("MemberCount", false);
SearchResult result = await _redisearchClient.SearchAsync(query);
if (result.Documents.Count == 0) return null; // Returns which means it found no matches
//...
Although if manually create the index like this
FT.CREATE queueIdx ON JSON PREFIX 1 "queue:" SCHEMA $.Id AS Id TAG $.JoinCode AS JoinCode TAG $.MemberCount AS MemberCount NUMERIC SORTABLE $.MatchPrivacy AS MatchPrivacy NUMERIC $.MatchType AS MatchType NUMERIC
and then use
FT.SEARCH queueIdx "@MatchPrivacy:[0 0]" SORTBY MemberCount DESC
it correctly returns the object.