Skip to content

[DOCS] Add descriptions for queries A-G #2204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
392 changes: 275 additions & 117 deletions output/schema/schema.json

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion specification/_doc_ids/table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -402,4 +402,18 @@ index-modules-settings,https://www.elastic.co/guide/en/elasticsearch/reference/{
templating-role-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/field-and-document-access-control.html#templating-role-query
mapping-settings-limit,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/mapping-settings-limit.html
index-modules-slowlog-slowlog,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/index-modules-slowlog.html#index-slow-log
multi-fields,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/multi-fields.html
multi-fields,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/multi-fields.html
query-dsl-bool-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-bool-query.html
query-dsl-boosting-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-boosting-query.html
query-dsl-combined-fields-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-combined-fields-query.html
query-dsl-constant-score-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-constant-score-query.html
query-dsl-dis-max-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-dis-max-query.html
query-dsl-distance-feature-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-distance-feature-query.html
query-dsl-exists-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-exists-query.html
query-dsl-function-score-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-function-score-query.html
fuzziness,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/common-options.html#fuzziness
query-dsl-fuzzy-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-fuzzy-query.html
query-dsl-geo-bounding-box-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-geo-bounding-box-query.html
query-dsl-geo-distance-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-geo-distance-query.html
distance-units,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/api-conventions.html#distance-units
query-dsl-geo-shape-query,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-geo-shape-query.html
13 changes: 13 additions & 0 deletions specification/_types/Geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,22 @@ export class GeoLine {
}

export enum GeoShapeRelation {
/**
* Return all documents whose `geo_shape` or `geo_point` field intersects the query geometry.
*/
intersects = 0,
/**
* Return all documents whose `geo_shape` or `geo_point` field has nothing in common with the query geometry.
*/
disjoint = 1,
/**
* Return all documents whose `geo_shape` or `geo_point` field is within the query geometry.
* Line geometries are not supported.
*/
within = 2,
/**
* Return all documents whose `geo_shape` or `geo_point` field contains the query geometry.
*/
contains = 3
}

Expand Down
1 change: 1 addition & 0 deletions specification/_types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export type SequenceNumber = long
export type PropertyName = string
export type RelationName = string
export type TaskId = string | integer
/** @doc_id fuzziness */
export type Fuzziness = string | integer
/** @doc_id query-dsl-multi-term-rewrite */
export type MultiTermQueryRewrite = string
Expand Down
99 changes: 96 additions & 3 deletions specification/_types/query_dsl/abstractions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,72 @@ import { TextExpansionQuery } from './TextExpansionQuery'
* @doc_id query-dsl
*/
export class QueryContainer {
/**
* matches documents matching boolean combinations of other queries.
* @doc_id query-dsl-bool-query
*/
bool?: BoolQuery
/**
* Returns documents matching a `positive` query while reducing the relevance score of documents that also match a `negative` query.
* @doc_id query-dsl-boosting-query
*/
boosting?: BoostingQuery
/** @deprecated 7.3.0 */
common?: SingleKeyDictionary<Field, CommonTermsQuery>
/**
* The `combined_fields` query supports searching multiple text fields as if their contents had been indexed into one combined field.
* @doc_id query-dsl-combined-fields-query
* @availability stack since=7.13.0
* @availability serverless
*/
combined_fields?: CombinedFieldsQuery
/**
* Wraps a filter query and returns every matching document with a relevance score equal to the `boost` parameter value.
* @doc_id query-dsl-constant-score-query
*/
constant_score?: ConstantScoreQuery
/**
* Returns documents matching one or more wrapped queries, called query clauses or clauses.
* 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.
* @doc_id query-dsl-dis-max-query
*/
dis_max?: DisMaxQuery
/**
* Boosts the relevance score of documents closer to a provided origin date or point.
* For example, you can use this query to give more weight to documents closer to a certain date or location.
* @doc_id query-dsl-distance-feature-query
*/
distance_feature?: DistanceFeatureQuery
/**
* Returns documents that contain an indexed value for a field.
* @doc_id query-dsl-exists-query
*/
exists?: ExistsQuery
/**
* The `function_score` enables you to modify the score of documents that are retrieved by a query.
* @doc_id query-dsl-function-score-query
*/
function_score?: FunctionScoreQuery
/**
* Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.
* @doc_id query-dsl-fuzzy-query
*/
fuzzy?: SingleKeyDictionary<Field, FuzzyQuery>
/**
* Matches geo_point and geo_shape values that intersect a bounding box.
* @doc_id query-dsl-geo-bounding-box-query
*/
geo_bounding_box?: GeoBoundingBoxQuery
/**
* Matches `geo_point` and `geo_shape` values within a given distance of a geopoint.
* @doc_id query-dsl-geo-distance-query
*/
geo_distance?: GeoDistanceQuery
geo_polygon?: GeoPolygonQuery
/**
* Filter documents indexed using either the `geo_shape` or the `geo_point` type.
* @doc_id query-dsl-geo-shape-query
*/
geo_shape?: GeoShapeQuery
has_child?: HasChildQuery
has_parent?: HasParentQuery
Expand Down Expand Up @@ -171,9 +219,21 @@ export class QueryContainer {
}

export class FieldLookup {
/**
* `id` of the document.
*/
id: Id
/**
* Index from which to retrieve the document.
*/
index?: IndexName
/**
* Name of the field.
*/
path?: Field
/**
* Custom routing value.
*/
routing?: Routing
}

Expand All @@ -182,24 +242,51 @@ export class FieldNameQuery {
}

export class QueryBase {
/**
* Floating point number used to decrease or increase the relevance scores of the query.
* Boost values are relative to the default value of 1.0.
* A boost value between 0 and 1.0 decreases the relevance score.
* A value greater than 1.0 increases the relevance score.
* @server_default 1.0
*/
boost?: float
/** @codegen_name query_name */
_name?: string
}

export class CombinedFieldsQuery extends QueryBase {
/**
* List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`.
*/
fields: Field[]
/**
* Text to search for in the provided `fields`.
* The `combined_fields` query analyzes the provided text before performing a search.
*/
query: string

/** @server_default true */
/**
* If true, match phrase queries are automatically created for multi-term synonyms.
* @server_default true
*/
auto_generate_synonyms_phrase_query?: boolean

/** @server_default or */
/**
* Boolean logic used to interpret text in the query value.
* @server_default or
*/
operator?: CombinedFieldsOperator

/**
* Minimum number of clauses that must match for a document to be returned.
* @doc_id query-dsl-minimum-should-match
*/
minimum_should_match?: MinimumShouldMatch

/** @server_default none */
/**
* Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter.
* @server_default none
*/
zero_terms_query?: CombinedFieldsZeroTerms
}

Expand All @@ -214,7 +301,13 @@ export enum CombinedFieldsOperator {
}

export enum CombinedFieldsZeroTerms {
/**
* No documents are returned if the analyzer removes all tokens.
*/
none,
/**
* Returns all documents, similar to a `match_all` query.
*/
all
}

Expand Down
Loading