I need to gather all the children of docid  1 . Root item has parent as null. 
(Sample data below)

Tried as below

nodes(graphtest,
      walk="1->parent",
      gather="docid",
      scatter="branches, leaves")
      
Response :
{
  "result-set": {
    "docs": [
      {
        "node": "1",
        "collection": "graphtest,",
        "field": "node",
        "level": 0
      },
      {
        "EOF": true,
        "RESPONSE_TIME": 5
      }
    ]
  }
}

Query just gets the  root item and not it's children. Looks like I am missing 
something obvious . Any pointers , please.

As I said earlier the below graph query gets all the children of docid 1.

fq={!graph from=parent to=docid}docid:"1" 

Thanks,
Rajeswari



On 10/15/19, 12:04 PM, "Natarajan, Rajeswari" <rajeswari.natara...@sap.com> 
wrote:

    Hi,
    
    
    curl -XPOST -H 'Content-Type: application/json' 
'http://localhost:8983/solr/ggg/update' --data-binary '{
    "add" : { "doc" : { "id" : "a", "docid" : "1", "name" : "Root document one" 
} },
    "add" : { "doc" : { "id" : "b", "docid" : "2", "name" : "Root document two" 
} },
    "add" : { "doc" : {  "id" : "c", "docid" : "3", "name" : "Root document 
three" } },
    "add" : { "doc" : {  "id" : "d", "docid" : "11", "parent" : "1", "name" : 
"First level document 1, child one" } },
    "add" : { "doc" : {  "id" : "e", "docid" : "12", "parent" : "1", "name" : 
"First level document 1, child two" } },
    "add" : { "doc" : {  "id" : "f", "docid" : "13", "parent" : "1", "name" : 
"First level document 1, child three" } },
    "add" : { "doc" : {  "id" : "g", "docid" : "21", "parent" : "2", "name" : 
"First level document 2, child one" } },
    "add" : { "doc" : {  "id" : "h", "docid" : "22", "parent" : "2", "name" : 
"First level document 2, child two" } },
    "add" : { "doc" : {  "id" : "j", "docid" : "121", "parent" : "12", "name" : 
"Second level document 12, child one" } },
    "add" : { "doc" : {  "id" : "k", "docid" : "122", "parent" : "12", "name" : 
"Second level document 12, child two" } },
    "add" : { "doc" : {  "id" : "l", "docid" : "131", "parent" : "13", "name" : 
"Second level document 13, child three" } },
    "commit" : {}
    }'
    
    
    For the above data , the below query gets all the children of document with 
docid 1.
    
    
http://localhost:8983/solr/graphtest/select?q=*:*&fq={!graph%20from=parent%20to=docid}docid:"1<http://localhost:8983/solr/graphtest/select?q=*:*&fq=%7b!graph%20from=parent%20to=docid%7ddocid:%221>"
    
    
    How can I convert this query into streaming graph query with nodes 
expression.
    
    Thanks,
    Rajeswari
    
    

Reply via email to