File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
src/Tests/Nest.Tests.Unit Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 765765 <None Include =" Reproduce\Issue579.json" >
766766 <CopyToOutputDirectory >Always</CopyToOutputDirectory >
767767 </None >
768+ <None Include =" Reproduce\Issue876.json" >
769+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
770+ </None >
768771 <None Include =" Search\Fields\FixedCovariantSearchResult.json" >
769772 <CopyToOutputDirectory >Always</CopyToOutputDirectory >
770773 </None >
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ namespace Nest.Tests.Unit.Search.Query.Singles
77 public class ConditionlessQueryJson
88 {
99 [ Test ]
10- public void Fallback ( )
10+ public void FallbackTerm ( )
1111 {
1212 var s = new SearchDescriptor < ElasticsearchProject > ( ) . From ( 0 ) . Size ( 10 )
1313 . Query ( q=> q
@@ -29,6 +29,40 @@ public void Fallback()
2929 Assert . True ( json . JsonEquals ( expected ) , json ) ;
3030 }
3131
32+ [ Test ]
33+ public void FallbackMatch ( )
34+ {
35+ var s = new SearchDescriptor < ElasticsearchProject > ( ) . From ( 0 ) . Size ( 10 )
36+ . Query ( q => q
37+ . Conditionless ( qs => qs
38+ . Query ( qcq => qcq
39+ . Match ( m => m
40+ . OnField ( p => p . Name )
41+ . Query ( "" )
42+ )
43+ )
44+ . Fallback ( qcf=> qcf
45+ . Match ( m => m
46+ . OnField ( p => p . Name )
47+ . Query ( "do_me_instead" )
48+ )
49+ )
50+ )
51+ ) ;
52+
53+ var json = TestElasticClient . Serialize ( s ) ;
54+ var expected = @"{ from: 0, size: 10,
55+ query : {
56+ match : {
57+ name : {
58+ query: ""do_me_instead""
59+ }
60+ }
61+ }
62+ }" ;
63+ Assert . True ( json . JsonEquals ( expected ) , json ) ;
64+ }
65+
3266 [ Test ]
3367 public void UseQuery ( )
3468 {
You can’t perform that action at this time.
0 commit comments