@@ -41,8 +41,8 @@ public interface ISearchRequest : IQueryPath<SearchRequestParameters>
41
41
IDictionary < IndexNameMarker , double > IndicesBoost { get ; set ; }
42
42
43
43
[ 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 ; }
46
46
47
47
[ JsonProperty ( PropertyName = "facets" ) ]
48
48
[ JsonConverter ( typeof ( DictionaryKeysAreNotPropertyNamesJsonConverter ) ) ]
@@ -140,7 +140,7 @@ public partial class SearchRequest : QueryPathBase<SearchRequestParameters>, ISe
140
140
public IList < PropertyPathMarker > Fields { get ; set ; }
141
141
public IDictionary < string , IScriptFilter > ScriptFields { get ; set ; }
142
142
public ISourceFilter Source { get ; set ; }
143
- public IDictionary < PropertyPathMarker , ISort > Sort { get ; set ; }
143
+ public IList < KeyValuePair < PropertyPathMarker , ISort > > Sort { get ; set ; }
144
144
public IDictionary < IndexNameMarker , double > IndicesBoost { get ; set ; }
145
145
public IFilterContainer Filter { get ; set ; }
146
146
public IQueryContainer Query { get ; set ; }
@@ -200,7 +200,7 @@ protected override void UpdatePathInfo(IConnectionSettingsValues settings, Elast
200
200
public bool ? TrackScores { get ; set ; }
201
201
public double ? MinScore { get ; set ; }
202
202
public IDictionary < IndexNameMarker , double > IndicesBoost { get ; set ; }
203
- public IDictionary < PropertyPathMarker , ISort > Sort { get ; set ; }
203
+ public IList < KeyValuePair < PropertyPathMarker , ISort > > Sort { get ; set ; }
204
204
public IDictionary < PropertyPathMarker , IFacetContainer > Facets { get ; set ; }
205
205
public IDictionary < string , ISuggestBucket > Suggest { get ; set ; }
206
206
public IHighlightRequest Highlight { get ; set ; }
@@ -290,7 +290,7 @@ string ISearchRequest.Routing
290
290
291
291
IDictionary < IndexNameMarker , double > ISearchRequest . IndicesBoost { get ; set ; }
292
292
293
- IDictionary < PropertyPathMarker , ISort > ISearchRequest . Sort { get ; set ; }
293
+ IList < KeyValuePair < PropertyPathMarker , ISort > > ISearchRequest . Sort { get ; set ; }
294
294
295
295
IDictionary < PropertyPathMarker , IFacetContainer > ISearchRequest . Facets { get ; set ; }
296
296
@@ -568,9 +568,9 @@ public SearchDescriptor<T> ScriptFields(
568
568
/// </summary>
569
569
public SearchDescriptor < T > SortAscending ( Expression < Func < T , object > > objectPath )
570
570
{
571
- if ( Self . Sort == null ) Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
571
+ if ( Self . Sort == null ) Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
572
572
573
- Self . Sort . Add ( objectPath , new Sort ( ) { Order = SortOrder . Ascending } ) ;
573
+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( objectPath , new Sort ( ) { Order = SortOrder . Ascending } ) ) ;
574
574
return this ;
575
575
}
576
576
@@ -584,9 +584,9 @@ public SearchDescriptor<T> SortAscending(Expression<Func<T, object>> objectPath)
584
584
/// </summary>
585
585
public SearchDescriptor < T > SortDescending ( Expression < Func < T , object > > objectPath )
586
586
{
587
- if ( Self . Sort == null ) Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
587
+ if ( Self . Sort == null ) Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
588
588
589
- Self . Sort . Add ( objectPath , new Sort ( ) { Order = SortOrder . Descending } ) ;
589
+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( objectPath , new Sort ( ) { Order = SortOrder . Descending } ) ) ;
590
590
return this ;
591
591
}
592
592
@@ -600,8 +600,8 @@ public SearchDescriptor<T> SortDescending(Expression<Func<T, object>> objectPath
600
600
/// </summary>
601
601
public SearchDescriptor < T > SortAscending ( string field )
602
602
{
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 } ) ) ;
605
605
return this ;
606
606
}
607
607
@@ -616,9 +616,9 @@ public SearchDescriptor<T> SortAscending(string field)
616
616
public SearchDescriptor < T > SortDescending ( string field )
617
617
{
618
618
if ( Self . Sort == null )
619
- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
619
+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
620
620
621
- Self . Sort . Add ( field , new Sort ( ) { Order = SortOrder . Descending } ) ;
621
+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( field , new Sort ( ) { Order = SortOrder . Descending } ) ) ;
622
622
return this ;
623
623
}
624
624
@@ -629,11 +629,11 @@ public SearchDescriptor<T> SortDescending(string field)
629
629
public SearchDescriptor < T > Sort ( Func < SortFieldDescriptor < T > , IFieldSort > sortSelector )
630
630
{
631
631
if ( Self . Sort == null )
632
- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
632
+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
633
633
634
634
sortSelector . ThrowIfNull ( "sortSelector" ) ;
635
635
var descriptor = sortSelector ( new SortFieldDescriptor < T > ( ) ) ;
636
- Self . Sort . Add ( descriptor . Field , descriptor ) ;
636
+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( descriptor . Field , descriptor ) ) ;
637
637
return this ;
638
638
}
639
639
@@ -644,11 +644,11 @@ public SearchDescriptor<T> Sort(Func<SortFieldDescriptor<T>, IFieldSort> sortSel
644
644
public SearchDescriptor < T > SortGeoDistance ( Func < SortGeoDistanceDescriptor < T > , IGeoDistanceSort > sortSelector )
645
645
{
646
646
if ( Self . Sort == null )
647
- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
647
+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
648
648
649
649
sortSelector . ThrowIfNull ( "sortSelector" ) ;
650
650
var descriptor = sortSelector ( new SortGeoDistanceDescriptor < T > ( ) ) ;
651
- Self . Sort . Add ( "_geo_distance" , descriptor ) ;
651
+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( "_geo_distance" , descriptor ) ) ;
652
652
return this ;
653
653
}
654
654
@@ -659,11 +659,11 @@ public SearchDescriptor<T> SortGeoDistance(Func<SortGeoDistanceDescriptor<T>, IG
659
659
public SearchDescriptor < T > SortScript ( Func < SortScriptDescriptor < T > , IScriptSort > sortSelector )
660
660
{
661
661
if ( Self . Sort == null )
662
- Self . Sort = new Dictionary < PropertyPathMarker , ISort > ( ) ;
662
+ Self . Sort = new List < KeyValuePair < PropertyPathMarker , ISort > > ( ) ;
663
663
664
664
sortSelector . ThrowIfNull ( "sortSelector" ) ;
665
665
var descriptor = sortSelector ( new SortScriptDescriptor < T > ( ) ) ;
666
- Self . Sort . Add ( "_script" , descriptor ) ;
666
+ Self . Sort . Add ( new KeyValuePair < PropertyPathMarker , ISort > ( "_script" , descriptor ) ) ;
667
667
return this ;
668
668
}
669
669
0 commit comments