File tree 2 files changed +14
-2
lines changed
Tests/Nest.Tests.Unit/Core/MultiSearch
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ bool IQuery.IsConditionless
39
39
{
40
40
get
41
41
{
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 ( ) ) ;
43
43
}
44
44
}
45
45
Original file line number Diff line number Diff line change @@ -32,6 +32,19 @@ public void MultiSearchFixedIndex()
32
32
uri . AbsolutePath . Should ( ) . Be ( "/myindex/_msearch" ) ;
33
33
}
34
34
[ 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 ]
35
48
public void MultiSearchFixedIndexAndType ( )
36
49
{
37
50
var result = this . _client . MultiSearch ( b => b
@@ -66,7 +79,6 @@ public void MultiSearchRespectsSearchTypePreferenceAndRouting()
66
79
StringAssert . Contains ( first , status . Request . Utf8String ( ) ) ;
67
80
StringAssert . Contains ( second , status . Request . Utf8String ( ) ) ;
68
81
69
-
70
82
}
71
83
72
84
}
You can’t perform that action at this time.
0 commit comments