Commit dff7ce60 authored by Marc Gravell's avatar Marc Gravell

fixup NRediSearch for 1.x

parent 3cade0cc
......@@ -3,7 +3,6 @@
<OutputType>Library</OutputType>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\StackExchange.Redis\StackExchange.Redis.csproj" />
......
......@@ -53,7 +53,8 @@ internal static ConnectionMultiplexer GetWithFT(ITestOutputHelper output)
var conn = ConnectionMultiplexer.Connect(options);
var server = conn.GetServer(ep);
var arr = (RedisResult[])server.Execute("module", "list");
var db = conn.GetDatabase();
var arr = (RedisResult[])db.Execute("module", "list");
bool found = false;
foreach (var module in arr)
{
......@@ -75,7 +76,7 @@ internal static ConnectionMultiplexer GetWithFT(ITestOutputHelper output)
{
var i = config.LastIndexOf('/');
var modulePath = config.Substring(0, i + 1) + "redisearch.so";
var result = server.Execute("module", "load", modulePath);
var result = db.Execute("module", "load", modulePath);
output?.WriteLine((string)result);
}
}
......
......@@ -22,8 +22,8 @@ internal AggregationResult(RedisResult result)
{
var key = (string)raw[j++];
var val = raw[j++];
if (val.Type != ResultType.MultiBulk)
cur.Add(key, (RedisValue)val);
try { cur.Add(key, (RedisValue)val); }
catch { }
}
_results[i - 1] = cur;
}
......
// .NET port of https://github.com/RedisLabs/JRediSearch/
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("NRediSearch.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001007791a689e9d8950b44a9a8886baad2ea180e7a8a854f158c9b98345ca5009cdd2362c84f368f1c3658c132b3c0f74e44ff16aeb2e5b353b6e0fe02f923a050470caeac2bde47a2238a9c7125ed7dab14f486a5a64558df96640933b9f2b6db188fc4a820f96dce963b662fa8864adbff38e5b4542343f162ecdc6dad16912fff")]
[assembly: InternalsVisibleTo("NRediSearch.Test")]
......@@ -441,10 +441,8 @@ public async Task<bool> AddHashAsync(RedisKey docId, double score, bool replace)
for (int i = 0; i < res.Length; i += 2)
{
var val = res[i + 1];
if (val.Type != ResultType.MultiBulk)
{
info.Add((string)res[i], (RedisValue)val);
}
try { info.Add((string)res[i], (RedisValue)val); }
catch { }
}
return info;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment