Skip to content

Commit 02f092b

Browse files
authored
[DOCS] Adds descriptions for the Graph API (#2221)
1 parent fa2f09a commit 02f092b

File tree

6 files changed

+112
-11
lines changed

6 files changed

+112
-11
lines changed

output/schema/schema.json

Lines changed: 35 additions & 11 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ modules-node,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/mo
349349
search-aggregations-bucket-count-ks-test-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-bucket-count-ks-test-aggregation.html
350350
search-aggregations-bucket-correlation-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-bucket-correlation-aggregation.html
351351
search-aggregations-bucket-categorize-text-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-bucket-categorize-text-aggregation.html
352+
search-aggregations-bucket-significantterms-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-bucket-significantterms-aggregation.html
352353
search-aggregations-pipeline-bucket-path,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-pipeline.html#buckets-path-syntax
353354
ml-feature-importance,https://www.elastic.co/guide/en/machine-learning/{branch}/ml-feature-importance.html
354355
analysis-normalizers,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/analysis-normalizers.html

specification/graph/_types/ExploreControls.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,29 @@ import { integer } from '@_types/Numeric'
2222
import { Duration } from '@_types/Time'
2323

2424
export class ExploreControls {
25+
/**
26+
* To avoid the top-matching documents sample being dominated by a single source of results, it is sometimes necessary to request diversity in the sample.
27+
* You can do this by selecting a single-value field and setting a maximum number of documents per value for that field.
28+
*/
2529
sample_diversity?: SampleDiversity
30+
/**
31+
* Each hop considers a sample of the best-matching documents on each shard.
32+
* Using samples improves the speed of execution and keeps exploration focused on meaningfully-connected terms.
33+
* Very small values (less than 50) might not provide sufficient weight-of-evidence to identify significant connections between terms.
34+
* Very large sample sizes can dilute the quality of the results and increase execution times.
35+
* @server_default 100
36+
*/
2637
sample_size?: integer
38+
/**
39+
* The length of time in milliseconds after which exploration will be halted and the results gathered so far are returned.
40+
* This timeout is honored on a best-effort basis.
41+
* Execution might overrun this timeout if, for example, a long pause is encountered while FieldData is loaded for a field.
42+
*/
2743
timeout?: Duration
44+
/**
45+
* Filters associated terms so only those that are significantly associated with your query are included.
46+
* @doc_id search-aggregations-bucket-significantterms-aggregation
47+
*/
2848
use_significance: boolean
2949
}
3050

specification/graph/_types/Hop.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ import { QueryContainer } from '@_types/query_dsl/abstractions'
2121
import { VertexDefinition } from './Vertex'
2222

2323
export class Hop {
24+
/**
25+
* Specifies one or more fields from which you want to extract terms that are associated with the specified vertices.
26+
*/
2427
connections?: Hop
28+
/**
29+
* An optional guiding query that constrains the Graph API as it explores connected terms.
30+
*/
2531
query: QueryContainer
32+
/**
33+
* Contains the fields you are interested in.
34+
*/
2635
vertices: VertexDefinition[]
2736
}

specification/graph/_types/Vertex.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,33 @@ export class Vertex {
2828
}
2929

3030
export class VertexDefinition {
31+
/**
32+
* Prevents the specified terms from being included in the results.
33+
*/
3134
exclude?: string[]
35+
/**
36+
* Identifies a field in the documents of interest.
37+
*/
3238
field: Field
39+
/**
40+
* Identifies the terms of interest that form the starting points from which you want to spider out.
41+
*/
3342
include?: VertexInclude[]
43+
/**
44+
* Specifies how many documents must contain a pair of terms before it is considered to be a useful connection.
45+
* This setting acts as a certainty threshold.
46+
* @server_default 3
47+
*/
3448
min_doc_count?: long
49+
/**
50+
* Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration.
51+
* @server_default 2
52+
*/
3553
shard_min_doc_count?: long
54+
/**
55+
* Specifies the maximum number of vertex terms returned for each field.
56+
* @server_default 5
57+
*/
3658
size?: integer
3759
}
3860

specification/graph/explore/GraphExploreRequest.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,47 @@ import { Hop } from '../_types/Hop'
2626
import { VertexDefinition } from '@graph/_types/Vertex'
2727

2828
/**
29+
* Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index.
30+
* @doc_id graph-explore-api
2931
* @rest_spec_name graph.explore
3032
* @availability stack since=0.0.0 stability=stable
3133
* @availability serverless stability=stable visibility=public
3234
*/
3335
export interface Request extends RequestBase {
3436
path_parts: {
37+
/**
38+
* Name of the index.
39+
*/
3540
index: Indices
3641
}
3742
query_parameters: {
43+
/**
44+
* Custom value used to route operations to a specific shard.
45+
*/
3846
routing?: Routing
47+
/**
48+
* Specifies the period of time to wait for a response from each shard.
49+
* If no response is received before the timeout expires, the request fails and returns an error.
50+
* Defaults to no timeout.
51+
*/
3952
timeout?: Duration
4053
}
4154
body: {
55+
/**
56+
* Specifies or more fields from which you want to extract terms that are associated with the specified vertices.
57+
*/
4258
connections?: Hop
59+
/**
60+
* Direct the Graph API how to build the graph.
61+
*/
4362
controls?: ExploreControls
63+
/**
64+
* A seed query that identifies the documents of interest. Can be any valid Elasticsearch query.
65+
*/
4466
query?: QueryContainer
67+
/**
68+
* Specifies one or more fields that contain the terms you want to include in the graph as vertices.
69+
*/
4570
vertices?: VertexDefinition[]
4671
}
4772
}

0 commit comments

Comments
 (0)