0

I currently have a request:

 CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9') 
 YIELD rel, start, end

Does anybody know how I can search for several context values, for example, something like:

 CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9,context:a0328202-d98a-492e-92ae-1010cb829a8ee') 
 YIELD rel, start, end

Is it possible at all with apoc.index.relationships?

UPDATE

A possible way to do that would be to use UNION CALL so something like

 CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9') 
 YIELD rel, start, end
 UNION CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9,context:a0328202-d98a-492e-92ae-1010cb829a8ee') 
 YIELD rel, start, end

Which produces good results. But I'm wondering if there's a more elegant way to do this that would also make the request shorter?

Thanks!

Aerodynamika
  • 7,883
  • 16
  • 78
  • 137

1 Answers1

1

You can use lucene syntax:

context:15229100-b20e-11e3-80d3-6150cb20a1b9 OR context:15229100-b20e-11e3-80d3-6150cb20a1b9

or even with an array:

context:(15229100-b20e-11e3-80d3-6150cb20a1b9 15229100-b20e-11e3-80d3-6150cb20a1b9)

https://lucene.apache.org/core/2_9_4/queryparsersyntax.html

Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
  • This is great! Makes the request much shorter, although the load speed is about the same. But definitely gives me more flexibility. Thanks! – Aerodynamika Jan 14 '19 at 11:32