Explore graph analytics
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
-
index
string | array[string] Required Name of the index.
Body
-
connections
object Additional properties are allowed.
-
controls
object Additional properties are allowed.
-
query
object An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.
Additional properties are allowed.
-
vertices
array[object] Specifies one or more fields that contain the terms you want to include in the graph as vertices.
curl \
--request GET http://api.example.com/{index}/_graph/explore \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '"{\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n}"'
{
"query": {
"match": {
"query.raw": "midi"
}
},
"vertices": [
{
"field": "product"
}
],
"connections": {
"vertices": [
{
"field": "query.raw"
}
]
}
}
{
"connections": [
{
"doc_count": 42.0,
"source": 42.0,
"target": 42.0,
"weight": 42.0
}
],
"failures": [
{
"index": "string",
"node": "string",
"reason": {
"type": "string",
"reason": "string",
"stack_trace": "string",
"caused_by": {},
"root_cause": [
{}
],
"suppressed": [
{}
]
},
"shard": 42.0,
"status": "string"
}
],
"timed_out": true,
"took": 42.0,
"vertices": [
{
"depth": 42.0,
"field": "string",
"term": "string",
"weight": 42.0
}
]
}