File tree Expand file tree Collapse file tree
src/services/search/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,8 +158,6 @@ type OptionalKeysInUnion<T, K extends string> = T extends object ? OptionalKeys<
158158 */
159159export type GFilter = OptionalKeysInUnion < Schemas [ 'GFilter' ] , '@version' | 'post_filter' > ;
160160
161- type HistogramRange = { low : number | string ; high : number | string } ;
162-
163161/**
164162 * @see https://docs.globus.org/api/search/reference/post_query/#gfacet
165163 */
@@ -176,19 +174,32 @@ export type GFacet = {
176174 missing ?: number ;
177175 }
178176 | {
177+ /**
178+ * `date_histogram` faceting requires that the field was detected as a date type.
179+ * @see https://docs.globus.org/api/search/mapped_data_types/#date-formats
180+ */
179181 type : 'date_histogram' ;
180- date_interval : DateInterval ;
181- histogram_range ?: HistogramRange ;
182+ date_interval : Schemas [ 'DateHistogramFacet' ] [ 'date_interval' ] ;
183+ /**
184+ * `histogram_range` is optional for `date_histogram`, but when provided,
185+ * the `low` and `high` values must be one of the supported date formats.
186+ * @see https://docs.globus.org/api/search/mapped_data_types/#date-formats
187+ */
188+ histogram_range ?: {
189+ low : string ;
190+ high : string ;
191+ } ;
182192 }
183193 | {
184194 type : 'numeric_histogram' ;
185- size : string ;
186- histogram_range : HistogramRange ;
195+ size : number ;
196+ histogram_range : {
197+ low : number ;
198+ high : number ;
199+ } ;
187200 }
188201) ;
189202
190- type DateInterval = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' ;
191-
192203/**
193204 * @see https://docs.globus.org/api/search/reference/post_query/#gboost
194205 */
You can’t perform that action at this time.
0 commit comments