将Elasticsearch与neo4j数据库集成 [英] Integration of elasticsearch with neo4j database

查看:589
本文介绍了将Elasticsearch与neo4j数据库集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的neo4j数据库中使用elasticsearch进行快速查询.我尝试了很多站点,但是它们都是老文章,所以我没有一个清晰的主意.到目前为止,我遵循的步骤

Am trying to use elasticsearch with my neo4j database for fast querying.I tried many sites but they are all old articles so i didn't get any clear idea. Steps I followed until now,

  1. 已安装neo4j
  2. 已安装elasticsearch
  3. 将粘贴的弹性搜索插件复制到neo4j插件文件夹中
  4. 将此行添加到neo4j中.属性文件

  1. Installed neo4j
  2. Installed elasticsearch
  3. Copy pasted elastic search plugins into neo4j plugins folder
  4. added this line into neo4j. properties file

elasticsearch.host_name=http://localhost:9200

elasticsearch.index_spec=people:Person(first_name,last_name), places:Place(name)

我的问题是

elasticsearch和neo4j如何集成.请对此澄清一下.

How elasticsearch and neo4j are integrated. Please clarify me on this.

我遵循了

链接

推荐答案

您必须安装Apoc程序插件(通过Apoc程序进行ES集成

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

  • 下载apoc.jar并放到插件的Neo4j目录中,关于目标Neo4j版本

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

重新启动Neo4j

在Neo4j Web浏览器中,启动以下Cypher查询以显示所有ES过程:

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

CALL apoc.help("apoc.es")

示例查询日志:

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

建议的方法是通过添加密钥(在Neo4j重新启动后)将ES主机存储在neo4j.conf中:

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

然后查询如下:

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

这篇关于将Elasticsearch与neo4j数据库集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆