elasticsearch与neo4j数据库的集成 [英] Integration of elasticsearch with neo4j database
问题描述
我正在尝试在我的 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,
- 安装neo4j
- 安装elasticsearch
- 将粘贴的弹性搜索插件复制到 neo4j 插件文件夹中
将此行添加到neo4j中.属性文件
- Installed neo4j
- Installed elasticsearch
- Copy pasted elastic search plugins into neo4j plugins folder
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 程序插件 (https://github.com/neo4j-contrib/neo4j-apoc-procedures).关于 ES 集成的文档在这里:ES 与 Apoc 程序的集成
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.conf中添加一个key(Neo4j重启后)存放ES主机:
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屋!