Explore graph analytics
- POST also GET /{index}/_graph/explore
Extract and summarize information about the documents and terms in an Elasticsearch data stream or index.
The easiest way to understand the behavior of this API is to use the Graph UI to explore connections.
An initial request to the _explore API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph.
Subsequent requests enable you to spider out from one more vertices of interest.
You can exclude vertices that have already been returned.
Path Parameters
-
indexIndexName | IndexNamerequired -
Name of the index.
Request
-
connectionsHop -
Specifies or more fields from which you want to extract terms that are associated with the specified vertices.
-
connectionsHop -
Specifies one or more fields from which you want to extract terms that are associated with the specified vertices.
-
queryQueryContainer -
An optional guiding query that constrains the Graph API as it explores connected terms.
-
verticesVertexDefinitionrequired -
Contains the fields you are interested in.
-
excludestring -
Prevents the specified terms from being included in the results.
-
fieldstring Fieldrequired -
Identifies a field in the documents of interest.
-
includeVertexInclude -
Identifies the terms of interest that form the starting points from which you want to spider out.
-
min_doc_countnumber · default: 3 -
Specifies how many documents must contain a pair of terms before it is considered to be a useful connection. This setting acts as a certainty threshold.
-
shard_min_doc_countnumber · default: 2 -
Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration.
-
sizenumber · default: 5 -
Specifies the maximum number of vertex terms returned for each field.
-
controlsExploreControls -
Direct the Graph API how to build the graph.
-
sample_diversitySampleDiversity -
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. You can do this by selecting a single-value field and setting a maximum number of documents per value for that field.
-
fieldstring Fieldrequired -
max_docs_per_valuenumberrequired -
sample_sizenumber · default: 100 -
Each hop considers a sample of the best-matching documents on each shard. Using samples improves the speed of execution and keeps exploration focused on meaningfully-connected terms. Very small values (less than 50) might not provide sufficient weight-of-evidence to identify significant connections between terms. Very large sample sizes can dilute the quality of the results and increase execution times.
-
timeoutstring Duration -
The length of time in milliseconds after which exploration will be halted and the results gathered so far are returned. This timeout is honored on a best-effort basis. Execution might overrun this timeout if, for example, a long pause is encountered while FieldData is loaded for a field.
-
use_significancebooleanrequired -
Filters associated terms so only those that are significantly associated with your query are included.
-
queryQueryContainer -
A seed query that identifies the documents of interest. Can be any valid Elasticsearch query.
-
verticesVertexDefinition -
Specifies one or more fields that contain the terms you want to include in the graph as vertices.
-
excludestring -
Prevents the specified terms from being included in the results.
-
fieldstring Fieldrequired -
Identifies a field in the documents of interest.
-
includeVertexInclude -
Identifies the terms of interest that form the starting points from which you want to spider out.
-
min_doc_countnumber · default: 3 -
Specifies how many documents must contain a pair of terms before it is considered to be a useful connection. This setting acts as a certainty threshold.
-
shard_min_doc_countnumber · default: 2 -
Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration.
-
sizenumber · default: 5 -
Specifies the maximum number of vertex terms returned for each field.
Response
-
connectionsConnectionrequired -
failuresShardFailurerequired -
indexstring IndexName -
nodestring -
reasonErrorCauserequired -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
shardnumber -
statusstring -
primaryboolean -
timed_outbooleanrequired -
tooknumberrequired