interface ExplainExplanation { description: string; details: ExplainExplanationDetail[]; value: float; } interface ExplainExplanationDetail { description: string; details?: ExplainExplanationDetail[]; value: float; } interface SearchRequest$1 extends RequestBase { index?: Indices; allow_no_indices?: boolean; allow_partial_search_results?: boolean; analyzer?: string; analyze_wildcard?: boolean; batched_reduce_size?: long; ccs_minimize_roundtrips?: boolean; default_operator?: QueryDslOperator; df?: string; expand_wildcards?: ExpandWildcards; ignore_throttled?: boolean; ignore_unavailable?: boolean; lenient?: boolean; max_concurrent_shard_requests?: long; min_compatible_shard_node?: VersionString; preference?: string; pre_filter_shard_size?: long; request_cache?: boolean; routing?: Routing; scroll?: Duration; search_type?: SearchType; suggest_field?: Field; suggest_mode?: SuggestMode; suggest_size?: long; suggest_text?: string; typed_keys?: boolean; rest_total_hits_as_int?: boolean; _source_excludes?: Fields; _source_includes?: Fields; q?: string; aggregations?: Record; /** @alias aggregations */ aggs?: Record; collapse?: SearchFieldCollapse; explain?: boolean; ext?: Record; from?: integer; highlight?: SearchHighlight; track_total_hits?: SearchTrackHits; indices_boost?: Record[]; docvalue_fields?: (QueryDslFieldAndFormat | Field)[]; knn?: KnnQuery | KnnQuery[]; rank?: RankContainer; min_score?: double; post_filter?: QueryDslQueryContainer; profile?: boolean; query?: QueryDslQueryContainer; rescore?: SearchRescore | SearchRescore[]; script_fields?: Record; search_after?: SortResults; size?: integer; slice?: SlicedScroll; sort?: Sort; _source?: SearchSourceConfig; fields?: (QueryDslFieldAndFormat | Field)[]; suggest?: SearchSuggester; terminate_after?: long; timeout?: string; track_scores?: boolean; version?: boolean; seq_no_primary_term?: boolean; stored_fields?: Fields; pit?: SearchPointInTimeReference; runtime_mappings?: MappingRuntimeFields; stats?: string[]; } interface SearchResponseBody> { took: long; timed_out: boolean; _shards: ShardStatistics; hits: SearchHitsMetadata; aggregations?: TAggregations; _clusters?: ClusterStatistics; fields?: Record; max_score?: double; num_reduce_phases?: long; profile?: SearchProfile; pit_id?: Id; _scroll_id?: ScrollId; suggest?: Record[]>; terminated_early?: boolean; } interface SearchAggregationBreakdown { build_aggregation: long; build_aggregation_count: long; build_leaf_collector: long; build_leaf_collector_count: long; collect: long; collect_count: long; initialize: long; initialize_count: long; post_collection?: long; post_collection_count?: long; reduce: long; reduce_count: long; } interface SearchAggregationProfile { breakdown: SearchAggregationBreakdown; description: string; time_in_nanos: DurationValue; type: string; debug?: SearchAggregationProfileDebug; children?: SearchAggregationProfile[]; } interface SearchAggregationProfileDebug { segments_with_multi_valued_ords?: integer; collection_strategy?: string; segments_with_single_valued_ords?: integer; total_buckets?: integer; built_buckets?: integer; result_strategy?: string; has_filter?: boolean; delegate?: string; delegate_debug?: SearchAggregationProfileDebug; chars_fetched?: integer; extract_count?: integer; extract_ns?: integer; values_fetched?: integer; collect_analyzed_ns?: integer; collect_analyzed_count?: integer; surviving_buckets?: integer; ordinals_collectors_used?: integer; ordinals_collectors_overhead_too_high?: integer; string_hashing_collectors_used?: integer; numeric_collectors_used?: integer; empty_collectors_used?: integer; deferred_aggregators?: string[]; segments_with_doc_count_field?: integer; segments_with_deleted_docs?: integer; filters?: SearchAggregationProfileDelegateDebugFilter[]; segments_counted?: integer; segments_collected?: integer; map_reducer?: string; } interface SearchAggregationProfileDelegateDebugFilter { results_from_metadata?: integer; query?: string; specialized_for?: string; segments_counted_in_constant_time?: integer; } type SearchBoundaryScanner = 'chars' | 'sentence' | 'word'; interface SearchCollector { name: string; reason: string; time_in_nanos: DurationValue; children?: SearchCollector[]; } interface SearchCompletionContext { boost?: double; context: SearchContext; neighbours?: GeoHashPrecision[]; precision?: GeoHashPrecision; prefix?: boolean; } interface SearchCompletionSuggest extends SearchSuggestBase { options: SearchCompletionSuggestOption | SearchCompletionSuggestOption[]; } interface SearchCompletionSuggestOption { collate_match?: boolean; contexts?: Record; fields?: Record; _id?: string; _index?: IndexName; _routing?: Routing; _score?: double; _source?: TDocument; text: string; score?: double; } interface SearchCompletionSuggester extends SearchSuggesterBase { contexts?: Record; fuzzy?: SearchSuggestFuzziness; regex?: SearchRegexOptions; skip_duplicates?: boolean; } type SearchContext = string | GeoLocation; interface SearchDirectGenerator { field: Field; max_edits?: integer; max_inspections?: float; max_term_freq?: float; min_doc_freq?: float; min_word_length?: integer; post_filter?: string; pre_filter?: string; prefix_length?: integer; size?: integer; suggest_mode?: SuggestMode; } interface SearchFetchProfile { type: string; description: string; time_in_nanos: DurationValue; breakdown: SearchFetchProfileBreakdown; debug?: SearchFetchProfileDebug; children?: SearchFetchProfile[]; } interface SearchFetchProfileBreakdown { load_source?: integer; load_source_count?: integer; load_stored_fields?: integer; load_stored_fields_count?: integer; next_reader?: integer; next_reader_count?: integer; process_count?: integer; process?: integer; } interface SearchFetchProfileDebug { stored_fields?: string[]; fast_path?: integer; } interface SearchFieldCollapse { field: Field; inner_hits?: SearchInnerHits | SearchInnerHits[]; max_concurrent_group_searches?: integer; collapse?: SearchFieldCollapse; } interface SearchFieldSuggester { completion?: SearchCompletionSuggester; phrase?: SearchPhraseSuggester; term?: SearchTermSuggester; prefix?: string; regex?: string; text?: string; } interface SearchHighlight extends SearchHighlightBase { encoder?: SearchHighlighterEncoder; fields: Record; } interface SearchHighlightBase { type?: SearchHighlighterType; boundary_chars?: string; boundary_max_scan?: integer; boundary_scanner?: SearchBoundaryScanner; boundary_scanner_locale?: string; force_source?: boolean; fragmenter?: SearchHighlighterFragmenter; fragment_size?: integer; highlight_filter?: boolean; highlight_query?: QueryDslQueryContainer; max_fragment_length?: integer; max_analyzed_offset?: integer; no_match_size?: integer; number_of_fragments?: integer; options?: Record; order?: SearchHighlighterOrder; phrase_limit?: integer; post_tags?: string[]; pre_tags?: string[]; require_field_match?: boolean; tags_schema?: SearchHighlighterTagsSchema; } interface SearchHighlightField extends SearchHighlightBase { fragment_offset?: integer; matched_fields?: Fields; analyzer?: AnalysisAnalyzer; } type SearchHighlighterEncoder = 'default' | 'html'; type SearchHighlighterFragmenter = 'simple' | 'span'; type SearchHighlighterOrder = 'score'; type SearchHighlighterTagsSchema = 'styled'; type SearchHighlighterType = 'plain' | 'fvh' | 'unified' | string; interface SearchHit { _index: IndexName; _id: Id; _score?: double | null; _explanation?: ExplainExplanation; fields?: Record; highlight?: Record; inner_hits?: Record; matched_queries?: string[]; _nested?: SearchNestedIdentity; _ignored?: string[]; ignored_field_values?: Record; _shard?: string; _node?: string; _routing?: string; _source?: TDocument; _seq_no?: SequenceNumber; _primary_term?: long; _version?: VersionNumber; sort?: SortResults; } interface SearchHitsMetadata { total?: SearchTotalHits | long; hits: SearchHit[]; max_score?: double | null; } interface SearchInnerHits { name?: Name; size?: integer; from?: integer; collapse?: SearchFieldCollapse; docvalue_fields?: (QueryDslFieldAndFormat | Field)[]; explain?: boolean; highlight?: SearchHighlight; ignore_unmapped?: boolean; script_fields?: Record; seq_no_primary_term?: boolean; fields?: Fields; sort?: Sort; _source?: SearchSourceConfig; stored_field?: Fields; track_scores?: boolean; version?: boolean; } interface SearchInnerHitsResult { hits: SearchHitsMetadata; } interface SearchLaplaceSmoothingModel { alpha: double; } interface SearchLinearInterpolationSmoothingModel { bigram_lambda: double; trigram_lambda: double; unigram_lambda: double; } interface SearchNestedIdentity { field: Field; offset: integer; _nested?: SearchNestedIdentity; } interface SearchPhraseSuggest extends SearchSuggestBase { options: SearchPhraseSuggestOption | SearchPhraseSuggestOption[]; } interface SearchPhraseSuggestCollate { params?: Record; prune?: boolean; query: SearchPhraseSuggestCollateQuery; } interface SearchPhraseSuggestCollateQuery { id?: Id; source?: string; } interface SearchPhraseSuggestHighlight { post_tag: string; pre_tag: string; } interface SearchPhraseSuggestOption { text: string; score: double; highlighted?: string; collate_match?: boolean; } interface SearchPhraseSuggester extends SearchSuggesterBase { collate?: SearchPhraseSuggestCollate; confidence?: double; direct_generator?: SearchDirectGenerator[]; force_unigrams?: boolean; gram_size?: integer; highlight?: SearchPhraseSuggestHighlight; max_errors?: double; real_word_error_likelihood?: double; separator?: string; shard_size?: integer; smoothing?: SearchSmoothingModelContainer; text?: string; token_limit?: integer; } interface SearchPointInTimeReference { id: Id; keep_alive?: Duration; } interface SearchProfile { shards: SearchShardProfile[]; } interface SearchQueryBreakdown { advance: long; advance_count: long; build_scorer: long; build_scorer_count: long; create_weight: long; create_weight_count: long; match: long; match_count: long; shallow_advance: long; shallow_advance_count: long; next_doc: long; next_doc_count: long; score: long; score_count: long; compute_max_score: long; compute_max_score_count: long; set_min_competitive_score: long; set_min_competitive_score_count: long; } interface SearchQueryProfile { breakdown: SearchQueryBreakdown; description: string; time_in_nanos: DurationValue; type: string; children?: SearchQueryProfile[]; } interface SearchRegexOptions { flags?: integer | string; max_determinized_states?: integer; } interface SearchRescore { query: SearchRescoreQuery; window_size?: integer; } interface SearchRescoreQuery { rescore_query: QueryDslQueryContainer; query_weight?: double; rescore_query_weight?: double; score_mode?: SearchScoreMode; } type SearchScoreMode = 'avg' | 'max' | 'min' | 'multiply' | 'total'; interface SearchSearchProfile { collector: SearchCollector[]; query: SearchQueryProfile[]; rewrite_time: long; } interface SearchShardProfile { aggregations: SearchAggregationProfile[]; id: string; searches: SearchSearchProfile[]; fetch?: SearchFetchProfile; } interface SearchSmoothingModelContainer { laplace?: SearchLaplaceSmoothingModel; linear_interpolation?: SearchLinearInterpolationSmoothingModel; stupid_backoff?: SearchStupidBackoffSmoothingModel; } type SearchSourceConfig = boolean | SearchSourceFilter | Fields; interface SearchSourceFilter { excludes?: Fields; exclude?: Fields; includes?: Fields; include?: Fields; } type SearchStringDistance = 'internal' | 'damerau_levenshtein' | 'levenshtein' | 'jaro_winkler' | 'ngram'; interface SearchStupidBackoffSmoothingModel { discount: double; } type SearchSuggest = SearchCompletionSuggest | SearchPhraseSuggest | SearchTermSuggest; interface SearchSuggestBase { length: integer; offset: integer; text: string; } interface SearchSuggestFuzziness { fuzziness?: Fuzziness; min_length?: integer; prefix_length?: integer; transpositions?: boolean; unicode_aware?: boolean; } type SearchSuggestSort = 'score' | 'frequency'; interface SearchSuggesterKeys { text?: string; } type SearchSuggester = SearchSuggesterKeys & { [property: string]: SearchFieldSuggester | string; }; interface SearchSuggesterBase { field: Field; analyzer?: string; size?: integer; } interface SearchTermSuggest extends SearchSuggestBase { options: SearchTermSuggestOption | SearchTermSuggestOption[]; } interface SearchTermSuggestOption { text: string; score: double; freq: long; highlighted?: string; collate_match?: boolean; } interface SearchTermSuggester extends SearchSuggesterBase { lowercase_terms?: boolean; max_edits?: integer; max_inspections?: integer; max_term_freq?: float; min_doc_freq?: float; min_word_length?: integer; prefix_length?: integer; shard_size?: integer; sort?: SearchSuggestSort; string_distance?: SearchStringDistance; suggest_mode?: SuggestMode; text?: string; } interface SearchTotalHits { relation: SearchTotalHitsRelation; value: long; } type SearchTotalHitsRelation = 'eq' | 'gte'; type SearchTrackHits = boolean | integer; type SpecUtilsPipeSeparatedFlags = T | string; type AggregateName = string; type ClusterAlias = string; interface ClusterDetails { status: ClusterSearchStatus; indices: string; took?: DurationValue; timed_out: boolean; _shards?: ShardStatistics; failures?: ShardFailure[]; } type ClusterSearchStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed'; interface ClusterStatistics { skipped: integer; successful: integer; total: integer; details?: Record; } interface CoordsGeoBounds { top: double; bottom: double; left: double; right: double; } type DateFormat = string; type DateMath = string; type DateTime = string | EpochTime; type Distance = string; type DistanceUnit = 'in' | 'ft' | 'yd' | 'mi' | 'nmi' | 'km' | 'm' | 'cm' | 'mm'; type Duration = string | -1 | 0; type DurationLarge = string; type DurationValue = Unit; interface EmptyObject { } type EpochTime = Unit; interface ErrorCauseKeys { type: string; reason?: string; stack_trace?: string; caused_by?: ErrorCause; root_cause?: ErrorCause[]; suppressed?: ErrorCause[]; } type ErrorCause = ErrorCauseKeys & { [property: string]: any; }; type ExpandWildcard = 'all' | 'open' | 'closed' | 'hidden' | 'none'; type ExpandWildcards = ExpandWildcard | ExpandWildcard[]; type Field = string; interface FieldSort { missing?: AggregationsMissing; mode?: SortMode; nested?: NestedSortValue; order?: SortOrder; unmapped_type?: MappingFieldType; numeric_type?: FieldSortNumericType; format?: string; } type FieldSortNumericType = 'long' | 'double' | 'date' | 'date_nanos'; type FieldValue = long | double | string | boolean | null | any; type Fields = Field | Field[]; type Fuzziness = string | integer; type GeoBounds = CoordsGeoBounds | TopLeftBottomRightGeoBounds | TopRightBottomLeftGeoBounds | WktGeoBounds; interface GeoDistanceSortKeys { mode?: SortMode; distance_type?: GeoDistanceType; ignore_unmapped?: boolean; order?: SortOrder; unit?: DistanceUnit; } type GeoDistanceSort = GeoDistanceSortKeys & { [property: string]: GeoLocation | GeoLocation[] | SortMode | GeoDistanceType | boolean | SortOrder | DistanceUnit; }; type GeoDistanceType = 'arc' | 'plane'; type GeoHash = string; interface GeoHashLocation { geohash: GeoHash; } type GeoHashPrecision = number | string; type GeoHexCell = string; interface GeoLine { type: string; coordinates: double[][]; } type GeoLocation = LatLonGeoLocation | GeoHashLocation | double[] | string; type GeoShape = any; type GeoShapeRelation = 'intersects' | 'disjoint' | 'within' | 'contains'; type GeoTile = string; type GeoTilePrecision = number; type Id = string; type Ids = Id | Id[]; type IndexName = string; type Indices = IndexName | IndexName[]; interface InlineScript extends ScriptBase { lang?: ScriptLanguage; options?: Record; source: string; } interface KnnQuery { field: Field; query_vector?: QueryVector; query_vector_builder?: QueryVectorBuilder; k: long; num_candidates: long; boost?: float; filter?: QueryDslQueryContainer | QueryDslQueryContainer[]; } interface LatLonGeoLocation { lat: double; lon: double; } type Metadata = Record; type MinimumShouldMatch = integer | string; type MultiTermQueryRewrite = string; type Name = string; interface NestedSortValue { filter?: QueryDslQueryContainer; max_children?: integer; nested?: NestedSortValue; path: Field; } type QueryVector = float[]; interface QueryVectorBuilder { text_embedding?: TextEmbedding; } interface RankContainer { rrf?: RrfRank; } type RelationName = string; interface RequestBase extends SpecUtilsCommonQueryParameters { } type Routing = string; interface RrfRank { rank_constant?: long; window_size?: long; } interface ScoreSort { order?: SortOrder; } type Script = InlineScript | string | StoredScriptId; interface ScriptBase { params?: Record; } interface ScriptField { script: Script; ignore_failure?: boolean; } type ScriptLanguage = 'painless' | 'expression' | 'mustache' | 'java' | string; interface ScriptSort { order?: SortOrder; script: Script; type?: ScriptSortType; mode?: SortMode; nested?: NestedSortValue; } type ScriptSortType = 'string' | 'number' | 'version'; type ScrollId = string; type SearchType = 'query_then_fetch' | 'dfs_query_then_fetch'; type SequenceNumber = long; interface ShardFailure { index?: IndexName; node?: string; reason: ErrorCause; shard: integer; status?: string; } interface ShardStatistics { failed: uint; successful: uint; total: uint; failures?: ShardFailure[]; skipped?: uint; } interface SlicedScroll { field?: Field; id: Id; max: integer; } type Sort = SortCombinations | SortCombinations[]; type SortCombinations = Field | SortOptions; type SortMode = 'min' | 'max' | 'sum' | 'avg' | 'median'; interface SortOptionsKeys { _score?: ScoreSort; _doc?: ScoreSort; _geo_distance?: GeoDistanceSort; _script?: ScriptSort; } type SortOptions = SortOptionsKeys & { [property: string]: FieldSort | SortOrder | ScoreSort | GeoDistanceSort | ScriptSort; }; type SortOrder = 'asc' | 'desc'; type SortResults = FieldValue[]; interface StoredScriptId extends ScriptBase { id: Id; } type SuggestMode = 'missing' | 'popular' | 'always'; type SuggestionName = string; interface TextEmbedding { model_id: string; model_text: string; } type TimeZone = string; interface TopLeftBottomRightGeoBounds { top_left: GeoLocation; bottom_right: GeoLocation; } interface TopRightBottomLeftGeoBounds { top_right: GeoLocation; bottom_left: GeoLocation; } type UnitMillis = long; type UnitNanos = long; type VersionNumber = long; type VersionString = string; type VersionType = 'internal' | 'external' | 'external_gte' | 'force'; interface WktGeoBounds { wkt: string; } type double = number; type float = number; type integer = number; type long = number; type uint = number; interface AggregationsAdjacencyMatrixAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase { filters?: Record; } interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase { key: string; } type AggregationsAdjacencyMatrixBucket = AggregationsAdjacencyMatrixBucketKeys & { [property: string]: AggregationsAggregate | string | long; }; type AggregationsAggregate = AggregationsCardinalityAggregate | AggregationsHdrPercentilesAggregate | AggregationsHdrPercentileRanksAggregate | AggregationsTDigestPercentilesAggregate | AggregationsTDigestPercentileRanksAggregate | AggregationsPercentilesBucketAggregate | AggregationsMedianAbsoluteDeviationAggregate | AggregationsMinAggregate | AggregationsMaxAggregate | AggregationsSumAggregate | AggregationsAvgAggregate | AggregationsWeightedAvgAggregate | AggregationsValueCountAggregate | AggregationsSimpleValueAggregate | AggregationsDerivativeAggregate | AggregationsBucketMetricValueAggregate | AggregationsStatsAggregate | AggregationsStatsBucketAggregate | AggregationsExtendedStatsAggregate | AggregationsExtendedStatsBucketAggregate | AggregationsGeoBoundsAggregate | AggregationsGeoCentroidAggregate | AggregationsHistogramAggregate | AggregationsDateHistogramAggregate | AggregationsAutoDateHistogramAggregate | AggregationsVariableWidthHistogramAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsLongRareTermsAggregate | AggregationsStringRareTermsAggregate | AggregationsUnmappedRareTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsNestedAggregate | AggregationsReverseNestedAggregate | AggregationsGlobalAggregate | AggregationsFilterAggregate | AggregationsChildrenAggregate | AggregationsParentAggregate | AggregationsSamplerAggregate | AggregationsUnmappedSamplerAggregate | AggregationsGeoHashGridAggregate | AggregationsGeoTileGridAggregate | AggregationsGeoHexGridAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsGeoDistanceAggregate | AggregationsIpRangeAggregate | AggregationsIpPrefixAggregate | AggregationsFiltersAggregate | AggregationsAdjacencyMatrixAggregate | AggregationsSignificantLongTermsAggregate | AggregationsSignificantStringTermsAggregate | AggregationsUnmappedSignificantTermsAggregate | AggregationsCompositeAggregate | AggregationsFrequentItemSetsAggregate | AggregationsScriptedMetricAggregate | AggregationsTopHitsAggregate | AggregationsInferenceAggregate | AggregationsStringStatsAggregate | AggregationsBoxPlotAggregate | AggregationsTopMetricsAggregate | AggregationsTTestAggregate | AggregationsRateAggregate | AggregationsCumulativeCardinalityAggregate | AggregationsMatrixStatsAggregate | AggregationsGeoLineAggregate; interface AggregationsAggregateBase { meta?: Metadata; } type AggregationsAggregateOrder = Partial> | Partial>[]; interface AggregationsAggregation { meta?: Metadata; name?: string; } interface AggregationsAggregationContainer { aggregations?: Record; aggs?: Record; meta?: Metadata; adjacency_matrix?: AggregationsAdjacencyMatrixAggregation; auto_date_histogram?: AggregationsAutoDateHistogramAggregation; avg?: AggregationsAverageAggregation; avg_bucket?: AggregationsAverageBucketAggregation; boxplot?: AggregationsBoxplotAggregation; bucket_script?: AggregationsBucketScriptAggregation; bucket_selector?: AggregationsBucketSelectorAggregation; bucket_sort?: AggregationsBucketSortAggregation; bucket_count_ks_test?: AggregationsBucketKsAggregation; bucket_correlation?: AggregationsBucketCorrelationAggregation; cardinality?: AggregationsCardinalityAggregation; categorize_text?: AggregationsCategorizeTextAggregation; children?: AggregationsChildrenAggregation; composite?: AggregationsCompositeAggregation; cumulative_cardinality?: AggregationsCumulativeCardinalityAggregation; cumulative_sum?: AggregationsCumulativeSumAggregation; date_histogram?: AggregationsDateHistogramAggregation; date_range?: AggregationsDateRangeAggregation; derivative?: AggregationsDerivativeAggregation; diversified_sampler?: AggregationsDiversifiedSamplerAggregation; extended_stats?: AggregationsExtendedStatsAggregation; extended_stats_bucket?: AggregationsExtendedStatsBucketAggregation; frequent_item_sets?: AggregationsFrequentItemSetsAggregation; filter?: QueryDslQueryContainer; filters?: AggregationsFiltersAggregation; geo_bounds?: AggregationsGeoBoundsAggregation; geo_centroid?: AggregationsGeoCentroidAggregation; geo_distance?: AggregationsGeoDistanceAggregation; geohash_grid?: AggregationsGeoHashGridAggregation; geo_line?: AggregationsGeoLineAggregation; geotile_grid?: AggregationsGeoTileGridAggregation; geohex_grid?: AggregationsGeohexGridAggregation; global?: AggregationsGlobalAggregation; histogram?: AggregationsHistogramAggregation; ip_range?: AggregationsIpRangeAggregation; ip_prefix?: AggregationsIpPrefixAggregation; inference?: AggregationsInferenceAggregation; line?: AggregationsGeoLineAggregation; matrix_stats?: AggregationsMatrixStatsAggregation; max?: AggregationsMaxAggregation; max_bucket?: AggregationsMaxBucketAggregation; median_absolute_deviation?: AggregationsMedianAbsoluteDeviationAggregation; min?: AggregationsMinAggregation; min_bucket?: AggregationsMinBucketAggregation; missing?: AggregationsMissingAggregation; moving_avg?: AggregationsMovingAverageAggregation; moving_percentiles?: AggregationsMovingPercentilesAggregation; moving_fn?: AggregationsMovingFunctionAggregation; multi_terms?: AggregationsMultiTermsAggregation; nested?: AggregationsNestedAggregation; normalize?: AggregationsNormalizeAggregation; parent?: AggregationsParentAggregation; percentile_ranks?: AggregationsPercentileRanksAggregation; percentiles?: AggregationsPercentilesAggregation; percentiles_bucket?: AggregationsPercentilesBucketAggregation; range?: AggregationsRangeAggregation; rare_terms?: AggregationsRareTermsAggregation; rate?: AggregationsRateAggregation; reverse_nested?: AggregationsReverseNestedAggregation; sampler?: AggregationsSamplerAggregation; scripted_metric?: AggregationsScriptedMetricAggregation; serial_diff?: AggregationsSerialDifferencingAggregation; significant_terms?: AggregationsSignificantTermsAggregation; significant_text?: AggregationsSignificantTextAggregation; stats?: AggregationsStatsAggregation; stats_bucket?: AggregationsStatsBucketAggregation; string_stats?: AggregationsStringStatsAggregation; sum?: AggregationsSumAggregation; sum_bucket?: AggregationsSumBucketAggregation; terms?: AggregationsTermsAggregation; top_hits?: AggregationsTopHitsAggregation; t_test?: AggregationsTTestAggregation; top_metrics?: AggregationsTopMetricsAggregation; value_count?: AggregationsValueCountAggregation; weighted_avg?: AggregationsWeightedAverageAggregation; variable_width_histogram?: AggregationsVariableWidthHistogramAggregation; } interface AggregationsAggregationRange { from?: double | string | null; key?: string; to?: double | string | null; } interface AggregationsArrayPercentilesItem { key: string; value: double | null; value_as_string?: string; } interface AggregationsAutoDateHistogramAggregate extends AggregationsMultiBucketAggregateBase { interval: DurationLarge; } interface AggregationsAutoDateHistogramAggregation extends AggregationsBucketAggregationBase { buckets?: integer; field?: Field; format?: string; minimum_interval?: AggregationsMinimumInterval; missing?: DateTime; offset?: string; params?: Record; script?: Script; time_zone?: TimeZone; } interface AggregationsAverageAggregation extends AggregationsFormatMetricAggregationBase { } interface AggregationsAverageBucketAggregation extends AggregationsPipelineAggregationBase { } interface AggregationsAvgAggregate extends AggregationsSingleMetricAggregateBase { } interface AggregationsBoxPlotAggregate extends AggregationsAggregateBase { min: double; max: double; q1: double; q2: double; q3: double; lower: double; upper: double; min_as_string?: string; max_as_string?: string; q1_as_string?: string; q2_as_string?: string; q3_as_string?: string; lower_as_string?: string; upper_as_string?: string; } interface AggregationsBoxplotAggregation extends AggregationsMetricAggregationBase { compression?: double; } interface AggregationsBucketAggregationBase extends AggregationsAggregation { } interface AggregationsBucketCorrelationAggregation extends AggregationsBucketPathAggregation { function: AggregationsBucketCorrelationFunction; } interface AggregationsBucketCorrelationFunction { count_correlation: AggregationsBucketCorrelationFunctionCountCorrelation; } interface AggregationsBucketCorrelationFunctionCountCorrelation { indicator: AggregationsBucketCorrelationFunctionCountCorrelationIndicator; } interface AggregationsBucketCorrelationFunctionCountCorrelationIndicator { doc_count: integer; expectations: double[]; fractions?: double[]; } interface AggregationsBucketKsAggregation extends AggregationsBucketPathAggregation { alternative?: string[]; fractions?: double[]; sampling_method?: string; } interface AggregationsBucketMetricValueAggregate extends AggregationsSingleMetricAggregateBase { keys: string[]; } interface AggregationsBucketPathAggregation extends AggregationsAggregation { buckets_path?: AggregationsBucketsPath; } interface AggregationsBucketScriptAggregation extends AggregationsPipelineAggregationBase { script?: Script; } interface AggregationsBucketSelectorAggregation extends AggregationsPipelineAggregationBase { script?: Script; } interface AggregationsBucketSortAggregation extends AggregationsAggregation { from?: integer; gap_policy?: AggregationsGapPolicy; size?: integer; sort?: Sort; } type AggregationsBuckets = Record | TBucket[]; type AggregationsBucketsPath = string | string[] | Record; type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1Y'; interface AggregationsCardinalityAggregate extends AggregationsAggregateBase { value: long; } interface AggregationsCardinalityAggregation extends AggregationsMetricAggregationBase { precision_threshold?: integer; rehash?: boolean; execution_hint?: AggregationsCardinalityExecutionMode; } type AggregationsCardinalityExecutionMode = 'global_ordinals' | 'segment_ordinals' | 'direct' | 'save_memory_heuristic' | 'save_time_heuristic'; interface AggregationsCategorizeTextAggregation extends AggregationsAggregation { field: Field; max_unique_tokens?: integer; max_matched_tokens?: integer; similarity_threshold?: integer; categorization_filters?: string[]; categorization_analyzer?: AggregationsCategorizeTextAnalyzer; shard_size?: integer; size?: integer; min_doc_count?: integer; shard_min_doc_count?: integer; } type AggregationsCategorizeTextAnalyzer = string | AggregationsCustomCategorizeTextAnalyzer; interface AggregationsChiSquareHeuristic { background_is_superset: boolean; include_negatives: boolean; } interface AggregationsChildrenAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsChildrenAggregate = AggregationsChildrenAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsChildrenAggregation extends AggregationsBucketAggregationBase { type?: RelationName; } interface AggregationsCompositeAggregate extends AggregationsMultiBucketAggregateBase { after_key?: AggregationsCompositeAggregateKey; } type AggregationsCompositeAggregateKey = Record; interface AggregationsCompositeAggregation extends AggregationsBucketAggregationBase { after?: AggregationsCompositeAggregateKey; size?: integer; sources?: Record[]; } interface AggregationsCompositeAggregationBase { field?: Field; missing_bucket?: boolean; missing_order?: AggregationsMissingOrder; script?: Script; value_type?: AggregationsValueType; order?: SortOrder; } interface AggregationsCompositeAggregationSource { terms?: AggregationsCompositeTermsAggregation; histogram?: AggregationsCompositeHistogramAggregation; date_histogram?: AggregationsCompositeDateHistogramAggregation; geotile_grid?: AggregationsCompositeGeoTileGridAggregation; } interface AggregationsCompositeBucketKeys extends AggregationsMultiBucketBase { key: AggregationsCompositeAggregateKey; } type AggregationsCompositeBucket = AggregationsCompositeBucketKeys & { [property: string]: AggregationsAggregate | AggregationsCompositeAggregateKey | long; }; interface AggregationsCompositeDateHistogramAggregation extends AggregationsCompositeAggregationBase { format?: string; calendar_interval?: DurationLarge; fixed_interval?: DurationLarge; offset?: Duration; time_zone?: TimeZone; } interface AggregationsCompositeGeoTileGridAggregation extends AggregationsCompositeAggregationBase { precision?: integer; bounds?: GeoBounds; } interface AggregationsCompositeHistogramAggregation extends AggregationsCompositeAggregationBase { interval: double; } interface AggregationsCompositeTermsAggregation extends AggregationsCompositeAggregationBase { } interface AggregationsCumulativeCardinalityAggregate extends AggregationsAggregateBase { value: long; value_as_string?: string; } interface AggregationsCumulativeCardinalityAggregation extends AggregationsPipelineAggregationBase { } interface AggregationsCumulativeSumAggregation extends AggregationsPipelineAggregationBase { } interface AggregationsCustomCategorizeTextAnalyzer { char_filter?: string[]; tokenizer?: string; filter?: string[]; } interface AggregationsDateHistogramAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsDateHistogramAggregation extends AggregationsBucketAggregationBase { calendar_interval?: AggregationsCalendarInterval; extended_bounds?: AggregationsExtendedBounds; hard_bounds?: AggregationsExtendedBounds; field?: Field; fixed_interval?: Duration; format?: string; interval?: Duration; min_doc_count?: integer; missing?: DateTime; offset?: Duration; order?: AggregationsAggregateOrder; params?: Record; script?: Script; time_zone?: TimeZone; keyed?: boolean; } interface AggregationsDateHistogramBucketKeys extends AggregationsMultiBucketBase { key_as_string?: string; key: EpochTime; } type AggregationsDateHistogramBucket = AggregationsDateHistogramBucketKeys & { [property: string]: AggregationsAggregate | string | EpochTime | long; }; interface AggregationsDateRangeAggregate extends AggregationsRangeAggregate { } interface AggregationsDateRangeAggregation extends AggregationsBucketAggregationBase { field?: Field; format?: string; missing?: AggregationsMissing; ranges?: AggregationsDateRangeExpression[]; time_zone?: TimeZone; keyed?: boolean; } interface AggregationsDateRangeExpression { from?: AggregationsFieldDateMath; key?: string; to?: AggregationsFieldDateMath; } interface AggregationsDerivativeAggregate extends AggregationsSingleMetricAggregateBase { normalized_value?: double; normalized_value_as_string?: string; } interface AggregationsDerivativeAggregation extends AggregationsPipelineAggregationBase { } interface AggregationsDiversifiedSamplerAggregation extends AggregationsBucketAggregationBase { execution_hint?: AggregationsSamplerAggregationExecutionHint; max_docs_per_value?: integer; script?: Script; shard_size?: integer; field?: Field; } interface AggregationsDoubleTermsAggregate extends AggregationsTermsAggregateBase { } interface AggregationsDoubleTermsBucketKeys extends AggregationsTermsBucketBase { key: double; key_as_string?: string; } type AggregationsDoubleTermsBucket = AggregationsDoubleTermsBucketKeys & { [property: string]: AggregationsAggregate | double | string | long; }; interface AggregationsEwmaModelSettings { alpha?: float; } interface AggregationsEwmaMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { model: 'ewma'; settings: AggregationsEwmaModelSettings; } interface AggregationsExtendedBounds { max: T; min: T; } interface AggregationsExtendedStatsAggregate extends AggregationsStatsAggregate { sum_of_squares: double | null; variance: double | null; variance_population: double | null; variance_sampling: double | null; std_deviation: double | null; std_deviation_population: double | null; std_deviation_sampling: double | null; std_deviation_bounds?: AggregationsStandardDeviationBounds; sum_of_squares_as_string?: string; variance_as_string?: string; variance_population_as_string?: string; variance_sampling_as_string?: string; std_deviation_as_string?: string; std_deviation_bounds_as_string?: AggregationsStandardDeviationBoundsAsString; } interface AggregationsExtendedStatsAggregation extends AggregationsFormatMetricAggregationBase { sigma?: double; } interface AggregationsExtendedStatsBucketAggregate extends AggregationsExtendedStatsAggregate { } interface AggregationsExtendedStatsBucketAggregation extends AggregationsPipelineAggregationBase { sigma?: double; } type AggregationsFieldDateMath = DateMath | double; interface AggregationsFilterAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsFilterAggregate = AggregationsFilterAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsFiltersAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsFiltersAggregation extends AggregationsBucketAggregationBase { filters?: AggregationsBuckets; other_bucket?: boolean; other_bucket_key?: string; keyed?: boolean; } interface AggregationsFiltersBucketKeys extends AggregationsMultiBucketBase { } type AggregationsFiltersBucket = AggregationsFiltersBucketKeys & { [property: string]: AggregationsAggregate | long; }; interface AggregationsFormatMetricAggregationBase extends AggregationsMetricAggregationBase { format?: string; } interface AggregationsFormattableMetricAggregation extends AggregationsMetricAggregationBase { format?: string; } interface AggregationsFrequentItemSetsAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsFrequentItemSetsAggregation { fields: AggregationsFrequentItemSetsField[]; minimum_set_size?: integer; minimum_support?: double; size?: integer; filter?: QueryDslQueryContainer; } interface AggregationsFrequentItemSetsBucketKeys extends AggregationsMultiBucketBase { key: Record; support: double; } type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBucketKeys & { [property: string]: AggregationsAggregate | Record | double | long; }; interface AggregationsFrequentItemSetsField { field: Field; exclude?: AggregationsTermsExclude; include?: AggregationsTermsInclude; } type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values'; interface AggregationsGeoBoundsAggregate extends AggregationsAggregateBase { bounds?: GeoBounds; } interface AggregationsGeoBoundsAggregation extends AggregationsMetricAggregationBase { wrap_longitude?: boolean; } interface AggregationsGeoCentroidAggregate extends AggregationsAggregateBase { count: long; location?: GeoLocation; } interface AggregationsGeoCentroidAggregation extends AggregationsMetricAggregationBase { count?: long; location?: GeoLocation; } interface AggregationsGeoDistanceAggregate extends AggregationsRangeAggregate { } interface AggregationsGeoDistanceAggregation extends AggregationsBucketAggregationBase { distance_type?: GeoDistanceType; field?: Field; origin?: GeoLocation; ranges?: AggregationsAggregationRange[]; unit?: DistanceUnit; } interface AggregationsGeoHashGridAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsGeoHashGridAggregation extends AggregationsBucketAggregationBase { bounds?: GeoBounds; field?: Field; precision?: GeoHashPrecision; shard_size?: integer; size?: integer; } interface AggregationsGeoHashGridBucketKeys extends AggregationsMultiBucketBase { key: GeoHash; } type AggregationsGeoHashGridBucket = AggregationsGeoHashGridBucketKeys & { [property: string]: AggregationsAggregate | GeoHash | long; }; interface AggregationsGeoHexGridAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsGeoHexGridBucketKeys extends AggregationsMultiBucketBase { key: GeoHexCell; } type AggregationsGeoHexGridBucket = AggregationsGeoHexGridBucketKeys & { [property: string]: AggregationsAggregate | GeoHexCell | long; }; interface AggregationsGeoLineAggregate extends AggregationsAggregateBase { type: string; geometry: GeoLine; properties: any; } interface AggregationsGeoLineAggregation { point: AggregationsGeoLinePoint; sort: AggregationsGeoLineSort; include_sort?: boolean; sort_order?: SortOrder; size?: integer; } interface AggregationsGeoLinePoint { field: Field; } interface AggregationsGeoLineSort { field: Field; } interface AggregationsGeoTileGridAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsGeoTileGridAggregation extends AggregationsBucketAggregationBase { field?: Field; precision?: GeoTilePrecision; shard_size?: integer; size?: integer; bounds?: GeoBounds; } interface AggregationsGeoTileGridBucketKeys extends AggregationsMultiBucketBase { key: GeoTile; } type AggregationsGeoTileGridBucket = AggregationsGeoTileGridBucketKeys & { [property: string]: AggregationsAggregate | GeoTile | long; }; interface AggregationsGeohexGridAggregation extends AggregationsBucketAggregationBase { field: Field; precision?: integer; bounds?: GeoBounds; size?: integer; shard_size?: integer; } interface AggregationsGlobalAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsGlobalAggregate = AggregationsGlobalAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsGlobalAggregation extends AggregationsBucketAggregationBase { } interface AggregationsGoogleNormalizedDistanceHeuristic { background_is_superset?: boolean; } interface AggregationsHdrMethod { number_of_significant_value_digits?: integer; } interface AggregationsHdrPercentileRanksAggregate extends AggregationsPercentilesAggregateBase { } interface AggregationsHdrPercentilesAggregate extends AggregationsPercentilesAggregateBase { } interface AggregationsHistogramAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsHistogramAggregation extends AggregationsBucketAggregationBase { extended_bounds?: AggregationsExtendedBounds; hard_bounds?: AggregationsExtendedBounds; field?: Field; interval?: double; min_doc_count?: integer; missing?: double; offset?: double; order?: AggregationsAggregateOrder; script?: Script; format?: string; keyed?: boolean; } interface AggregationsHistogramBucketKeys extends AggregationsMultiBucketBase { key_as_string?: string; key: double; } type AggregationsHistogramBucket = AggregationsHistogramBucketKeys & { [property: string]: AggregationsAggregate | string | double | long; }; interface AggregationsHoltLinearModelSettings { alpha?: float; beta?: float; } interface AggregationsHoltMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { model: 'holt'; settings: AggregationsHoltLinearModelSettings; } interface AggregationsHoltWintersModelSettings { alpha?: float; beta?: float; gamma?: float; pad?: boolean; period?: integer; type?: AggregationsHoltWintersType; } interface AggregationsHoltWintersMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { model: 'holt_winters'; settings: AggregationsHoltWintersModelSettings; } type AggregationsHoltWintersType = 'add' | 'mult'; interface AggregationsInferenceAggregateKeys extends AggregationsAggregateBase { value?: FieldValue; feature_importance?: AggregationsInferenceFeatureImportance[]; top_classes?: AggregationsInferenceTopClassEntry[]; warning?: string; } type AggregationsInferenceAggregate = AggregationsInferenceAggregateKeys & { [property: string]: any; }; interface AggregationsInferenceAggregation extends AggregationsPipelineAggregationBase { model_id: Name; inference_config?: AggregationsInferenceConfigContainer; } interface AggregationsInferenceClassImportance { class_name: string; importance: double; } interface AggregationsInferenceConfigContainer { regression?: MlRegressionInferenceOptions; classification?: MlClassificationInferenceOptions; } interface AggregationsInferenceFeatureImportance { feature_name: string; importance?: double; classes?: AggregationsInferenceClassImportance[]; } interface AggregationsInferenceTopClassEntry { class_name: FieldValue; class_probability: double; class_score: double; } interface AggregationsIpPrefixAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsIpPrefixAggregation extends AggregationsBucketAggregationBase { field: Field; prefix_length: integer; is_ipv6?: boolean; append_prefix_length?: boolean; keyed?: boolean; min_doc_count?: long; } interface AggregationsIpPrefixBucketKeys extends AggregationsMultiBucketBase { is_ipv6: boolean; key: string; prefix_length: integer; netmask?: string; } type AggregationsIpPrefixBucket = AggregationsIpPrefixBucketKeys & { [property: string]: AggregationsAggregate | boolean | string | integer | long; }; interface AggregationsIpRangeAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsIpRangeAggregation extends AggregationsBucketAggregationBase { field?: Field; ranges?: AggregationsIpRangeAggregationRange[]; } interface AggregationsIpRangeAggregationRange { from?: string | null; mask?: string; to?: string | null; } interface AggregationsIpRangeBucketKeys extends AggregationsMultiBucketBase { key?: string; from?: string; to?: string; } type AggregationsIpRangeBucket = AggregationsIpRangeBucketKeys & { [property: string]: AggregationsAggregate | string | long; }; type AggregationsKeyedPercentiles = Record; interface AggregationsLinearMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { model: 'linear'; settings: EmptyObject; } interface AggregationsLongRareTermsAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsLongRareTermsBucketKeys extends AggregationsMultiBucketBase { key: long; key_as_string?: string; } type AggregationsLongRareTermsBucket = AggregationsLongRareTermsBucketKeys & { [property: string]: AggregationsAggregate | long | string; }; interface AggregationsLongTermsAggregate extends AggregationsTermsAggregateBase { } interface AggregationsLongTermsBucketKeys extends AggregationsTermsBucketBase { key: long; key_as_string?: string; } type AggregationsLongTermsBucket = AggregationsLongTermsBucketKeys & { [property: string]: AggregationsAggregate | long | string; }; interface AggregationsMatrixAggregation extends AggregationsAggregation { fields?: Fields; missing?: Record; } interface AggregationsMatrixStatsAggregate extends AggregationsAggregateBase { doc_count: long; fields?: AggregationsMatrixStatsFields[]; } interface AggregationsMatrixStatsAggregation extends AggregationsMatrixAggregation { mode?: SortMode; } interface AggregationsMatrixStatsFields { name: Field; count: long; mean: double; variance: double; skewness: double; kurtosis: double; covariance: Record; correlation: Record; } interface AggregationsMaxAggregate extends AggregationsSingleMetricAggregateBase { } interface AggregationsMaxAggregation extends AggregationsFormatMetricAggregationBase { } interface AggregationsMaxBucketAggregation extends AggregationsPipelineAggregationBase { } interface AggregationsMedianAbsoluteDeviationAggregate extends AggregationsSingleMetricAggregateBase { } interface AggregationsMedianAbsoluteDeviationAggregation extends AggregationsFormatMetricAggregationBase { compression?: double; } interface AggregationsMetricAggregationBase { field?: Field; missing?: AggregationsMissing; script?: Script; } interface AggregationsMinAggregate extends AggregationsSingleMetricAggregateBase { } interface AggregationsMinAggregation extends AggregationsFormatMetricAggregationBase { } interface AggregationsMinBucketAggregation extends AggregationsPipelineAggregationBase { } type AggregationsMinimumInterval = 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year'; type AggregationsMissing = string | integer | double | boolean; interface AggregationsMissingAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsMissingAggregate = AggregationsMissingAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsMissingAggregation extends AggregationsBucketAggregationBase { field?: Field; missing?: AggregationsMissing; } type AggregationsMissingOrder = 'first' | 'last' | 'default'; type AggregationsMovingAverageAggregation = AggregationsLinearMovingAverageAggregation | AggregationsSimpleMovingAverageAggregation | AggregationsEwmaMovingAverageAggregation | AggregationsHoltMovingAverageAggregation | AggregationsHoltWintersMovingAverageAggregation; interface AggregationsMovingAverageAggregationBase extends AggregationsPipelineAggregationBase { minimize?: boolean; predict?: integer; window?: integer; } interface AggregationsMovingFunctionAggregation extends AggregationsPipelineAggregationBase { script?: string; shift?: integer; window?: integer; } interface AggregationsMovingPercentilesAggregation extends AggregationsPipelineAggregationBase { window?: integer; shift?: integer; keyed?: boolean; } interface AggregationsMultiBucketAggregateBase extends AggregationsAggregateBase { buckets: AggregationsBuckets; } interface AggregationsMultiBucketBase { doc_count: long; } interface AggregationsMultiTermLookup { field: Field; missing?: AggregationsMissing; } interface AggregationsMultiTermsAggregate extends AggregationsTermsAggregateBase { } interface AggregationsMultiTermsAggregation extends AggregationsBucketAggregationBase { collect_mode?: AggregationsTermsAggregationCollectMode; order?: AggregationsAggregateOrder; min_doc_count?: long; shard_min_doc_count?: long; shard_size?: integer; show_term_doc_count_error?: boolean; size?: integer; terms: AggregationsMultiTermLookup[]; } interface AggregationsMultiTermsBucketKeys extends AggregationsMultiBucketBase { key: FieldValue[]; key_as_string?: string; doc_count_error_upper_bound?: long; } type AggregationsMultiTermsBucket = AggregationsMultiTermsBucketKeys & { [property: string]: AggregationsAggregate | FieldValue[] | string | long; }; interface AggregationsMutualInformationHeuristic { background_is_superset?: boolean; include_negatives?: boolean; } interface AggregationsNestedAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsNestedAggregate = AggregationsNestedAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsNestedAggregation extends AggregationsBucketAggregationBase { path?: Field; } interface AggregationsNormalizeAggregation extends AggregationsPipelineAggregationBase { method?: AggregationsNormalizeMethod; } type AggregationsNormalizeMethod = 'rescale_0_1' | 'rescale_0_100' | 'percent_of_sum' | 'mean' | 'z-score' | 'softmax'; interface AggregationsParentAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsParentAggregate = AggregationsParentAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsParentAggregation extends AggregationsBucketAggregationBase { type?: RelationName; } interface AggregationsPercentageScoreHeuristic { } interface AggregationsPercentileRanksAggregation extends AggregationsFormatMetricAggregationBase { keyed?: boolean; values?: double[] | null; hdr?: AggregationsHdrMethod; tdigest?: AggregationsTDigest; } type AggregationsPercentiles = AggregationsKeyedPercentiles | AggregationsArrayPercentilesItem[]; interface AggregationsPercentilesAggregateBase extends AggregationsAggregateBase { values: AggregationsPercentiles; } interface AggregationsPercentilesAggregation extends AggregationsFormatMetricAggregationBase { keyed?: boolean; percents?: double[]; hdr?: AggregationsHdrMethod; tdigest?: AggregationsTDigest; } interface AggregationsPercentilesBucketAggregate extends AggregationsPercentilesAggregateBase { } interface AggregationsPercentilesBucketAggregation extends AggregationsPipelineAggregationBase { percents?: double[]; } interface AggregationsPipelineAggregationBase extends AggregationsBucketPathAggregation { format?: string; gap_policy?: AggregationsGapPolicy; } interface AggregationsRangeAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsRangeAggregation extends AggregationsBucketAggregationBase { field?: Field; missing?: integer; ranges?: AggregationsAggregationRange[]; script?: Script; keyed?: boolean; format?: string; } interface AggregationsRangeBucketKeys extends AggregationsMultiBucketBase { from?: double; to?: double; from_as_string?: string; to_as_string?: string; key?: string; } type AggregationsRangeBucket = AggregationsRangeBucketKeys & { [property: string]: AggregationsAggregate | double | string | long; }; interface AggregationsRareTermsAggregation extends AggregationsBucketAggregationBase { exclude?: AggregationsTermsExclude; field?: Field; include?: AggregationsTermsInclude; max_doc_count?: long; missing?: AggregationsMissing; precision?: double; value_type?: string; } interface AggregationsRateAggregate extends AggregationsAggregateBase { value: double; value_as_string?: string; } interface AggregationsRateAggregation extends AggregationsFormatMetricAggregationBase { unit?: AggregationsCalendarInterval; mode?: AggregationsRateMode; } type AggregationsRateMode = 'sum' | 'value_count'; interface AggregationsReverseNestedAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsReverseNestedAggregate = AggregationsReverseNestedAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsReverseNestedAggregation extends AggregationsBucketAggregationBase { path?: Field; } interface AggregationsSamplerAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsSamplerAggregate = AggregationsSamplerAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsSamplerAggregation extends AggregationsBucketAggregationBase { shard_size?: integer; } type AggregationsSamplerAggregationExecutionHint = 'map' | 'global_ordinals' | 'bytes_hash'; interface AggregationsScriptedHeuristic { script: Script; } interface AggregationsScriptedMetricAggregate extends AggregationsAggregateBase { value: any; } interface AggregationsScriptedMetricAggregation extends AggregationsMetricAggregationBase { combine_script?: Script; init_script?: Script; map_script?: Script; params?: Record; reduce_script?: Script; } interface AggregationsSerialDifferencingAggregation extends AggregationsPipelineAggregationBase { lag?: integer; } interface AggregationsSignificantLongTermsAggregate extends AggregationsSignificantTermsAggregateBase { } interface AggregationsSignificantLongTermsBucketKeys extends AggregationsSignificantTermsBucketBase { key: long; key_as_string?: string; } type AggregationsSignificantLongTermsBucket = AggregationsSignificantLongTermsBucketKeys & { [property: string]: AggregationsAggregate | long | string | double; }; interface AggregationsSignificantStringTermsAggregate extends AggregationsSignificantTermsAggregateBase { } interface AggregationsSignificantStringTermsBucketKeys extends AggregationsSignificantTermsBucketBase { key: string; } type AggregationsSignificantStringTermsBucket = AggregationsSignificantStringTermsBucketKeys & { [property: string]: AggregationsAggregate | string | double | long; }; interface AggregationsSignificantTermsAggregateBase extends AggregationsMultiBucketAggregateBase { bg_count?: long; doc_count?: long; } interface AggregationsSignificantTermsAggregation extends AggregationsBucketAggregationBase { background_filter?: QueryDslQueryContainer; chi_square?: AggregationsChiSquareHeuristic; exclude?: AggregationsTermsExclude; execution_hint?: AggregationsTermsAggregationExecutionHint; field?: Field; gnd?: AggregationsGoogleNormalizedDistanceHeuristic; include?: AggregationsTermsInclude; jlh?: EmptyObject; min_doc_count?: long; mutual_information?: AggregationsMutualInformationHeuristic; percentage?: AggregationsPercentageScoreHeuristic; script_heuristic?: AggregationsScriptedHeuristic; shard_min_doc_count?: long; shard_size?: integer; size?: integer; } interface AggregationsSignificantTermsBucketBase extends AggregationsMultiBucketBase { score: double; bg_count: long; } interface AggregationsSignificantTextAggregation extends AggregationsBucketAggregationBase { background_filter?: QueryDslQueryContainer; chi_square?: AggregationsChiSquareHeuristic; exclude?: AggregationsTermsExclude; execution_hint?: AggregationsTermsAggregationExecutionHint; field?: Field; filter_duplicate_text?: boolean; gnd?: AggregationsGoogleNormalizedDistanceHeuristic; include?: AggregationsTermsInclude; jlh?: EmptyObject; min_doc_count?: long; mutual_information?: AggregationsMutualInformationHeuristic; percentage?: AggregationsPercentageScoreHeuristic; script_heuristic?: AggregationsScriptedHeuristic; shard_min_doc_count?: long; shard_size?: integer; size?: integer; source_fields?: Fields; } interface AggregationsSimpleMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { model: 'simple'; settings: EmptyObject; } interface AggregationsSimpleValueAggregate extends AggregationsSingleMetricAggregateBase { } interface AggregationsSingleBucketAggregateBase extends AggregationsAggregateBase { doc_count: long; } interface AggregationsSingleMetricAggregateBase extends AggregationsAggregateBase { value: double | null; value_as_string?: string; } interface AggregationsStandardDeviationBounds { upper: double | null; lower: double | null; upper_population: double | null; lower_population: double | null; upper_sampling: double | null; lower_sampling: double | null; } interface AggregationsStandardDeviationBoundsAsString { upper: string; lower: string; upper_population: string; lower_population: string; upper_sampling: string; lower_sampling: string; } interface AggregationsStatsAggregate extends AggregationsAggregateBase { count: long; min: double | null; max: double | null; avg: double | null; sum: double; min_as_string?: string; max_as_string?: string; avg_as_string?: string; sum_as_string?: string; } interface AggregationsStatsAggregation extends AggregationsFormatMetricAggregationBase { } interface AggregationsStatsBucketAggregate extends AggregationsStatsAggregate { } interface AggregationsStatsBucketAggregation extends AggregationsPipelineAggregationBase { } interface AggregationsStringRareTermsAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsStringRareTermsBucketKeys extends AggregationsMultiBucketBase { key: string; } type AggregationsStringRareTermsBucket = AggregationsStringRareTermsBucketKeys & { [property: string]: AggregationsAggregate | string | long; }; interface AggregationsStringStatsAggregate extends AggregationsAggregateBase { count: long; min_length: integer | null; max_length: integer | null; avg_length: double | null; entropy: double | null; distribution?: Record | null; min_length_as_string?: string; max_length_as_string?: string; avg_length_as_string?: string; } interface AggregationsStringStatsAggregation extends AggregationsMetricAggregationBase { show_distribution?: boolean; } interface AggregationsStringTermsAggregate extends AggregationsTermsAggregateBase { } interface AggregationsStringTermsBucketKeys extends AggregationsTermsBucketBase { key: FieldValue; } type AggregationsStringTermsBucket = AggregationsStringTermsBucketKeys & { [property: string]: AggregationsAggregate | FieldValue | long; }; interface AggregationsSumAggregate extends AggregationsSingleMetricAggregateBase { } interface AggregationsSumAggregation extends AggregationsFormatMetricAggregationBase { } interface AggregationsSumBucketAggregation extends AggregationsPipelineAggregationBase { } interface AggregationsTDigest { compression?: integer; } interface AggregationsTDigestPercentileRanksAggregate extends AggregationsPercentilesAggregateBase { } interface AggregationsTDigestPercentilesAggregate extends AggregationsPercentilesAggregateBase { } interface AggregationsTTestAggregate extends AggregationsAggregateBase { value: double | null; value_as_string?: string; } interface AggregationsTTestAggregation extends AggregationsAggregation { a?: AggregationsTestPopulation; b?: AggregationsTestPopulation; type?: AggregationsTTestType; } type AggregationsTTestType = 'paired' | 'homoscedastic' | 'heteroscedastic'; interface AggregationsTermsAggregateBase extends AggregationsMultiBucketAggregateBase { doc_count_error_upper_bound?: long; sum_other_doc_count?: long; } interface AggregationsTermsAggregation extends AggregationsBucketAggregationBase { collect_mode?: AggregationsTermsAggregationCollectMode; exclude?: AggregationsTermsExclude; execution_hint?: AggregationsTermsAggregationExecutionHint; field?: Field; include?: AggregationsTermsInclude; min_doc_count?: integer; missing?: AggregationsMissing; missing_order?: AggregationsMissingOrder; missing_bucket?: boolean; value_type?: string; order?: AggregationsAggregateOrder; script?: Script; shard_size?: integer; show_term_doc_count_error?: boolean; size?: integer; format?: string; } type AggregationsTermsAggregationCollectMode = 'depth_first' | 'breadth_first'; type AggregationsTermsAggregationExecutionHint = 'map' | 'global_ordinals' | 'global_ordinals_hash' | 'global_ordinals_low_cardinality'; interface AggregationsTermsBucketBase extends AggregationsMultiBucketBase { doc_count_error?: long; } type AggregationsTermsExclude = string | string[]; type AggregationsTermsInclude = string | string[] | AggregationsTermsPartition; interface AggregationsTermsPartition { num_partitions: long; partition: long; } interface AggregationsTestPopulation { field: Field; script?: Script; filter?: QueryDslQueryContainer; } interface AggregationsTopHitsAggregate extends AggregationsAggregateBase { hits: SearchHitsMetadata; } interface AggregationsTopHitsAggregation extends AggregationsMetricAggregationBase { docvalue_fields?: Fields; explain?: boolean; from?: integer; highlight?: SearchHighlight; script_fields?: Record; size?: integer; sort?: Sort; _source?: SearchSourceConfig; stored_fields?: Fields; track_scores?: boolean; version?: boolean; seq_no_primary_term?: boolean; } interface AggregationsTopMetrics { sort: (FieldValue | null)[]; metrics: Record; } interface AggregationsTopMetricsAggregate extends AggregationsAggregateBase { top: AggregationsTopMetrics[]; } interface AggregationsTopMetricsAggregation extends AggregationsMetricAggregationBase { metrics?: AggregationsTopMetricsValue | AggregationsTopMetricsValue[]; size?: integer; sort?: Sort; } interface AggregationsTopMetricsValue { field: Field; } interface AggregationsUnmappedRareTermsAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsUnmappedSamplerAggregateKeys extends AggregationsSingleBucketAggregateBase { } type AggregationsUnmappedSamplerAggregate = AggregationsUnmappedSamplerAggregateKeys & { [property: string]: AggregationsAggregate | long | Metadata; }; interface AggregationsUnmappedSignificantTermsAggregate extends AggregationsSignificantTermsAggregateBase { } interface AggregationsUnmappedTermsAggregate extends AggregationsTermsAggregateBase { } interface AggregationsValueCountAggregate extends AggregationsSingleMetricAggregateBase { } interface AggregationsValueCountAggregation extends AggregationsFormattableMetricAggregation { } type AggregationsValueType = 'string' | 'long' | 'double' | 'number' | 'date' | 'date_nanos' | 'ip' | 'numeric' | 'geo_point' | 'boolean'; interface AggregationsVariableWidthHistogramAggregate extends AggregationsMultiBucketAggregateBase { } interface AggregationsVariableWidthHistogramAggregation { field?: Field; buckets?: integer; shard_size?: integer; initial_buffer?: integer; } interface AggregationsVariableWidthHistogramBucketKeys extends AggregationsMultiBucketBase { min: double; key: double; max: double; min_as_string?: string; key_as_string?: string; max_as_string?: string; } type AggregationsVariableWidthHistogramBucket = AggregationsVariableWidthHistogramBucketKeys & { [property: string]: AggregationsAggregate | double | string | long; }; interface AggregationsWeightedAverageAggregation extends AggregationsAggregation { format?: string; value?: AggregationsWeightedAverageValue; value_type?: AggregationsValueType; weight?: AggregationsWeightedAverageValue; } interface AggregationsWeightedAverageValue { field?: Field; missing?: double; script?: Script; } interface AggregationsWeightedAvgAggregate extends AggregationsSingleMetricAggregateBase { } type AnalysisAnalyzer = AnalysisCustomAnalyzer | AnalysisFingerprintAnalyzer | AnalysisKeywordAnalyzer | AnalysisLanguageAnalyzer | AnalysisNoriAnalyzer | AnalysisPatternAnalyzer | AnalysisSimpleAnalyzer | AnalysisStandardAnalyzer | AnalysisStopAnalyzer | AnalysisWhitespaceAnalyzer | AnalysisIcuAnalyzer | AnalysisKuromojiAnalyzer | AnalysisSnowballAnalyzer | AnalysisDutchAnalyzer; interface AnalysisCustomAnalyzer { type: 'custom'; char_filter?: string[]; filter?: string[]; position_increment_gap?: integer; position_offset_gap?: integer; tokenizer: string; } interface AnalysisDutchAnalyzer { type: 'dutch'; stopwords?: AnalysisStopWords; } interface AnalysisFingerprintAnalyzer { type: 'fingerprint'; version?: VersionString; max_output_size: integer; preserve_original: boolean; separator: string; stopwords?: AnalysisStopWords; stopwords_path?: string; } interface AnalysisIcuAnalyzer { type: 'icu_analyzer'; method: AnalysisIcuNormalizationType; mode: AnalysisIcuNormalizationMode; } type AnalysisIcuNormalizationMode = 'decompose' | 'compose'; type AnalysisIcuNormalizationType = 'nfc' | 'nfkc' | 'nfkc_cf'; interface AnalysisKeywordAnalyzer { type: 'keyword'; version?: VersionString; } interface AnalysisKuromojiAnalyzer { type: 'kuromoji'; mode: AnalysisKuromojiTokenizationMode; user_dictionary?: string; } type AnalysisKuromojiTokenizationMode = 'normal' | 'search' | 'extended'; type AnalysisLanguage = 'Arabic' | 'Armenian' | 'Basque' | 'Brazilian' | 'Bulgarian' | 'Catalan' | 'Chinese' | 'Cjk' | 'Czech' | 'Danish' | 'Dutch' | 'English' | 'Estonian' | 'Finnish' | 'French' | 'Galician' | 'German' | 'Greek' | 'Hindi' | 'Hungarian' | 'Indonesian' | 'Irish' | 'Italian' | 'Latvian' | 'Norwegian' | 'Persian' | 'Portuguese' | 'Romanian' | 'Russian' | 'Sorani' | 'Spanish' | 'Swedish' | 'Turkish' | 'Thai'; interface AnalysisLanguageAnalyzer { type: 'language'; version?: VersionString; language: AnalysisLanguage; stem_exclusion: string[]; stopwords?: AnalysisStopWords; stopwords_path?: string; } interface AnalysisNoriAnalyzer { type: 'nori'; version?: VersionString; decompound_mode?: AnalysisNoriDecompoundMode; stoptags?: string[]; user_dictionary?: string; } type AnalysisNoriDecompoundMode = 'discard' | 'none' | 'mixed'; interface AnalysisPatternAnalyzer { type: 'pattern'; version?: VersionString; flags?: string; lowercase?: boolean; pattern: string; stopwords?: AnalysisStopWords; } interface AnalysisSimpleAnalyzer { type: 'simple'; version?: VersionString; } interface AnalysisSnowballAnalyzer { type: 'snowball'; version?: VersionString; language: AnalysisSnowballLanguage; stopwords?: AnalysisStopWords; } type AnalysisSnowballLanguage = 'Armenian' | 'Basque' | 'Catalan' | 'Danish' | 'Dutch' | 'English' | 'Finnish' | 'French' | 'German' | 'German2' | 'Hungarian' | 'Italian' | 'Kp' | 'Lovins' | 'Norwegian' | 'Porter' | 'Portuguese' | 'Romanian' | 'Russian' | 'Spanish' | 'Swedish' | 'Turkish'; interface AnalysisStandardAnalyzer { type: 'standard'; max_token_length?: integer; stopwords?: AnalysisStopWords; } interface AnalysisStopAnalyzer { type: 'stop'; version?: VersionString; stopwords?: AnalysisStopWords; stopwords_path?: string; } type AnalysisStopWords = string | string[]; interface AnalysisWhitespaceAnalyzer { type: 'whitespace'; version?: VersionString; } type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'match_only_text'; interface MappingRuntimeField { fetch_fields?: (MappingRuntimeFieldFetchFields | Field)[]; format?: string; input_field?: Field; target_field?: Field; target_index?: IndexName; script?: Script; type: MappingRuntimeFieldType; } interface MappingRuntimeFieldFetchFields { field: Field; format?: string; } type MappingRuntimeFieldType = 'boolean' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup'; type MappingRuntimeFields = Record; interface QueryDslBoolQuery extends QueryDslQueryBase { filter?: QueryDslQueryContainer | QueryDslQueryContainer[]; minimum_should_match?: MinimumShouldMatch; must?: QueryDslQueryContainer | QueryDslQueryContainer[]; must_not?: QueryDslQueryContainer | QueryDslQueryContainer[]; should?: QueryDslQueryContainer | QueryDslQueryContainer[]; } interface QueryDslBoostingQuery extends QueryDslQueryBase { negative_boost: double; negative: QueryDslQueryContainer; positive: QueryDslQueryContainer; } type QueryDslChildScoreMode = 'none' | 'avg' | 'sum' | 'max' | 'min'; type QueryDslCombinedFieldsOperator = 'or' | 'and'; interface QueryDslCombinedFieldsQuery extends QueryDslQueryBase { fields: Field[]; query: string; auto_generate_synonyms_phrase_query?: boolean; operator?: QueryDslCombinedFieldsOperator; minimum_should_match?: MinimumShouldMatch; zero_terms_query?: QueryDslCombinedFieldsZeroTerms; } type QueryDslCombinedFieldsZeroTerms = 'none' | 'all'; interface QueryDslCommonTermsQuery extends QueryDslQueryBase { analyzer?: string; cutoff_frequency?: double; high_freq_operator?: QueryDslOperator; low_freq_operator?: QueryDslOperator; minimum_should_match?: MinimumShouldMatch; query: string; } interface QueryDslConstantScoreQuery extends QueryDslQueryBase { filter: QueryDslQueryContainer; } interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode; }; interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { gt?: DateMath; gte?: DateMath; lt?: DateMath; lte?: DateMath; from?: DateMath | null; to?: DateMath | null; format?: DateFormat; time_zone?: TimeZone; } type QueryDslDecayFunction = QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction; interface QueryDslDecayFunctionBase { multi_value_mode?: QueryDslMultiValueMode; } interface QueryDslDecayPlacement { decay?: double; offset?: TScale; scale?: TScale; origin?: TOrigin; } interface QueryDslDisMaxQuery extends QueryDslQueryBase { queries: QueryDslQueryContainer[]; tie_breaker?: double; } type QueryDslDistanceFeatureQuery = QueryDslGeoDistanceFeatureQuery | QueryDslDateDistanceFeatureQuery; interface QueryDslDistanceFeatureQueryBase extends QueryDslQueryBase { origin: TOrigin; pivot: TDistance; field: Field; } interface QueryDslExistsQuery extends QueryDslQueryBase { field: Field; } interface QueryDslFieldAndFormat { field: Field; format?: string; include_unmapped?: boolean; } interface QueryDslFieldLookup { id: Id; index?: IndexName; path?: Field; routing?: Routing; } type QueryDslFieldValueFactorModifier = 'none' | 'log' | 'log1p' | 'log2p' | 'ln' | 'ln1p' | 'ln2p' | 'square' | 'sqrt' | 'reciprocal'; interface QueryDslFieldValueFactorScoreFunction { field: Field; factor?: double; missing?: double; modifier?: QueryDslFieldValueFactorModifier; } type QueryDslFunctionBoostMode = 'multiply' | 'replace' | 'sum' | 'avg' | 'max' | 'min'; interface QueryDslFunctionScoreContainer { exp?: QueryDslDecayFunction; gauss?: QueryDslDecayFunction; linear?: QueryDslDecayFunction; field_value_factor?: QueryDslFieldValueFactorScoreFunction; random_score?: QueryDslRandomScoreFunction; script_score?: QueryDslScriptScoreFunction; filter?: QueryDslQueryContainer; weight?: double; } type QueryDslFunctionScoreMode = 'multiply' | 'sum' | 'avg' | 'first' | 'max' | 'min'; interface QueryDslFunctionScoreQuery extends QueryDslQueryBase { boost_mode?: QueryDslFunctionBoostMode; functions?: QueryDslFunctionScoreContainer[]; max_boost?: double; min_score?: double; query?: QueryDslQueryContainer; score_mode?: QueryDslFunctionScoreMode; } interface QueryDslFuzzyQuery extends QueryDslQueryBase { max_expansions?: integer; prefix_length?: integer; rewrite?: MultiTermQueryRewrite; transpositions?: boolean; fuzziness?: Fuzziness; value: string | double | boolean; } interface QueryDslGeoBoundingBoxQueryKeys extends QueryDslQueryBase { type?: QueryDslGeoExecution; validation_method?: QueryDslGeoValidationMethod; ignore_unmapped?: boolean; } type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys & { [property: string]: GeoBounds | QueryDslGeoExecution | QueryDslGeoValidationMethod | boolean | float | string; }; interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode; }; interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } interface QueryDslGeoDistanceQueryKeys extends QueryDslQueryBase { distance: Distance; distance_type?: GeoDistanceType; validation_method?: QueryDslGeoValidationMethod; } type QueryDslGeoDistanceQuery = QueryDslGeoDistanceQueryKeys & { [property: string]: GeoLocation | Distance | GeoDistanceType | QueryDslGeoValidationMethod | float | string; }; type QueryDslGeoExecution = 'memory' | 'indexed'; interface QueryDslGeoPolygonPoints { points: GeoLocation[]; } interface QueryDslGeoPolygonQueryKeys extends QueryDslQueryBase { validation_method?: QueryDslGeoValidationMethod; ignore_unmapped?: boolean; } type QueryDslGeoPolygonQuery = QueryDslGeoPolygonQueryKeys & { [property: string]: QueryDslGeoPolygonPoints | QueryDslGeoValidationMethod | boolean | float | string; }; interface QueryDslGeoShapeFieldQuery { shape?: GeoShape; indexed_shape?: QueryDslFieldLookup; relation?: GeoShapeRelation; } interface QueryDslGeoShapeQueryKeys extends QueryDslQueryBase { ignore_unmapped?: boolean; } type QueryDslGeoShapeQuery = QueryDslGeoShapeQueryKeys & { [property: string]: QueryDslGeoShapeFieldQuery | boolean | float | string; }; type QueryDslGeoValidationMethod = 'coerce' | 'ignore_malformed' | 'strict'; interface QueryDslHasChildQuery extends QueryDslQueryBase { ignore_unmapped?: boolean; inner_hits?: SearchInnerHits; max_children?: integer; min_children?: integer; query: QueryDslQueryContainer; score_mode?: QueryDslChildScoreMode; type: RelationName; } interface QueryDslHasParentQuery extends QueryDslQueryBase { ignore_unmapped?: boolean; inner_hits?: SearchInnerHits; parent_type: RelationName; query: QueryDslQueryContainer; score?: boolean; } interface QueryDslIdsQuery extends QueryDslQueryBase { values?: Ids; } interface QueryDslIntervalsAllOf { intervals: QueryDslIntervalsContainer[]; max_gaps?: integer; ordered?: boolean; filter?: QueryDslIntervalsFilter; } interface QueryDslIntervalsAnyOf { intervals: QueryDslIntervalsContainer[]; filter?: QueryDslIntervalsFilter; } interface QueryDslIntervalsContainer { all_of?: QueryDslIntervalsAllOf; any_of?: QueryDslIntervalsAnyOf; fuzzy?: QueryDslIntervalsFuzzy; match?: QueryDslIntervalsMatch; prefix?: QueryDslIntervalsPrefix; wildcard?: QueryDslIntervalsWildcard; } interface QueryDslIntervalsFilter { after?: QueryDslIntervalsContainer; before?: QueryDslIntervalsContainer; contained_by?: QueryDslIntervalsContainer; containing?: QueryDslIntervalsContainer; not_contained_by?: QueryDslIntervalsContainer; not_containing?: QueryDslIntervalsContainer; not_overlapping?: QueryDslIntervalsContainer; overlapping?: QueryDslIntervalsContainer; script?: Script; } interface QueryDslIntervalsFuzzy { analyzer?: string; fuzziness?: Fuzziness; prefix_length?: integer; term: string; transpositions?: boolean; use_field?: Field; } interface QueryDslIntervalsMatch { analyzer?: string; max_gaps?: integer; ordered?: boolean; query: string; use_field?: Field; filter?: QueryDslIntervalsFilter; } interface QueryDslIntervalsPrefix { analyzer?: string; prefix: string; use_field?: Field; } interface QueryDslIntervalsQuery extends QueryDslQueryBase { all_of?: QueryDslIntervalsAllOf; any_of?: QueryDslIntervalsAnyOf; fuzzy?: QueryDslIntervalsFuzzy; match?: QueryDslIntervalsMatch; prefix?: QueryDslIntervalsPrefix; wildcard?: QueryDslIntervalsWildcard; } interface QueryDslIntervalsWildcard { analyzer?: string; pattern: string; use_field?: Field; } type QueryDslLike = string | QueryDslLikeDocument; interface QueryDslLikeDocument { doc?: any; fields?: Field[]; _id?: Id; _index?: IndexName; per_field_analyzer?: Record; routing?: Routing; version?: VersionNumber; version_type?: VersionType; } interface QueryDslMatchAllQuery extends QueryDslQueryBase { } interface QueryDslMatchBoolPrefixQuery extends QueryDslQueryBase { analyzer?: string; fuzziness?: Fuzziness; fuzzy_rewrite?: MultiTermQueryRewrite; fuzzy_transpositions?: boolean; max_expansions?: integer; minimum_should_match?: MinimumShouldMatch; operator?: QueryDslOperator; prefix_length?: integer; query: string; } interface QueryDslMatchNoneQuery extends QueryDslQueryBase { } interface QueryDslMatchPhrasePrefixQuery extends QueryDslQueryBase { analyzer?: string; max_expansions?: integer; query: string; slop?: integer; zero_terms_query?: QueryDslZeroTermsQuery; } interface QueryDslMatchPhraseQuery extends QueryDslQueryBase { analyzer?: string; query: string; slop?: integer; zero_terms_query?: QueryDslZeroTermsQuery; } interface QueryDslMatchQuery extends QueryDslQueryBase { analyzer?: string; auto_generate_synonyms_phrase_query?: boolean; cutoff_frequency?: double; fuzziness?: Fuzziness; fuzzy_rewrite?: MultiTermQueryRewrite; fuzzy_transpositions?: boolean; lenient?: boolean; max_expansions?: integer; minimum_should_match?: MinimumShouldMatch; operator?: QueryDslOperator; prefix_length?: integer; query: string | float | boolean; zero_terms_query?: QueryDslZeroTermsQuery; } interface QueryDslMoreLikeThisQuery extends QueryDslQueryBase { analyzer?: string; boost_terms?: double; fail_on_unsupported_field?: boolean; fields?: Field[]; include?: boolean; like: QueryDslLike | QueryDslLike[]; max_doc_freq?: integer; max_query_terms?: integer; max_word_length?: integer; min_doc_freq?: integer; minimum_should_match?: MinimumShouldMatch; min_term_freq?: integer; min_word_length?: integer; per_field_analyzer?: Record; routing?: Routing; stop_words?: AnalysisStopWords; unlike?: QueryDslLike | QueryDslLike[]; version?: VersionNumber; version_type?: VersionType; } interface QueryDslMultiMatchQuery extends QueryDslQueryBase { analyzer?: string; auto_generate_synonyms_phrase_query?: boolean; cutoff_frequency?: double; fields?: Fields; fuzziness?: Fuzziness; fuzzy_rewrite?: MultiTermQueryRewrite; fuzzy_transpositions?: boolean; lenient?: boolean; max_expansions?: integer; minimum_should_match?: MinimumShouldMatch; operator?: QueryDslOperator; prefix_length?: integer; query: string; slop?: integer; tie_breaker?: double; type?: QueryDslTextQueryType; zero_terms_query?: QueryDslZeroTermsQuery; } type QueryDslMultiValueMode = 'min' | 'max' | 'avg' | 'sum'; interface QueryDslNestedQuery extends QueryDslQueryBase { ignore_unmapped?: boolean; inner_hits?: SearchInnerHits; path: Field; query: QueryDslQueryContainer; score_mode?: QueryDslChildScoreMode; } interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { gt?: double; gte?: double; lt?: double; lte?: double; from?: double | null; to?: double | null; } interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode; }; type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR'; interface QueryDslParentIdQuery extends QueryDslQueryBase { id?: Id; ignore_unmapped?: boolean; type?: RelationName; } interface QueryDslPercolateQuery extends QueryDslQueryBase { document?: any; documents?: any[]; field: Field; id?: Id; index?: IndexName; name?: string; preference?: string; routing?: Routing; version?: VersionNumber; } interface QueryDslPinnedDoc { _id: Id; _index: IndexName; } interface QueryDslPinnedQuery extends QueryDslQueryBase { organic: QueryDslQueryContainer; ids?: Id[]; docs?: QueryDslPinnedDoc[]; } interface QueryDslPrefixQuery extends QueryDslQueryBase { rewrite?: MultiTermQueryRewrite; value: string; case_insensitive?: boolean; } interface QueryDslQueryBase { boost?: float; _name?: string; } interface QueryDslQueryContainer { bool?: QueryDslBoolQuery; boosting?: QueryDslBoostingQuery; common?: Partial>; combined_fields?: QueryDslCombinedFieldsQuery; constant_score?: QueryDslConstantScoreQuery; dis_max?: QueryDslDisMaxQuery; distance_feature?: QueryDslDistanceFeatureQuery; exists?: QueryDslExistsQuery; function_score?: QueryDslFunctionScoreQuery; fuzzy?: Partial>; geo_bounding_box?: QueryDslGeoBoundingBoxQuery; geo_distance?: QueryDslGeoDistanceQuery; geo_polygon?: QueryDslGeoPolygonQuery; geo_shape?: QueryDslGeoShapeQuery; has_child?: QueryDslHasChildQuery; has_parent?: QueryDslHasParentQuery; ids?: QueryDslIdsQuery; intervals?: Partial>; match?: Partial>; match_all?: QueryDslMatchAllQuery; match_bool_prefix?: Partial>; match_none?: QueryDslMatchNoneQuery; match_phrase?: Partial>; match_phrase_prefix?: Partial>; more_like_this?: QueryDslMoreLikeThisQuery; multi_match?: QueryDslMultiMatchQuery; nested?: QueryDslNestedQuery; parent_id?: QueryDslParentIdQuery; percolate?: QueryDslPercolateQuery; pinned?: QueryDslPinnedQuery; prefix?: Partial>; query_string?: QueryDslQueryStringQuery; range?: Partial>; rank_feature?: QueryDslRankFeatureQuery; regexp?: Partial>; rule_query?: QueryDslRuleQuery; script?: QueryDslScriptQuery; script_score?: QueryDslScriptScoreQuery; shape?: QueryDslShapeQuery; simple_query_string?: QueryDslSimpleQueryStringQuery; span_containing?: QueryDslSpanContainingQuery; field_masking_span?: QueryDslSpanFieldMaskingQuery; span_first?: QueryDslSpanFirstQuery; span_multi?: QueryDslSpanMultiTermQuery; span_near?: QueryDslSpanNearQuery; span_not?: QueryDslSpanNotQuery; span_or?: QueryDslSpanOrQuery; span_term?: Partial>; span_within?: QueryDslSpanWithinQuery; term?: Partial>; terms?: QueryDslTermsQuery; terms_set?: Partial>; text_expansion?: Partial>; wildcard?: Partial>; wrapper?: QueryDslWrapperQuery; type?: QueryDslTypeQuery; } interface QueryDslQueryStringQuery extends QueryDslQueryBase { allow_leading_wildcard?: boolean; analyzer?: string; analyze_wildcard?: boolean; auto_generate_synonyms_phrase_query?: boolean; default_field?: Field; default_operator?: QueryDslOperator; enable_position_increments?: boolean; escape?: boolean; fields?: Field[]; fuzziness?: Fuzziness; fuzzy_max_expansions?: integer; fuzzy_prefix_length?: integer; fuzzy_rewrite?: MultiTermQueryRewrite; fuzzy_transpositions?: boolean; lenient?: boolean; max_determinized_states?: integer; minimum_should_match?: MinimumShouldMatch; phrase_slop?: double; query: string; quote_analyzer?: string; quote_field_suffix?: string; rewrite?: MultiTermQueryRewrite; tie_breaker?: double; time_zone?: TimeZone; type?: QueryDslTextQueryType; } interface QueryDslRandomScoreFunction { field?: Field; seed?: long | string; } type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery; interface QueryDslRangeQueryBase extends QueryDslQueryBase { relation?: QueryDslRangeRelation; } type QueryDslRangeRelation = 'within' | 'contains' | 'intersects'; interface QueryDslRankFeatureFunctionLinear { } interface QueryDslRankFeatureFunctionLogarithm { scaling_factor: float; } interface QueryDslRankFeatureFunctionSaturation { pivot?: float; } interface QueryDslRankFeatureFunctionSigmoid { pivot: float; exponent: float; } interface QueryDslRankFeatureQuery extends QueryDslQueryBase { field: Field; saturation?: QueryDslRankFeatureFunctionSaturation; log?: QueryDslRankFeatureFunctionLogarithm; linear?: QueryDslRankFeatureFunctionLinear; sigmoid?: QueryDslRankFeatureFunctionSigmoid; } interface QueryDslRegexpQuery extends QueryDslQueryBase { case_insensitive?: boolean; flags?: string; max_determinized_states?: integer; rewrite?: MultiTermQueryRewrite; value: string; } interface QueryDslRuleQuery extends QueryDslQueryBase { organic: QueryDslQueryContainer; ruleset_id: Id; match_criteria: any; } interface QueryDslScriptQuery extends QueryDslQueryBase { script: Script; } interface QueryDslScriptScoreFunction { script: Script; } interface QueryDslScriptScoreQuery extends QueryDslQueryBase { min_score?: float; query: QueryDslQueryContainer; script: Script; } interface QueryDslShapeFieldQuery { indexed_shape?: QueryDslFieldLookup; relation?: GeoShapeRelation; shape?: GeoShape; } interface QueryDslShapeQueryKeys extends QueryDslQueryBase { ignore_unmapped?: boolean; } type QueryDslShapeQuery = QueryDslShapeQueryKeys & { [property: string]: QueryDslShapeFieldQuery | boolean | float | string; }; type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'NOT' | 'OR' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL'; type QueryDslSimpleQueryStringFlags = SpecUtilsPipeSeparatedFlags; interface QueryDslSimpleQueryStringQuery extends QueryDslQueryBase { analyzer?: string; analyze_wildcard?: boolean; auto_generate_synonyms_phrase_query?: boolean; default_operator?: QueryDslOperator; fields?: Field[]; flags?: QueryDslSimpleQueryStringFlags; fuzzy_max_expansions?: integer; fuzzy_prefix_length?: integer; fuzzy_transpositions?: boolean; lenient?: boolean; minimum_should_match?: MinimumShouldMatch; query: string; quote_field_suffix?: string; } interface QueryDslSpanContainingQuery extends QueryDslQueryBase { big: QueryDslSpanQuery; little: QueryDslSpanQuery; } interface QueryDslSpanFieldMaskingQuery extends QueryDslQueryBase { field: Field; query: QueryDslSpanQuery; } interface QueryDslSpanFirstQuery extends QueryDslQueryBase { end: integer; match: QueryDslSpanQuery; } type QueryDslSpanGapQuery = Partial>; interface QueryDslSpanMultiTermQuery extends QueryDslQueryBase { match: QueryDslQueryContainer; } interface QueryDslSpanNearQuery extends QueryDslQueryBase { clauses: QueryDslSpanQuery[]; in_order?: boolean; slop?: integer; } interface QueryDslSpanNotQuery extends QueryDslQueryBase { dist?: integer; exclude: QueryDslSpanQuery; include: QueryDslSpanQuery; post?: integer; pre?: integer; } interface QueryDslSpanOrQuery extends QueryDslQueryBase { clauses: QueryDslSpanQuery[]; } interface QueryDslSpanQuery { span_containing?: QueryDslSpanContainingQuery; field_masking_span?: QueryDslSpanFieldMaskingQuery; span_first?: QueryDslSpanFirstQuery; span_gap?: QueryDslSpanGapQuery; span_multi?: QueryDslSpanMultiTermQuery; span_near?: QueryDslSpanNearQuery; span_not?: QueryDslSpanNotQuery; span_or?: QueryDslSpanOrQuery; span_term?: Partial>; span_within?: QueryDslSpanWithinQuery; } interface QueryDslSpanTermQuery extends QueryDslQueryBase { value: string; } interface QueryDslSpanWithinQuery extends QueryDslQueryBase { big: QueryDslSpanQuery; little: QueryDslSpanQuery; } interface QueryDslTermQuery extends QueryDslQueryBase { value: FieldValue; case_insensitive?: boolean; } interface QueryDslTermsLookup { index: IndexName; id: Id; path: Field; routing?: Routing; } interface QueryDslTermsQueryKeys extends QueryDslQueryBase { } type QueryDslTermsQuery = QueryDslTermsQueryKeys & { [property: string]: QueryDslTermsQueryField | float | string; }; type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup; interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field; minimum_should_match_script?: Script; terms: string[]; } interface QueryDslTextExpansionQuery extends QueryDslQueryBase { model_id: string; model_text: string; } type QueryDslTextQueryType = 'best_fields' | 'most_fields' | 'cross_fields' | 'phrase' | 'phrase_prefix' | 'bool_prefix'; interface QueryDslTypeQuery extends QueryDslQueryBase { value: string; } interface QueryDslWildcardQuery extends QueryDslQueryBase { case_insensitive?: boolean; rewrite?: MultiTermQueryRewrite; value?: string; wildcard?: string; } interface QueryDslWrapperQuery extends QueryDslQueryBase { query: string; } type QueryDslZeroTermsQuery = 'all' | 'none'; interface MlClassificationInferenceOptions { num_top_classes?: integer; num_top_feature_importance_values?: integer; prediction_field_type?: string; results_field?: string; top_classes_results_field?: string; } interface MlRegressionInferenceOptions { results_field?: Field; num_top_feature_importance_values?: integer; } interface SpecUtilsCommonQueryParameters { error_trace?: boolean; filter_path?: string | string[]; human?: boolean; pretty?: boolean; } type ElasticsearchHitDocument = Record; type ElasticsearchHit = SearchHit; type ElasticsearchResponseBody = SearchResponseBody; type ElasticsearchQuery = QueryDslQueryContainer; type ElasticsearchAggregation = AggregationsAggregationContainer; type KnnSearchQuery = KnnQuery; type Filters = string | readonly string[] | ReadonlyArray; /** * @description The search parameters InstantSearch sends with each request. * Searchkit owns this type so its public types don't depend on `@algolia/client-search`. * It is structurally compatible with Algolia's v4 `SearchOptions`, and unknown keys are allowed. */ interface SearchParams { readonly query?: string; readonly page?: number; readonly hitsPerPage?: number; readonly facets?: readonly string[] | string; readonly maxValuesPerFacet?: number; readonly facetName?: string; readonly facetQuery?: string; readonly facetFilters?: Filters; readonly numericFilters?: Filters; readonly filters?: string; readonly aroundLatLng?: string; readonly aroundRadius?: number | 'all'; readonly insideBoundingBox?: ReadonlyArray | string; readonly attributesToRetrieve?: readonly string[]; readonly attributesToHighlight?: readonly string[]; readonly highlightPreTag?: string; readonly highlightPostTag?: string; readonly ruleContexts?: readonly string[]; readonly [key: string]: unknown; } /** * @description A single InstantSearch request, as passed to `handleInstantSearchRequests`. * Structurally compatible with Algolia's v4 `MultipleQueriesQuery`. */ interface MultipleQueriesQuery { readonly indexName: string; readonly type?: 'default' | 'facet'; readonly facet?: string; readonly params?: SearchParams; } /** * @deprecated Use `MultipleQueriesQuery`. Kept as an alias for backwards compatibility. */ type AlgoliaMultipleQueriesQuery = MultipleQueriesQuery; type FacetValueOrder = 'count' | 'alpha'; type FacetFieldConfig = { attribute: string; field: string; type: 'numeric' | 'string' | 'date'; nestedPath?: string; /** * @description Order of the facet's values. `count` (the default) returns the * most common values first; `alpha` orders them by the term itself. Ordering * has to happen in Elasticsearch, since the aggregation size decides which * values are returned at all: sorting client side only reorders the values * already selected by count. * @default 'count' */ order?: FacetValueOrder; }; type FacetStringResponse = Record; type CustomFacetConfig = { field: string; attribute: string; type: 'numeric' | 'string' | 'date'; nestedPath?: string; /** * @description Allows you to customise the facet query that is sent to Elasticsearch. This is useful for custom facets that don't fit the standard terms aggregation. */ facetQuery: (field: string, size: number, search: string) => ElasticsearchAggregation; /** * @description Allows you to customise the filter query that is sent to Elasticsearch. This is useful for custom filters that don't fit the standard term query. */ filterQuery: (field: string, value: string) => ElasticsearchQuery; /** * @description Allows you to handle the facet response into a key value record of facet values and counts. */ facetResponse: (aggregation: any) => FacetStringResponse; }; type FilterAttribute = { attribute: string; field: string; type: 'numeric' | 'string' | 'date'; /** * @description Supports documents with nested fields. This is the path to the nested field. */ nestedPath?: string; /** * @description Allows you to customise the filter query that is sent to Elasticsearch. This is useful for custom filters that don't fit the standard term query. */ filterQuery?: (field: string, value: string) => ElasticsearchQuery; }; interface BasicAuth { username: string; password: string; } interface ConfigConnection { /** * @description The Elasticsearch host * @example http://localhost:9200 */ host?: string; /** * @description The Elasticsearch API key. This is optional and only required if you have API key authentication enabled. * @example 1234567890 */ apiKey?: string; /** * @description Headers to be sent with the Elasticsearch request. * @example { 'X-My-Header': 'My-Value' } */ headers?: Record; /** * @description The Elasticsearch cloud id. This is optional and can be used to connect to Elasticsearch cloud. An alternative to host. */ cloud_id?: string; /** * @description The Elasticsearch account. This is optional and only required if you have basic authentication enabled. * @example username: elastic * @example password: changeme */ auth?: BasicAuth; withCredentials?: boolean; } interface SearchAttributeConfig { field: string; weight?: number; } type FacetAttribute = string | FacetFieldConfig | CustomFacetConfig; type SearchAttribute = string | SearchAttributeConfig; type SortingOption = { /** The field to sort by */ field: string; /** Sort order: ascending or descending */ order: 'asc' | 'desc'; /** Path to nested field (e.g., 'marketplace' for marketplace.price) */ nestedPath?: string; /** * Mode for handling array values in sorting. Useful when sorting by fields that contain arrays. * - 'min': Use the minimum value from the array * - 'max': Use the maximum value from the array * - 'sum': Use the sum of all values in the array * - 'avg': Use the average of all values in the array * - 'median': Use the median value from the array */ mode?: 'min' | 'max' | 'sum' | 'avg' | 'median'; }; interface SearchSettingsConfig { /** * @description fields that will be searched when a user enters a query */ search_attributes: SearchAttribute[]; /** * @description fields that will be used to as facets */ facet_attributes?: FacetAttribute[]; /** * @description fields that will be used to as filters */ filter_attributes?: FilterAttribute[]; /** * @description fields that will be returned in the search results * @example ['name', 'price'] **/ result_attributes: string[]; /** * @description fields that can be used to highlight search terms in the search results * @example ['name'] **/ highlight_attributes?: string[]; /** * @description fields that can be used to generate a snippet of text matches from the search results * @example ['description'] **/ snippet_attributes?: string[]; /** * @description Rules that can customise search results order. */ query_rules?: QueryRule[]; /** * @description Sorting options for the search. This is optional and will default to sorting by _score if not provided. * @example { 'price': { field: 'price', order: 'asc' } } * @example { 'price': [{ field: 'price', order: 'asc' }, { field: 'name', order: 'asc' }] } * @example { '_price_desc': { field: 'price', order: 'desc', nestedPath: 'marketplace' } } * @example { '_price_min': { field: 'price', order: 'asc', mode: 'min' } } * @example { '_price_max_nested': { field: 'price', order: 'desc', nestedPath: 'marketplace', mode: 'max' } } */ sorting?: Record; /** * @description The fuzziness of the text search query. Defaults to AUTO:4,8 */ fuzziness?: string; /** * @description The attribute that will be used for geo search. This is required if you want to use geo search. Must be am Elasticsearch geo_point type field. */ geo_attribute?: string; /** * @description Runtime mappings that will be applied to the search. This allows you to dynamically add fields to the search results that aren't in the index. */ runtime_mappings?: Record; } interface QueryStringRuleCondition { context: 'query'; match_type: 'prefix' | 'contains' | 'exact'; value: string; } interface RuntimeMapping { type: MappingRuntimeFieldType; script: { source: string; }; } interface ContextRuleCondition { context: 'context'; value: string[]; } interface FilterRuleCondition { context: 'filterPresent'; values: { attribute: string; value: string; }[]; } interface PinnedResultAction { action: 'PinnedResult'; documentIds: string[]; } interface QueryBoostAction { action: 'QueryBoost'; query: string; weight: number; } interface FilterAction { action: 'QueryFilter'; query: string; } interface QueryRewriteAction { action: 'QueryRewrite'; query: string; } interface RenderUserDataAction { action: 'RenderUserData'; userData: string; } interface RenderFacetsOrderAction { action: 'RenderFacetsOrder'; facetAttributesOrder: string[]; } type QueryRuleAction = PinnedResultAction | QueryBoostAction | QueryRewriteAction | RenderUserDataAction | RenderFacetsOrderAction | FilterAction; type QueryRuleCondition = QueryStringRuleCondition | ContextRuleCondition | FilterRuleCondition; interface QueryRule { id: string; conditions: QueryRuleCondition[][]; actions: QueryRuleAction[]; } interface SearchkitConfig { connection: ConfigConnection | Transporter; search_settings: SearchSettingsConfig; } type SearchRequest = { body: SearchRequest$1; request: AlgoliaMultipleQueriesQuery; indexName: string; }; /** * @description The search settings passed to `getQuery` and `getKnnQuery`, along with the InstantSearch request being transformed (e.g. `config.request.indexName`) */ type QueryConfig = SearchSettingsConfig & { request: AlgoliaMultipleQueriesQuery; }; interface RequestOptions { /** * @description Allows you to override the organic query * @param query The original query search terms * @param search_attributes The search attributes configured in the search settings * @param config The search settings, plus the InstantSearch `request` being transformed * @returns An Elasticsearch query object or an array of Elasticsearch query objects * @returns false if you want to skip the search query (useful for just KNN search) */ getQuery?: (query: string, search_attributes: SearchAttribute[], config: QueryConfig) => ElasticsearchQuery | ElasticsearchQuery[] | false; /** * @description Allows you to add base filters to be applied to the search. This is useful for user / document level permissions * @returns An array of Elasticsearch query objects that will be wrapped in a bool filter query **/ getBaseFilters?: () => ElasticsearchQuery[]; /** * @description Allows you to specify the KNN query to be used for KNN search. Hits will be combined with the organic query. If you do not want to use the organic query, return false from getQuery. * @param query The original query search terms * @param search_attributes The search attributes configured in the search settings * @param config The search settings, plus the InstantSearch `request` being transformed * @returns An Elasticsearch KNN Search Query */ getKnnQuery?: (query: string, search_attributes: SearchAttribute[], config: QueryConfig) => KnnQuery; /** * @description Hooks are escape hatches that allow you to modify the search requests to Elasticsearch and the responses back from Elasticsearch. **/ hooks?: { /** * @description Allows you to modify the search requests before they are sent to Elasticsearch * @param requests An array of SearchRequest objects, each containing the body (elasticsearch query) and indexName of the request * @returns An array of modified SearchRequest objects, each containing the body (elasticsearch query) and indexName of the request */ beforeSearch?: (requests: SearchRequest[]) => Promise; /** * @description Allows you to modify the search responses before its transformed into an InstantSearch response * @param requests An array of SearchRequest objects, each containing the body (elasticsearch query) and indexName of the request * @param responses An array of Elasticsearch Response objects * @returns An array of modified Elasticsearch response objects */ afterSearch?: (requests: SearchRequest[], responses: ElasticsearchResponseBody[]) => Promise; }; } interface Transporter { config?: ConfigConnection; msearch: (requests: SearchRequest[]) => Promise; } interface AppSettings { debug: boolean; timeout?: number; } declare function RelevanceQueryMatch(query: string, search_attributes: SearchAttribute[], fuzziness?: string): { bool: { should: ({ bool: { should: ({ multi_match: { query: string; fields: string[]; fuzziness: string; type?: undefined; }; } | { multi_match: { query: string; fields: string[]; type: string; fuzziness?: undefined; }; })[]; }; multi_match?: undefined; } | { multi_match: { query: string; type: string; fields: string[]; }; bool?: undefined; })[]; }; }; declare class ESTransporter implements Transporter { config: ConfigConnection; private settings; private timeout; constructor(config: ConfigConnection, settings: AppSettings); createElasticsearchQueryFromRequest(requests: SearchRequest[]): string; performNetworkRequest(requests: SearchRequest[]): Promise; msearch(requests: SearchRequest[]): Promise; } declare const TermFilter: (field: string, value: string) => { term: { [x: string]: string; }; }; declare const MatchFilter: (field: string, value: string) => { match: { [x: string]: string; }; }; declare class Searchkit { private config; private settings; private transporter; constructor(config: SearchkitConfig, settings?: AppSettings); private performSearch; handleInstantSearchRequests(instantsearchRequests: readonly MultipleQueriesQuery[], requestOptions?: RequestOptions): Promise<{ results: ({ facetHits: any; exhaustiveFacetsCount: boolean; processingTimeMS: number; } | { userData?: unknown[] | undefined; hits: { _geoloc?: { lat: number; lng: number; } | null | undefined; _snippetResult?: Record | undefined; _highlightResult?: Record | undefined; inner_hits?: Record | undefined; objectID: string; _index: string; _score: number | null | undefined; }[]; index: string; params: string; renderingContent: { facetOrdering: { facets: { order: string[]; }; values: Record | undefined; }; }; hitsPerPage: number; processingTimeMS: number; nbHits: number | undefined; page: number; nbPages: number; query: string; appliedRules: string[]; exhaustiveNbHits: boolean; exhaustiveFacetsCount: boolean; exhaustiveTypo: boolean; exhaustive: { facetsCount: boolean; nbHits: boolean; typo: boolean; }; })[]; }>; } export { AlgoliaMultipleQueriesQuery, AppSettings, BasicAuth, ConfigConnection, CustomFacetConfig, ESTransporter, ElasticsearchHit, ElasticsearchQuery, ElasticsearchResponseBody, SearchRequest$1 as ElasticsearchSearchRequest, FacetAttribute, FacetFieldConfig, FacetStringResponse, FacetValueOrder, FilterAttribute, KnnSearchQuery, MatchFilter, MultipleQueriesQuery, QueryConfig, QueryRule, QueryRuleAction, QueryRuleCondition, RelevanceQueryMatch, RequestOptions, SearchAttribute, SearchAttributeConfig, SearchParams, SearchRequest, SearchSettingsConfig, SearchkitConfig, SortingOption, TermFilter, Transporter, Searchkit as default };