File tree 5 files changed +29
-1
lines changed
5 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,11 @@ public static class LookConfiguration
118
118
/// Setting it to LookFieldsOnly reduces the number of Lucene fields returned to the min required to inflate a LookMatch object.
119
119
/// </summary >
120
120
public static RequestFields RequestFields { set ; }
121
+
122
+ /// <summary >
123
+ /// (Optional) Specify the max number of results to return (defaults to 5000)
124
+ /// </summary >
125
+ public static int MaxResults { set { LookService .SetMaxResults (value ); } }
121
126
}
122
127
```
123
128
Original file line number Diff line number Diff line change @@ -70,5 +70,10 @@ public static class LookConfiguration
70
70
/// Setting it to LookFieldsOnly reduces the number of Lucene fields returned to the min required to inflate a LookMatch object.
71
71
/// </summary>
72
72
public static RequestFields RequestFields { set { LookService . SetRequestFields ( value ) ; } }
73
+
74
+ /// <summary>
75
+ /// (Optional) Specify the max number of results to return (defaults to 5000)
76
+ /// </summary>
77
+ public static int MaxResults { set { LookService . SetMaxResults ( value ) ; } }
73
78
}
74
79
}
Original file line number Diff line number Diff line change 319
319
<Compile Include =" Services\LookService_ParseRawQuery.cs" />
320
320
<Compile Include =" Services\LookService_SetAfterIndexing.cs" />
321
321
<Compile Include =" Services\LookService_SetBeforeIndexing.cs" />
322
+ <Compile Include =" Services\LookService_SetMaxResults.cs" />
322
323
<Compile Include =" SortOn.cs" />
323
324
<Compile Include =" LookTag.cs" />
324
325
<Compile Include =" TagFacetQuery.cs" />
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ internal partial class LookService
90
90
/// <summary>
91
91
/// max number of results to request for a lucene query
92
92
/// </summary>
93
- private int _maxResults => 5000 ;
93
+ private int _maxResults = 5000 ;
94
94
95
95
/// <summary>
96
96
/// Supplied by the initialization event (for re-use by the LookMatch)
Original file line number Diff line number Diff line change
1
+ namespace Our . Umbraco . Look . Services
2
+ {
3
+ internal partial class LookService
4
+ {
5
+ /// <summary>
6
+ /// Set the default MaxResults value (defaults to 5000 if not specified)
7
+ /// </summary>
8
+ /// <param name="maxResults"></param>
9
+ internal static void SetMaxResults ( int maxResults )
10
+ {
11
+ if ( maxResults > 0 ) // ensure it's a valid value
12
+ {
13
+ LookService . Instance . _maxResults = maxResults ;
14
+ }
15
+ }
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments