@@ -41,8 +41,8 @@ public interface ISearchRequest : IQueryPath<SearchRequestParameters>
4141 IDictionary < IndexNameMarker , double > IndicesBoost { get ; set ; }
4242
4343 [ JsonProperty ( PropertyName = "sort" ) ]
44- [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
45- IDictionary < PropertyPathMarker , ISort > Sort { get ; set ; }
44+ [ JsonConverter ( typeof ( SortCollectionConverter ) ) ]
45+ IList < KeyValuePair < PropertyPathMarker , ISort > > Sort { get ; set ; }
4646
4747 [ JsonProperty ( PropertyName = "facets" ) ]
4848 [ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
@@ -140,7 +140,7 @@ public partial class SearchRequest : QueryPathBase<SearchRequestParameters>, ISe
140140 public IList < PropertyPathMarker > Fields { get ; set ; }
141141 public IDictionary < string , IScriptFilter > ScriptFields { get ; set ; }
142142 public ISourceFilter Source { get ; set ; }
143- public IDictionary < PropertyPathMarker , ISort > Sort { get ; set ; }
143+ public IList < KeyValuePair < PropertyPathMarker , ISort > > Sort { get ; set ; }
144144 public IDictionary < IndexNameMarker , double > IndicesBoost { get ; set ; }
145145 public IFilterContainer Filter { get ; set ; }
146146 public IQueryContainer Query { get ; set ; }
@@ -200,7 +200,7 @@ protected override void UpdatePathInfo(IConnectionSettingsValues settings, Elast
200200 public bool ? TrackScores { get ; set ; }
201201 public double ? MinScore { get ; set ; }
202202 public IDictionary < IndexNameMarker , double > IndicesBoost { get ; set ; }
203- public IDictionary < PropertyPathMarker , ISort > Sort { get ; set ; }
203+ public IList < KeyValuePair < PropertyPathMarker , ISort > > Sort { get ; set ; }
204204 public IDictionary < PropertyPathMarker , IFacetContainer > Facets { get ; set ; }
205205 public IDictionary < string , ISuggestBucket > Suggest { get ; set ; }
206206 public IHighlightRequest Highlight { get ; set ; }
@@ -290,7 +290,7 @@ string ISearchRequest.Routing
290290
291291 IDictionary < IndexNameMarker , double > ISearchRequest . IndicesBoost { get ; set ; }
292292
293- IDictionary < PropertyPathMarker , ISort > ISearchRequest . Sort { get ; set ; }
293+ IList < KeyValuePair < PropertyPathMarker , ISort > > ISearchRequest . Sort { get ; set ; }
294294
295295 IDictionary < PropertyPathMarker , IFacetContainer > ISearchRequest . Facets { get ; set ; }
296296
@@ -568,9 +568,9 @@ public SearchDescriptor<T> ScriptFields(
568568 /// </summary>
569569 public SearchDescriptor < T > SortAscending ( Expression < Func < T , object > > objectPath )
570570 {
571- if ( Self . Sort == null ) Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
571+ if ( Self . Sort == null ) Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
572572
573- Self . Sort . Add ( objectPath , new Sort ( ) { Order = SortOrder . Ascending } ) ;
573+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( objectPath , new Sort ( ) { Order = SortOrder . Ascending } ) ) ;
574574 return this ;
575575 }
576576
@@ -584,9 +584,9 @@ public SearchDescriptor<T> SortAscending(Expression<Func<T, object>> objectPath)
584584 /// </summary>
585585 public SearchDescriptor < T > SortDescending ( Expression < Func < T , object > > objectPath )
586586 {
587- if ( Self . Sort == null ) Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
587+ if ( Self . Sort == null ) Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
588588
589- Self . Sort . Add ( objectPath , new Sort ( ) { Order = SortOrder . Descending } ) ;
589+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( objectPath , new Sort ( ) { Order = SortOrder . Descending } ) ) ;
590590 return this ;
591591 }
592592
@@ -600,8 +600,8 @@ public SearchDescriptor<T> SortDescending(Expression<Func<T, object>> objectPath
600600 /// </summary>
601601 public SearchDescriptor < T > SortAscending ( string field )
602602 {
603- if ( Self . Sort == null ) Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
604- Self . Sort . Add ( field , new Sort ( ) { Order = SortOrder . Ascending } ) ;
603+ if ( Self . Sort == null ) Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
604+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( field , new Sort ( ) { Order = SortOrder . Ascending } ) ) ;
605605 return this ;
606606 }
607607
@@ -616,9 +616,9 @@ public SearchDescriptor<T> SortAscending(string field)
616616 public SearchDescriptor < T > SortDescending ( string field )
617617 {
618618 if ( Self . Sort == null )
619- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
619+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
620620
621- Self . Sort . Add ( field , new Sort ( ) { Order = SortOrder . Descending } ) ;
621+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( field , new Sort ( ) { Order = SortOrder . Descending } ) ) ;
622622 return this ;
623623 }
624624
@@ -629,11 +629,11 @@ public SearchDescriptor<T> SortDescending(string field)
629629 public SearchDescriptor < T > Sort ( Func < SortFieldDescriptor < T > , IFieldSort > sortSelector )
630630 {
631631 if ( Self . Sort == null )
632- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
632+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
633633
634634 sortSelector . ThrowIfNull ( "sortSelector" ) ;
635635 var descriptor = sortSelector ( new SortFieldDescriptor < T > ( ) ) ;
636- Self . Sort . Add ( descriptor . Field , descriptor ) ;
636+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( descriptor . Field , descriptor ) ) ;
637637 return this ;
638638 }
639639
@@ -644,11 +644,11 @@ public SearchDescriptor<T> Sort(Func<SortFieldDescriptor<T>, IFieldSort> sortSel
644644 public SearchDescriptor < T > SortGeoDistance ( Func < SortGeoDistanceDescriptor < T > , IGeoDistanceSort > sortSelector )
645645 {
646646 if ( Self . Sort == null )
647- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
647+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
648648
649649 sortSelector . ThrowIfNull ( "sortSelector" ) ;
650650 var descriptor = sortSelector ( new SortGeoDistanceDescriptor < T > ( ) ) ;
651- Self . Sort . Add ( "_geo_distance" , descriptor ) ;
651+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( "_geo_distance" , descriptor ) ) ;
652652 return this ;
653653 }
654654
@@ -659,11 +659,11 @@ public SearchDescriptor<T> SortGeoDistance(Func<SortGeoDistanceDescriptor<T>, IG
659659 public SearchDescriptor < T > SortScript ( Func < SortScriptDescriptor < T > , IScriptSort > sortSelector )
660660 {
661661 if ( Self . Sort == null )
662- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
662+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
663663
664664 sortSelector . ThrowIfNull ( "sortSelector" ) ;
665665 var descriptor = sortSelector ( new SortScriptDescriptor < T > ( ) ) ;
666- Self . Sort . Add ( "_script" , descriptor ) ;
666+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( "_script" , descriptor ) ) ;
667667 return this ;
668668 }
669669
0 commit comments