Skip to content

Commit 03c453f

Browse files
[DOCS] Add descriptions for queries A-G (#2204)
1 parent bdea9d9 commit 03c453f

File tree

9 files changed

+682
-125
lines changed

9 files changed

+682
-125
lines changed

output/schema/schema.json

Lines changed: 275 additions & 117 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,18 @@ index-modules-settings,https://www.elastic.co/guide/en/elasticsearch/reference/{
402402
templating-role-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/field-and-document-access-control.html#templating-role-query
403403
mapping-settings-limit,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/mapping-settings-limit.html
404404
index-modules-slowlog-slowlog,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/index-modules-slowlog.html#index-slow-log
405-
multi-fields,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/multi-fields.html
405+
multi-fields,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/multi-fields.html
406+
query-dsl-bool-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-bool-query.html
407+
query-dsl-boosting-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-boosting-query.html
408+
query-dsl-combined-fields-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-combined-fields-query.html
409+
query-dsl-constant-score-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-constant-score-query.html
410+
query-dsl-dis-max-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-dis-max-query.html
411+
query-dsl-distance-feature-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-distance-feature-query.html
412+
query-dsl-exists-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-exists-query.html
413+
query-dsl-function-score-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-function-score-query.html
414+
fuzziness,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/common-options.html#fuzziness
415+
query-dsl-fuzzy-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-fuzzy-query.html
416+
query-dsl-geo-bounding-box-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-geo-bounding-box-query.html
417+
query-dsl-geo-distance-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-geo-distance-query.html
418+
distance-units,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/api-conventions.html#distance-units
419+
query-dsl-geo-shape-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-geo-shape-query.html

specification/_types/Geo.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,22 @@ export class GeoLine {
6565
}
6666

6767
export enum GeoShapeRelation {
68+
/**
69+
* Return all documents whose `geo_shape` or `geo_point` field intersects the query geometry.
70+
*/
6871
intersects = 0,
72+
/**
73+
* Return all documents whose `geo_shape` or `geo_point` field has nothing in common with the query geometry.
74+
*/
6975
disjoint = 1,
76+
/**
77+
* Return all documents whose `geo_shape` or `geo_point` field is within the query geometry.
78+
* Line geometries are not supported.
79+
*/
7080
within = 2,
81+
/**
82+
* Return all documents whose `geo_shape` or `geo_point` field contains the query geometry.
83+
*/
7184
contains = 3
7285
}
7386

specification/_types/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export type SequenceNumber = long
111111
export type PropertyName = string
112112
export type RelationName = string
113113
export type TaskId = string | integer
114+
/** @doc_id fuzziness */
114115
export type Fuzziness = string | integer
115116
/** @doc_id query-dsl-multi-term-rewrite */
116117
export type MultiTermQueryRewrite = string

specification/_types/query_dsl/abstractions.ts

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,72 @@ import { TextExpansionQuery } from './TextExpansionQuery'
100100
* @doc_id query-dsl
101101
*/
102102
export class QueryContainer {
103+
/**
104+
* matches documents matching boolean combinations of other queries.
105+
* @doc_id query-dsl-bool-query
106+
*/
103107
bool?: BoolQuery
108+
/**
109+
* Returns documents matching a `positive` query while reducing the relevance score of documents that also match a `negative` query.
110+
* @doc_id query-dsl-boosting-query
111+
*/
104112
boosting?: BoostingQuery
105113
/** @deprecated 7.3.0 */
106114
common?: SingleKeyDictionary<Field, CommonTermsQuery>
107115
/**
116+
* The `combined_fields` query supports searching multiple text fields as if their contents had been indexed into one combined field.
117+
* @doc_id query-dsl-combined-fields-query
108118
* @availability stack since=7.13.0
109119
* @availability serverless
110120
*/
111121
combined_fields?: CombinedFieldsQuery
122+
/**
123+
* Wraps a filter query and returns every matching document with a relevance score equal to the `boost` parameter value.
124+
* @doc_id query-dsl-constant-score-query
125+
*/
112126
constant_score?: ConstantScoreQuery
127+
/**
128+
* Returns documents matching one or more wrapped queries, called query clauses or clauses.
129+
* If a returned document matches multiple query clauses, the `dis_max` query assigns the document the highest relevance score from any matching clause, plus a tie breaking increment for any additional matching subqueries.
130+
* @doc_id query-dsl-dis-max-query
131+
*/
113132
dis_max?: DisMaxQuery
133+
/**
134+
* Boosts the relevance score of documents closer to a provided origin date or point.
135+
* For example, you can use this query to give more weight to documents closer to a certain date or location.
136+
* @doc_id query-dsl-distance-feature-query
137+
*/
114138
distance_feature?: DistanceFeatureQuery
139+
/**
140+
* Returns documents that contain an indexed value for a field.
141+
* @doc_id query-dsl-exists-query
142+
*/
115143
exists?: ExistsQuery
144+
/**
145+
* The `function_score` enables you to modify the score of documents that are retrieved by a query.
146+
* @doc_id query-dsl-function-score-query
147+
*/
116148
function_score?: FunctionScoreQuery
149+
/**
150+
* Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.
151+
* @doc_id query-dsl-fuzzy-query
152+
*/
117153
fuzzy?: SingleKeyDictionary<Field, FuzzyQuery>
154+
/**
155+
* Matches geo_point and geo_shape values that intersect a bounding box.
156+
* @doc_id query-dsl-geo-bounding-box-query
157+
*/
118158
geo_bounding_box?: GeoBoundingBoxQuery
159+
/**
160+
* Matches `geo_point` and `geo_shape` values within a given distance of a geopoint.
161+
* @doc_id query-dsl-geo-distance-query
162+
*/
119163
geo_distance?: GeoDistanceQuery
120164
geo_polygon?: GeoPolygonQuery
165+
/**
166+
* Filter documents indexed using either the `geo_shape` or the `geo_point` type.
167+
* @doc_id query-dsl-geo-shape-query
168+
*/
121169
geo_shape?: GeoShapeQuery
122170
has_child?: HasChildQuery
123171
has_parent?: HasParentQuery
@@ -171,9 +219,21 @@ export class QueryContainer {
171219
}
172220

173221
export class FieldLookup {
222+
/**
223+
* `id` of the document.
224+
*/
174225
id: Id
226+
/**
227+
* Index from which to retrieve the document.
228+
*/
175229
index?: IndexName
230+
/**
231+
* Name of the field.
232+
*/
176233
path?: Field
234+
/**
235+
* Custom routing value.
236+
*/
177237
routing?: Routing
178238
}
179239

@@ -182,24 +242,51 @@ export class FieldNameQuery {
182242
}
183243

184244
export class QueryBase {
245+
/**
246+
* Floating point number used to decrease or increase the relevance scores of the query.
247+
* Boost values are relative to the default value of 1.0.
248+
* A boost value between 0 and 1.0 decreases the relevance score.
249+
* A value greater than 1.0 increases the relevance score.
250+
* @server_default 1.0
251+
*/
185252
boost?: float
186253
/** @codegen_name query_name */
187254
_name?: string
188255
}
189256

190257
export class CombinedFieldsQuery extends QueryBase {
258+
/**
259+
* List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`.
260+
*/
191261
fields: Field[]
262+
/**
263+
* Text to search for in the provided `fields`.
264+
* The `combined_fields` query analyzes the provided text before performing a search.
265+
*/
192266
query: string
193267

194-
/** @server_default true */
268+
/**
269+
* If true, match phrase queries are automatically created for multi-term synonyms.
270+
* @server_default true
271+
*/
195272
auto_generate_synonyms_phrase_query?: boolean
196273

197-
/** @server_default or */
274+
/**
275+
* Boolean logic used to interpret text in the query value.
276+
* @server_default or
277+
*/
198278
operator?: CombinedFieldsOperator
199279

280+
/**
281+
* Minimum number of clauses that must match for a document to be returned.
282+
* @doc_id query-dsl-minimum-should-match
283+
*/
200284
minimum_should_match?: MinimumShouldMatch
201285

202-
/** @server_default none */
286+
/**
287+
* Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter.
288+
* @server_default none
289+
*/
203290
zero_terms_query?: CombinedFieldsZeroTerms
204291
}
205292

@@ -214,7 +301,13 @@ export enum CombinedFieldsOperator {
214301
}
215302

216303
export enum CombinedFieldsZeroTerms {
304+
/**
305+
* No documents are returned if the analyzer removes all tokens.
306+
*/
217307
none,
308+
/**
309+
* Returns all documents, similar to a `match_all` query.
310+
*/
218311
all
219312
}
220313

0 commit comments

Comments
 (0)