Skip to content

Commit ceb0e92

Browse files
committed
fix #523 no longer seems an issue in the 1.0 release
1 parent 0edaf12 commit ceb0e92

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Diff for: src/Nest/DSL/Query/FunctionScoreQueryDescriptor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ bool IQuery.IsConditionless
3939
{
4040
get
4141
{
42-
return (this._Query == null || this._Query.IsConditionless) && _RandomScore == null && _ScriptScore == null && (_Functions == null || _Functions.Count() == 0);
42+
return (this._Query == null || this._Query.IsConditionless) && _RandomScore == null && _ScriptScore == null && (_Functions == null || !_Functions.Any());
4343
}
4444
}
4545

Diff for: src/Tests/Nest.Tests.Unit/Core/MultiSearch/MultiSearchTests.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ public void MultiSearchFixedIndex()
3232
uri.AbsolutePath.Should().Be("/myindex/_msearch");
3333
}
3434
[Test]
35+
public void ShouldNotThrowWhenTypeIsSpecified()
36+
{
37+
// see: https://github.com/elasticsearch/elasticsearch-net/issues/523
38+
var indexName = "multisearch-with-type-name-error";
39+
var typeName = "product";
40+
Assert.DoesNotThrow(() =>
41+
{
42+
var result = this._client.MultiSearch(b => b
43+
.Search<ElasticsearchProject>("name", s=>s.Index(indexName).Type(typeName).MatchAll())
44+
);
45+
});
46+
}
47+
[Test]
3548
public void MultiSearchFixedIndexAndType()
3649
{
3750
var result = this._client.MultiSearch(b => b
@@ -66,7 +79,6 @@ public void MultiSearchRespectsSearchTypePreferenceAndRouting()
6679
StringAssert.Contains(first, status.Request.Utf8String());
6780
StringAssert.Contains(second, status.Request.Utf8String());
6881

69-
7082
}
7183

7284
}

0 commit comments

Comments
 (0)