File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Tests/Nest.Tests.Unit/QueryParsers/Queries Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ public interface ISimpleQueryStringQuery : IQuery
3636
3737 [ JsonProperty ( PropertyName = "locale" ) ]
3838 string Locale { get ; set ; }
39+
40+ [ JsonProperty ( "minimum_should_match" ) ]
41+ string MinimumShouldMatch { get ; set ; }
3942 }
4043
4144 public class SimpleQueryStringQuery : PlainQuery , ISimpleQueryStringQuery
@@ -54,6 +57,7 @@ protected override void WrapInContainer(IQueryContainer container)
5457 public bool ? LowercaseExpendedTerms { get ; set ; }
5558 public string Flags { get ; set ; }
5659 public string Locale { get ; set ; }
60+ public string MinimumShouldMatch { get ; set ; }
5761 }
5862
5963 public class SimpleQueryStringQueryDescriptor < T > : ISimpleQueryStringQuery where T : class
@@ -75,6 +79,7 @@ public class SimpleQueryStringQueryDescriptor<T> : ISimpleQueryStringQuery where
7579 string ISimpleQueryStringQuery . Flags { get ; set ; }
7680
7781 string ISimpleQueryStringQuery . Locale { get ; set ; }
82+ string ISimpleQueryStringQuery . MinimumShouldMatch { get ; set ; }
7883
7984 string IQuery . Name { get ; set ; }
8085
@@ -159,5 +164,10 @@ public SimpleQueryStringQueryDescriptor<T> Locale(string locale)
159164 return this ;
160165 }
161166
162- }
167+ public SimpleQueryStringQueryDescriptor < T > MinimumShouldMatch ( string minimumShouldMatch )
168+ {
169+ Self . MinimumShouldMatch = minimumShouldMatch ;
170+ return this ;
171+ }
172+ }
163173}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public void SimpleQueryString_Deserializes()
2020 . DefaultField ( p=> p . Name )
2121 . OnFields ( p=> p . Name , p=> p . Origin )
2222 . Query ( "some query" )
23+ . MinimumShouldMatch ( "50%" )
2324 )
2425 ) ;
2526 q . Analyzer . Should ( ) . Be ( "my-analyzer" ) ;
@@ -30,7 +31,7 @@ public void SimpleQueryString_Deserializes()
3031 q . DefaultField . Should ( ) . Be ( "name" ) ;
3132 q . Fields . Should ( ) . BeEquivalentTo ( new [ ] { "name" , "origin" } ) ;
3233 q . Query . Should ( ) . Be ( "some query" ) ;
33-
34+ q . MinimumShouldMatch . Should ( ) . Be ( "50%" ) ;
3435 }
3536 }
3637}
You can’t perform that action at this time.
0 commit comments