-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NRedisearch issue with the search for "bond" #3
Comments
I observed something similar when testing the RediSearch 2 changes (are you using RediSearch 2 by any chance?) - see this fix here. I had been hoping for some feedback from @gkorland on some questions including this topic, but I may have to just give up on that and review for final merge |
Hi Marc, Thanks a lot for your quick answer. I'm using RediSearch version 2.0.1 (running on Redis 6.0.9) on the server and the C# client is version 2.1.30 (latest available). Thanks |
Hi,
I see a very weird behaviour with the C# client when creating a suggestion and then looking for it. Here is the code :
// Creating the client
var client = new NRediSearch.Client("redisearch:error", /* IDatabase */);
// Adding the suggestion
var nameBuilder = new Suggestion.SuggestionBuilder();
nameBuilder.String("bond");
nameBuilder.Score(0.5);
nameBuilder.Payload("test");
client.AddSuggestion(nameBuilder.Build());
// Querying it
var optionsBuilder = new SuggestionOptions.SuggestionOptionsBuilder();
optionsBuilder.With(SuggestionOptions.WithOptions.PayloadsAndScores);
optionsBuilder.Max(10);
optionsBuilder.Fuzzy();
var suggestionsOptions = optionsBuilder.Build();
var res = client.GetSuggestions("bond", suggestionsOptions);
Am i missing something obvious or is it a bug ? Also if you replace "bond" by something else, it does work sometimes and sometimes doesn't.
Thanks
StackTrace:
StackExchange.Redis.RedisCommandException: Missing required fields: score not within range: 2147483648
at NRediSearch.Suggestion.SuggestionBuilder.Build() in //src/NRediSearch/Suggestion.cs:line 102
at NRediSearch.Client.GetSuggestionsWithPayloadAndScores(RedisResult[] results) in //src/NRediSearch/Client.cs:line 1271
at NRediSearch.Client.GetSuggestions(String prefix, SuggestionOptions options) in /_/src/NRediSearch/Client.cs:line 813
at Cobra.Timeseries.TestClient.RedisSearchError.Run() in C:\repositories\cobra\Cobra\Cobra.Timeseries.TestClient\RedisSearchError.cs:line 30
The text was updated successfully, but these errors were encountered: