弹性搜索与neo4j整合的例子 [英] Examples about Integration of Elasticsearch with neo4j

查看:233
本文介绍了弹性搜索与neo4j整合的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Elasticsearch以及Neo4j。我想使用Neo4j River Plugin for ElasticSearch插件将Elasticsearch与Neo4j集成。有人可以告诉我如何整合这两个。
我还在寻找一些用例示例,我将清楚地了解noe4j如何与弹性搜索结合使用。

解决方案

我们应该有Elasticsearch& Neo4j必须安装。要与Neo4j River Plugin集成,我们需要使用Elasticsearch主目录(Both Elasticsearch& Neo4j必须运行)中的以下命令来安装plugIn:
bin / plugin -install com .sksamuel.elasticsearch / elasticsearch-river-neo4j / 1.2.1.1



然后下载elasticsearch-river-neo4j-1.2.1.1.jar 从点击此处并将其复制到HOME_DIRECTORY_OF_ES / lib文件夹。



然后通过卷曲命令启动Neo4J River服务器:

  curl -XPUT'http:// localhost:9200 / _river / my_neo_river / _meta'-d'{
type:neo4j,
neo4j:{
uri:< NEO4J_URI>,
间隔:<某个间隔(以ms为单位)>
},

index:{
name:< INDEX_NAME>,
type:< TYPE>
}

}



注意:



uri :neo4j服务器的完整URI,例如 http:// localhost:7474 / db / data



间隔轮询neo4j实例之间的时间(以ms为单位)。该值越大,在neo4j中更新之间的时间越长,服务器上的负载越小,弹性中就会反映出来。



index.name :索引节点的索引名称。它应该是小写的。



index.type :用于索引的类型。



使用RestClient(例如:Postman)来查询弹性搜索中的数据以验证集成。查询的URL必须看起来像 http:// localhost:9200 /< index_name> / _search?q =< search_property>:< search_value>


I have installed Elasticsearch as well as Neo4j. I want to integrate Elasticsearch with Neo4j using "Neo4j River Plugin for ElasticSearch" plugIn. Can anybody tell me how to integrate these two. I am also looking for some use case example where i will have clear understanding of how noe4j works with elasticsearch.

解决方案

We should have Elasticsearch & Neo4j has to be installed. To integrate with Neo4j River Plugin, we need to install the plugIn using the following command from the home directory of Elasticsearch (Both Elasticsearch & Neo4j has to run ) : bin/plugin -install com.sksamuel.elasticsearch/elasticsearch-river-neo4j/1.2.1.1

Then download "elasticsearch-river-neo4j-1.2.1.1.jar" from Click here and copy it to "HOME_DIRECTORY_OF_ES/lib" folder.

Then start the Neo4J River server by curling command :

curl -XPUT 'http://localhost:9200/_river/my_neo_river/_meta' -d '{
"type": "neo4j",
"neo4j": {
    "uri": "<NEO4J_URI>",
    "interval": <some interval in ms (only the number)>
},

"index": {
    "name": "<INDEX_NAME>",
    "type": "<TYPE>"
}

}'

Note :

uri : The full URI to the neo4j server, eg http://localhost:7474/db/data

interval : The time (in ms) between polling the neo4j instance. The greater this value, the lower the load on the server but the longer between updates in neo4j being reflected inside elastic.

index.name : The name of the index to index nodes into. It should be in small letter.

index.type : The type to use for indexing.

Use RestClient (e.g : Postman) to query for data in elasticsearch to verify the integration. The url for query has to look like http://localhost:9200/<index_name>/_search?q=<search_property>:<search_value>

这篇关于弹性搜索与neo4j整合的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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