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
-
Name of the index.
Body
-
connections object
Additional properties are allowed.
-
controls object
Additional properties are allowed.
-
query object
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 \
-X POST http://api.example.com/{index}/_graph/explore \
-H "Content-Type: application/json" \
-d '"{\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
}
]
}