@@ -30,83 +30,114 @@ internal QueryDescriptor(bool forceConditionless)
3030
3131 [ JsonProperty ( PropertyName = "match_all" ) ]
3232 internal MatchAll MatchAllQuery { get ; set ; }
33+
3334 [ JsonProperty ( PropertyName = "term" ) ]
3435 internal Term TermQuery { get ; set ; }
36+
3537 [ JsonProperty ( PropertyName = "wildcard" ) ]
3638 internal Wildcard WildcardQuery { get ; set ; }
39+
3740 [ JsonProperty ( PropertyName = "prefix" ) ]
3841 internal Prefix PrefixQuery { get ; set ; }
3942
4043 [ JsonProperty ( PropertyName = "boosting" ) ]
4144 internal BoostingQueryDescriptor < T > BoostingQueryDescriptor { get ; set ; }
45+
4246 [ JsonProperty ( PropertyName = "ids" ) ]
4347 internal IdsQuery IdsQuery { get ; set ; }
48+
4449 [ JsonProperty ( PropertyName = "custom_score" ) ]
4550 internal CustomScoreQueryDescriptor < T > CustomScoreQueryDescriptor { get ; set ; }
51+
4652 [ JsonProperty ( PropertyName = "custom_filters_score" ) ]
4753 internal CustomFiltersScoreDescriptor < T > CustomFiltersScoreQueryDescriptor { get ; set ; }
4854
4955 [ JsonProperty ( PropertyName = "custom_boost_factor" ) ]
5056 internal CustomBoostFactorQueryDescriptor < T > CustomBoostFactorQueryDescriptor { get ; set ; }
57+
5158 [ JsonProperty ( PropertyName = "constant_score" ) ]
5259 internal ConstantScoreQueryDescriptor < T > ConstantScoreQueryDescriptor { get ; set ; }
60+
5361 [ JsonProperty ( PropertyName = "dis_max" ) ]
5462 internal DismaxQueryDescriptor < T > DismaxQueryDescriptor { get ; set ; }
63+
5564 [ JsonProperty ( PropertyName = "filtered" ) ]
5665 internal FilteredQueryDescriptor < T > FilteredQueryDescriptor { get ; set ; }
5766
5867 [ JsonProperty ( PropertyName = "text" ) ]
5968 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
6069 internal IDictionary < PropertyPathMarker , object > TextQueryDescriptor { get ; set ; }
70+
6171 [ JsonProperty ( PropertyName = "multi_match" ) ]
6272 internal MultiMatchQueryDescriptor < T > MultiMatchQueryDescriptor { get ; set ; }
73+
6374 [ JsonProperty ( PropertyName = "match" ) ]
6475 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
6576 internal IDictionary < PropertyPathMarker , object > MatchQueryDescriptor { get ; set ; }
77+
6678 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
6779 [ JsonProperty ( PropertyName = "fuzzy" ) ]
6880 internal IDictionary < PropertyPathMarker , object > FuzzyQueryDescriptor { get ; set ; }
81+
6982 [ JsonProperty ( PropertyName = "geo_shape" ) ]
7083 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
7184 internal IDictionary < PropertyPathMarker , object > GeoShapeQueryDescriptor { get ; set ; }
85+
86+ [ JsonProperty ( PropertyName = "common_terms" ) ]
87+ [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
88+ internal IDictionary < PropertyPathMarker , object > CommonTermsQueryDescriptor { get ; set ; }
89+
7290 [ JsonProperty ( PropertyName = "terms" ) ]
7391 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
7492 internal IDictionary < PropertyPathMarker , object > TermsQueryDescriptor { get ; set ; }
93+
7594 [ JsonProperty ( PropertyName = "simple_query_string" ) ]
7695 internal SimpleQueryStringQueryDescriptor < T > SimpleQueryStringDescriptor { get ; set ; }
96+
7797 [ JsonProperty ( PropertyName = "query_string" ) ]
7898 internal QueryStringDescriptor < T > QueryStringDescriptor { get ; set ; }
99+
79100 [ JsonProperty ( PropertyName = "regexp" ) ]
80101 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
81102 internal IDictionary < PropertyPathMarker , object > RegexpQueryDescriptor { get ; set ; }
82103
83104 [ JsonProperty ( PropertyName = "flt" ) ]
84105 internal FuzzyLikeThisDescriptor < T > FuzzyLikeThisDescriptor { get ; set ; }
106+
85107 [ JsonProperty ( PropertyName = "has_child" ) ]
86108 internal object HasChildQueryDescriptor { get ; set ; }
109+
87110 [ JsonProperty ( PropertyName = "has_parent" ) ]
88111 internal object HasParentQueryDescriptor { get ; set ; }
112+
89113 [ JsonProperty ( PropertyName = "mlt" ) ]
90114 internal MoreLikeThisQueryDescriptor < T > MoreLikeThisDescriptor { get ; set ; }
115+
91116 [ JsonProperty ( PropertyName = "range" ) ]
92117 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
93118 internal IDictionary < PropertyPathMarker , object > RangeQueryDescriptor { get ; set ; }
94119
95120 [ JsonProperty ( PropertyName = "span_term" ) ]
96121 internal SpanTerm SpanTermQuery { get ; set ; }
122+
97123 [ JsonProperty ( PropertyName = "span_first" ) ]
98124 internal SpanFirstQueryDescriptor < T > SpanFirstQueryDescriptor { get ; set ; }
125+
99126 [ JsonProperty ( PropertyName = "span_or" ) ]
100127 internal SpanOrQueryDescriptor < T > SpanOrQueryDescriptor { get ; set ; }
128+
101129 [ JsonProperty ( PropertyName = "span_near" ) ]
102130 internal SpanNearQueryDescriptor < T > SpanNearQueryDescriptor { get ; set ; }
131+
103132 [ JsonProperty ( PropertyName = "span_not" ) ]
104133 internal SpanNotQueryDescriptor < T > SpanNotQueryDescriptor { get ; set ; }
105134
106135 [ JsonProperty ( PropertyName = "top_children" ) ]
107136 internal object TopChildrenQueryDescriptor { get ; set ; }
137+
108138 [ JsonProperty ( PropertyName = "nested" ) ]
109139 internal NestedQueryDescriptor < T > NestedQueryDescriptor { get ; set ; }
140+
110141 [ JsonProperty ( PropertyName = "indices" ) ]
111142 internal IndicesQueryDescriptor < T > IndicesQueryDescriptor { get ; set ; }
112143
@@ -452,6 +483,21 @@ public BaseQuery GeoShape(Action<GeoShapeQueryDescriptor<T>> selector)
452483 } ;
453484 return this . New ( query , q => q . GeoShapeQueryDescriptor = shape ) ;
454485 }
486+
487+ /// <summary>
488+ /// The common terms query is a modern alternative to stopwords which improves the precision and recall
489+ /// of search results (by taking stopwords into account), without sacrificing performance.
490+ /// </summary>
491+ public BaseQuery CommonTerms ( Action < CommonTermsQueryDescriptor < T > > selector )
492+ {
493+ var query = new CommonTermsQueryDescriptor < T > ( ) ;
494+ selector ( query ) ;
495+ var commonTerms = new Dictionary < PropertyPathMarker , object >
496+ {
497+ { query . _Field , query }
498+ } ;
499+ return this . New ( query , q => q . CommonTermsQueryDescriptor = commonTerms ) ;
500+ }
455501
456502 /// <summary>
457503 /// The has_child query works the same as the has_child filter, by automatically wrapping the filter with a
0 commit comments