Skip to content

Commit 6bbab2f

Browse files
committed
Added sort and multisearch tests
1 parent 45cbfb1 commit 6bbab2f

File tree

6 files changed

+210
-163
lines changed

6 files changed

+210
-163
lines changed

src/Nest.Tests.Integration/Core/MultiSearch/MultiSearchTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ public void MultipleComplexSearches()
7575
result.GetResponses<ElasticSearchProject>().Should().NotBeEmpty();
7676
result.GetResponses<Person>().Should().NotBeEmpty();
7777
}
78+
[Test]
79+
public void MultiSearchShouldReturnErrorProperty()
80+
{
81+
var result = this._client.MultiSearch(b => b
82+
.FixedPath("myindex", "mytype")
83+
.Search<ElasticSearchProject>(s => s.MatchAll().Preference("_primary").Routing("customvalue1").SearchType(SearchType.DfsQueryAndFetch))
84+
.Search<Person>(s => s.Query(q=>q.Term("THIS FIELD DOES NOT EXIST", "BOOM")))
85+
);
86+
var status = result.ConnectionStatus;
87+
result.IsValid.Should().BeTrue();
88+
var personResponse = result.GetResponses<Person>().First();
89+
personResponse.IsValid.Should().BeFalse();
90+
91+
}
7892

7993
}
8094
}

src/Nest.Tests.Unit/Core/MultiSearch/MultiSearchTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ public void MultiSearchRespectsSearchTypePreferenceAndRouting()
5959

6060

6161
}
62+
6263
}
6364
}

src/Nest.Tests.Unit/Nest.Tests.Unit.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@
622622
<None Include="Internals\Serialize\SimpleClassUsesCamelCase.json">
623623
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
624624
</None>
625+
<None Include="Search\Sort\RandomScriptSort.json">
626+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
627+
</None>
625628
<None Include="Test.settings">
626629
<Generator>SettingsSingleFileGenerator</Generator>
627630
<LastGenOutput>Test.Designer.cs</LastGenOutput>

0 commit comments

Comments
 (0)