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.
问题:
回答1:
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>