Explore api for related documents

graph

(saawan) #1

The schema below relates spanID and parentSpanID across multiple documents. I am using following graph API to return me at least five connections but is does not return anything.

looking for help in setting up the correct query.
Note: I want to get the elementID for every vertex as well.

  {
      "parentSpanID": "0",
      "spanID": "1470760972860",
      "elementID": "578b07c6ee34dc00017f980f",
  },
  {
      "parentSpanID": "1470760972860",
      "spanID": "1470760972870",
      "elementID": "578b07c6ee34dc00017f980g",
  },
  {
      "parentSpanID": "1470760972870",
      "spanID": "1470760972880",
      "elementID": "578b07c6ee34dc00017f980h",
  }
  ... so on

POST btx-tenant1_2016-08-08/Span/_graph/explore
{
"query": {
"term": {
"parentSpanID": 0
}
},
"vertices": [
{
"field": "spanID"
}
],
"connections": {
"vertices": [
{
"field": "parentSpanID"
}
]
}
}

{
"took": 0,
"timed_out": false,
"failures": [],
"vertices": [],
"connections": []
}


(Mark Harwood) #2

The API troubleshooting guide has a section on this with some settings to change. These settings can be found in the user interface when you click on the cog icon.

https://www.elastic.co/guide/en/graph/current/graph-troubleshooting.html#_why_are_results_missing

Cheers
Mark


(system) #3