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.
Query parameters
-
timeoutstring -
Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.
- Reference
Request body
-
connectionsobject -
Specifies or more fields from which you want to extract terms that are associated with the specified vertices.
-
connectionsobject -
Specifies one or more fields from which you want to extract terms that are associated with the specified vertices.
-
queryQuery -
An optional guiding query that constrains the Graph API as it explores connected terms.
-
verticesobjectrequired -
Contains the fields you are interested in.
-
controlsobject -
Direct the Graph API how to build the graph.
-
sample_diversityobject -
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.
-
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 -
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.
-
queryQuery -
A seed query that identifies the documents of interest. Can be any valid Elasticsearch query.
-
verticesobject -
Specifies one or more fields that contain the terms you want to include in the graph as vertices.