2

I would like to call 2 different procedures and combine the output for further matches in one cypher query. Is it possible?

So, to make it more clear:

  • I have created a manual index which I use in my queries with call apoc.index.search("myindex","searchterm")
  • I also have some own procedure, which I would like to use together with the apoc.index.search from above.

So I would with something like that

call 
apoc.index.search("myindex","searchterm") and my.own.procedure("searchterm") 
yield both resultsets

Are there any ways to do this?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Ira Re
  • 730
  • 3
  • 9
  • 25
  • 2
    Yes, you can make multiple calls to procedures from the same Cypher. And results of all procedures can be "combined" in various ways as well. Your question is currently too unspecific to say much more. Also, the query syntax you used in your question is obviously not legal Cypher. If you update your question to be more specific about my.own.procedure -- including what it returns, and how you want to "combine" the results, then we can be more helpful. – cybersam Aug 04 '17 at 22:03

1 Answers1

1

Thank you @cybersam for your comment. I've found out how to use two procedure calls. In my case it was:

```
CALL my.own.procedure(params) YIELD node as molecule, score as score 
CALL apoc.index.search('search-index',{keyword}) YIELD node as finding 
    MATCH (molecule)<-[:CONTAINS]-(d:Document) 
    MATCH (finding)--(d) 
    RETURN d
``` 
Ira Re
  • 730
  • 3
  • 9
  • 25