1818 */
1919
2020import { ResponseBody as SearchResponse } from '@global/search/SearchResponse'
21- import { FieldCollapse } from '@global/search/_types/FieldCollapse'
22- import { Highlight } from '@global/search/_types/highlighting'
23- import { TrackHits } from '@global/search/_types/hits'
24- import { PointInTimeReference } from '@global/search/_types/PointInTimeReference'
25- import { Rescore } from '@global/search/_types/rescoring'
26- import { SourceConfig } from '@global/search/_types/SourceFilter'
27- import { Suggester } from '@global/search/_types/suggester'
28- import { Dictionary } from '@spec_utils/Dictionary'
29- import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
30- import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
21+ import { SearchRequestBody } from '@global/search/_types/SearchRequestBody'
3122import { ErrorResponseBase } from '@_types/Base'
32- import {
33- ExpandWildcards ,
34- Fields ,
35- IndexName ,
36- Indices ,
37- Routing ,
38- SearchType
39- } from '@_types/common'
40- import { KnnSearch } from '@_types/Knn'
41- import { RuntimeFields } from '@_types/mapping/RuntimeFields'
42- import { double , integer , long } from '@_types/Numeric'
43- import { FieldAndFormat , QueryContainer } from '@_types/query_dsl/abstractions'
44- import { ScriptField } from '@_types/Scripting'
45- import { Sort , SortResults } from '@_types/sort'
23+ import { ExpandWildcards , Indices , Routing , SearchType } from '@_types/common'
24+ import { integer , long } from '@_types/Numeric'
4625
4726/**
4827 * @codegen_names header, body
@@ -66,139 +45,7 @@ export class MultisearchHeader {
6645 ignore_throttled ?: boolean
6746}
6847
69- // We should keep this in sync with the normal search request body.
70- export class MultisearchBody {
71- /** @aliases aggs */ // ES uses "aggregations" in serialization
72- aggregations ?: Dictionary < string , AggregationContainer >
73- collapse ?: FieldCollapse
74- /**
75- * Defines the search definition using the Query DSL.
76- */
77- query ?: QueryContainer
78- /**
79- * If true, returns detailed information about score computation as part of a hit.
80- * @server_default false
81- */
82- explain ?: boolean
83- /**
84- * Configuration of search extensions defined by Elasticsearch plugins.
85- */
86- ext ?: Dictionary < string , UserDefinedValue >
87- /**
88- * List of stored fields to return as part of a hit. If no fields are specified,
89- * no stored fields are included in the response. If this field is specified, the _source
90- * parameter defaults to false. You can pass _source: true to return both source fields
91- * and stored fields in the search response.
92- */
93- stored_fields ?: Fields
94- /**
95- * Array of wildcard (*) patterns. The request returns doc values for field
96- * names matching these patterns in the hits.fields property of the response.
97- */
98- docvalue_fields ?: FieldAndFormat [ ]
99- /**
100- * Defines the approximate kNN search to run.
101- * @availability stack since=8.4.0
102- * @availability serverless
103- */
104- knn ?: KnnSearch | KnnSearch [ ]
105- /**
106- * Starting document offset. By default, you cannot page through more than 10,000
107- * hits using the from and size parameters. To page through more hits, use the
108- * search_after parameter.
109- * @server_default 0
110- */
111- from ?: integer
112- highlight ?: Highlight
113- /**
114- * Boosts the _score of documents from specified indices.
115- */
116- indices_boost ?: Array < Dictionary < IndexName , double > >
117- /**
118- * Minimum _score for matching documents. Documents with a lower _score are
119- * not included in the search results.
120- */
121- min_score ?: double
122- post_filter ?: QueryContainer
123- profile ?: boolean
124- rescore ?: Rescore | Rescore [ ]
125- /**
126- * Retrieve a script evaluation (based on different fields) for each hit.
127- */
128- script_fields ?: Dictionary < string , ScriptField >
129- search_after ?: SortResults
130- /**
131- * The number of hits to return. By default, you cannot page through more
132- * than 10,000 hits using the from and size parameters. To page through more
133- * hits, use the search_after parameter.
134- * @server_default 10
135- */
136- size ?: integer
137- /** @doc_id sort-search-results */
138- sort ?: Sort
139- /**
140- * Indicates which source fields are returned for matching documents. These
141- * fields are returned in the hits._source property of the search response.
142- */
143- _source ?: SourceConfig
144- /**
145- * Array of wildcard (*) patterns. The request returns values for field names
146- * matching these patterns in the hits.fields property of the response.
147- */
148- fields ?: Array < FieldAndFormat >
149- /**
150- * Maximum number of documents to collect for each shard. If a query reaches this
151- * limit, Elasticsearch terminates the query early. Elasticsearch collects documents
152- * before sorting. Defaults to 0, which does not terminate query execution early.
153- * @server_default 0
154- */
155- terminate_after ?: long
156- /**
157- * Stats groups to associate with the search. Each group maintains a statistics
158- * aggregation for its associated searches. You can retrieve these stats using
159- * the indices stats API.
160- */
161- stats ?: string [ ]
162- /**
163- * Specifies the period of time to wait for a response from each shard. If no response
164- * is received before the timeout expires, the request fails and returns an error.
165- * Defaults to no timeout.
166- */
167- timeout ?: string
168- /**
169- * If true, calculate and return document scores, even if the scores are not used for sorting.
170- * @server_default false
171- */
172- track_scores ?: boolean
173- /**
174- * Number of hits matching the query to count accurately. If true, the exact
175- * number of hits is returned at the cost of some performance. If false, the
176- * response does not include the total number of hits matching the query.
177- * Defaults to 10,000 hits.
178- */
179- track_total_hits ?: TrackHits
180- /**
181- * If true, returns document version as part of a hit.
182- * @server_default false
183- */
184- version ?: boolean
185- /**
186- * Defines one or more runtime fields in the search request. These fields take
187- * precedence over mapped fields with the same name.
188- */
189- runtime_mappings ?: RuntimeFields
190- /**
191- * If true, returns sequence number and primary term of the last modification
192- * of each hit. See Optimistic concurrency control.
193- */
194- seq_no_primary_term ?: boolean
195- /**
196- * Limits the search to a point in time (PIT). If you provide a PIT, you
197- * cannot specify an <index> in the request path.
198- */
199- pit ?: PointInTimeReference
200- suggest ?: Suggester
201- }
48+ export type MultisearchBody = SearchRequestBody
20249
20350export class MultiSearchResult < TDocument > {
20451 took : long
0 commit comments