Integration of elasticsearch with neo4j database

馋奶兔 提交于 2019-12-02 05:36:14

You have to install Apoc procedures plugin (https://github.com/neo4j-contrib/neo4j-apoc-procedures). The documentation about ES integration is here : ES Integration with Apoc procedures

[edit]

  • download and drop apoc.jar in plugins's Neo4j directory, regarding the targetted Neo4j version

  • restart Neo4j

  • in Neo4j Web browser, launch the following Cypher query to show all ES procedures:

    CALL apoc.help("apoc.es")

Sample query for logs:

CALL apoc.es.getRaw("localhost","_search?q=level:ERROR",null) 
YIELD value 
UNWIND value.hits.hits as hits
RETURN hits LIMIT 100

The recommanded way is to store the ES host in neo4j.conf by adding a key (after restart of Neo4j):

apoc.es.myKey.url=localhost

Then the query looks like:

CALL apoc.es.getRaw("myKey","_search?q=level:ERROR",null) 
YIELD value 
UNWIND value.hits.hits as hits
RETURN hits LIMIT 100
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!