neo4j-contrib / neo4j-elasticsearch

Neo4j ElasticSearch Integration
Apache License 2.0
210 stars 79 forks source link

Indexing does not work #28

Open Nghi93 opened 7 years ago

Nghi93 commented 7 years ago

Hi,

I am using Neo4j 3.0.7 and ElasticSearch 2.3.4 (both via Docker).

This is my neo4j.conf:

elasticsearch.host_name=http://elasticsearch:9200
elasticsearch.index_spec=people:Person(first_name,last_name), places:Place(name)

When creating a node create(n:Place { name: 'test' }) nothing happens in ES. How is the index supposed to be named? Also I don't get any log messages (neither in ES nor in Neo4j).

Could there be an incompatibility with this ES version?

jexp commented 7 years ago

can you check the neo4j logs for any error messages? in debug.log or neo4j.log did you put the jar into the plugins directory? can you remove the space after the comma in the config (I'm not sure if it likes that)

On Tue, Dec 6, 2016 at 5:21 PM, Khang Nghi Lam notifications@github.com wrote:

Hi,

I am using Neo4j 3.0.7 and ElasticSearch 2.3.4 (both via Docker).

This is my neo4j.conf: ´´´ elasticsearch.host_name=http://elasticsearch:9200 elasticsearch.index_spec=people:Person(first_name,last_name), places:Place(name) ´´´

When creating a node create(n:Place { name: 'test' }) nothing happens in ES. How is the index supposed to be named? Also I don't get any log messages (neither in ES nor in Neo4j).

Could there be an incompatibility with this ES version?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/neo4j-contrib/neo4j-elasticsearch/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEHY-sLkiRgLt_goARPEJVwXN-D0VTWks5rFYuggaJpZM4LFmSq .

jexp commented 7 years ago

Also how did you change the neo4j config in the docker container? And how did you put the plugin into the docker container. Did you link the two containers?

Nghi93 commented 7 years ago

Beside debug information in debug.log there were no error messages. Yes, I did put the jar files into the plugins directory:

commons-codec-1.9.jar   
gson-2.6.2.jar         
httpclient-4.5.2.jar    
jest-2.0.2.jar            
slf4j-api-1.7.13.jar
commons-lang3-3.3.2.jar 
guava-19.0.jar
httpcore-4.4.4.jar      
jest-common-2.0.2.jar
commons-logging-1.2.jar 
httpasyncclient-4.1.1.jar  
httpcore-nio-4.4.4.jar  
neo4j-elasticsearch-3.0-SNAPSHOT.jar

For the neo4j config in docker I have a local neo4j.conf file and I add it with ADD neo4j.conf conf/

For the plugins I have: COPY ./plugins/* plugins/

I am not that familiar with Docker, but I can curl neo4j from elasticsearch container and vice versa.

santosh-hegde commented 7 years ago

Compare jar files of plugins folder with jars of lib folder. If there are two same jars with different versions, then keep the higher versioned one. In case of 2 same jars with different versions also this issue will arise.

jexp commented 7 years ago

@Nghi93 did you work it out?

ajaymodi commented 7 years ago

@jexp @santosh-hegde @Nghi93 Can you guys help me? I followed all the steps as mentioned, I am using 3.1 branch and es version 2.4.4. I tried to create index but it does not create any index. image neo4j-es neo4j-es2

santosh-hegde commented 7 years ago

@Ajaymodi I'm not sure about ES 2.xx. Can you upgrade to 5.x and try once. If it didn't works, we can work on it.

balajiforgithub commented 7 years ago

@santosh-hegde: I am having the same issue with Neo4j 3.1.1 and ES 5.2. I have followed all the instructions that were defined. Could you please assist me on this.

chiffa commented 7 years ago

Same problem here: Neo4j 3.1.1 ES 5.2

I get the following error:

WARN  Error updating ElasticSearch  No Server is assigned to client to connect
io.searchbox.client.config.exception.NoServerConfiguredException: No Server is assigned to client to connect
        at io.searchbox.client.AbstractJestClient$ServerPool.getNextServer(AbstractJestClient.java:132)
        at io.searchbox.client.AbstractJestClient.getNextServer(AbstractJestClient.java:81)
        at io.searchbox.client.http.JestHttpClient.prepareRequest(JestHttpClient.java:80)
        at io.searchbox.client.http.JestHttpClient.executeAsync(JestHttpClient.java:60)
        at org.neo4j.elasticsearch.ElasticSearchEventHandler.afterCommit(ElasticSearchEventHandler.java:81)
        at org.neo4j.elasticsearch.ElasticSearchEventHandler.afterCommit(ElasticSearchEventHandler.java:27)
        at org.neo4j.kernel.internal.TransactionEventHandlers.afterCommit(TransactionEventHandlers.java:152)
        at org.neo4j.kernel.internal.TransactionEventHandlers.afterCommit(TransactionEventHandlers.java:50)
        at org.neo4j.kernel.impl.api.TransactionHooks.afterCommit(TransactionHooks.java:75)
        at org.neo4j.kernel.impl.api.KernelTransactionImplementation.afterCommit(KernelTransactionImplementation.java:687)
        at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:628)
        at org.neo4j.kernel.impl.api.KernelTransactionImplementation.closeTransaction(KernelTransactionImplementation.java:484)
        at org.neo4j.kernel.api.KernelTransaction.close(KernelTransaction.java:135)
        at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State.closeTransaction(TransactionStateMachine.java:325)
        at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.streamResult(TransactionStateMachine.java:213)
        at org.neo4j.bolt.v1.runtime.TransactionStateMachine.streamResult(TransactionStateMachine.java:93)
        at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$3.pullAll(BoltStateMachine.java:449)
        at org.neo4j.bolt.v1.runtime.BoltStateMachine.pullAll(BoltStateMachine.java:232)
        at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onPullAll$6(BoltMessageRouter.java:98)
        at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.execute(RunnableBoltWorker.java:136)
        at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.executeBatch(RunnableBoltWorker.java:123)
        at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.run(RunnableBoltWorker.java:94)
        at java.lang.Thread.run(Unknown Source)

It seems the problem is with the plugin not finding the elasticsearch server, but when I look at the config file, I have:

elasticsearch.host_name=http://localhost:9200
elasticsearch.index_spec=people:Person(first_name, middle_name,last_name)

And when I check out the localhost:9200 in my browser I see

{
  "name" : "7OzSFpd",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "WsH-c2LSTnyAEZi9MGhUMA",
  "version" : {
    "number" : "5.2.2",
    "build_hash" : "f9d9b74",
    "build_date" : "2017-02-24T17:26:45.835Z",
    "build_snapshot" : false,
    "lucene_version" : "6.4.1"
  },
  "tagline" : "You Know, for Search"
}

I am kinda out of ideas to what could have gone wrong here...

chiffa commented 7 years ago

Update, the problem is now:

WARN  Problem Updating ElasticSearch
java.net.SocketTimeoutException
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.timeout(HttpAsyncRequestExecutor.java:371)
        at org.apache.http.impl.nio.client.InternalIODispatch.onTimeout(InternalIODispatch.java:92)
        at org.apache.http.impl.nio.client.InternalIODispatch.onTimeout(InternalIODispatch.java:39)
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.timeout(AbstractIODispatch.java:177)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.sessionTimedOut(BaseIOReactor.java:265)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.timeoutCheck(AbstractIOReactor.java:494)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.validate(BaseIOReactor.java:215)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:282)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590)
        at java.lang.Thread.run(Unknown Source)
jexp commented 7 years ago

I released a new version, can you check with that again?

chiffa commented 7 years ago

Let me have a look at it when I have time

18steps commented 6 years ago

Have the same problem. I follow the guide. I'm using Neo4j CE 3.2.3 and ElasticSearch 5.6.0 on Windows 7.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.neo4j.elasticsearch.ElasticSearchEventHandlerIntegrationTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
sep 12, 2017 5:05:22 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
INFO: Elasticsearch Integration: Running http://localhost:9200 - my_index:MyLabel(foo)
sep 12, 2017 5:05:22 PM org.neo4j.elasticsearch.ElasticSearchExtension init
INFO: Connecting to ElasticSearch
sep 12, 2017 5:05:25 PM org.neo4j.elasticsearch.ElasticSearchExtension shutdown
INFO: Disconnected from ElasticSearch
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.818 sec
Running org.neo4j.elasticsearch.ElasticSearchEventHandlerTest
sep 12, 2017 5:05:25 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
SEVERE: ElasticSearch Integration: syntax error in index_spec
sep 12, 2017 5:05:25 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
INFO: Elasticsearch Integration: Running null - null
sep 12, 2017 5:05:26 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
SEVERE: ElasticSearch Integration: syntax error in index_spec
sep 12, 2017 5:05:26 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
INFO: Elasticsearch Integration: Running null - null
sep 12, 2017 5:05:27 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
SEVERE: ElasticSearch Integration: syntax error in index_spec
sep 12, 2017 5:05:27 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
INFO: Elasticsearch Integration: Running null - null
sep 12, 2017 5:05:28 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
SEVERE: ElasticSearch Integration: syntax error in index_spec
sep 12, 2017 5:05:28 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
INFO: Elasticsearch Integration: Running null - null
sep 12, 2017 5:05:29 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
SEVERE: ElasticSearch Integration: syntax error in index_spec
sep 12, 2017 5:05:29 PM org.neo4j.elasticsearch.ElasticSearchExtension <init>
INFO: Elasticsearch Integration: Running null - null
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.121 sec
Running org.neo4j.elasticsearch.ElasticSearchIndexSpecParserTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.neo4j.elasticsearch.JestDefaultHttpConfigFactoryTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 sec

Results :

Tests run: 16, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.660 s
[INFO] Finished at: 2017-09-12T17:05:31+02:00
[INFO] Final Memory: 27M/310M
[INFO] ------------------------------------------------------------------------

As you can see, although it says the build is a success, the tests say "syntax error in index_spec" and " Running null - null"

When I do `curl "http://localhost:9200/_cat/indices?v" it reads

health status index   uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   .kibana 6YOyo_SfT2KLiNi4VjvvQA   1   1          2            0      8.9kb          8.9kb

My %NEO_HOME%\conf\neo4j.conf file is

elasticsearch.host_name=http://localhost:9200
elasticsearch.index_spec=ingrediens:Ingrediens(name), oppskrift:Oppskrift(name, tekst, ingredienser)

And my plugin file and location is %NEO4J_HOME%\plugins\neo4j-elasticsearch-3.2.3.jar

satya06 commented 5 years ago

I am using neo4j version 3.4.5 and es version 5.6.11 I am getting error -- ERROR ElasticSearch Integration: syntax error in index_spec

Active database: graph.db Directories in use: home: /var/lib/neo4j config: /var/lib/neo4j/conf logs: /var/lib/neo4j/logs plugins: /plugins import: /import data: /var/lib/neo4j/data certificates: /var/lib/neo4j/certificates run: /var/lib/neo4j/run Starting Neo4j. 2018-09-04 06:53:54.021+0000 WARN Unknown config option: causal_clustering.discovery_listen_address 2018-09-04 06:53:54.024+0000 WARN Unknown config option: causal_clustering.raft_advertised_address 2018-09-04 06:53:54.024+0000 WARN Unknown config option: causal_clustering.raft_listen_address 2018-09-04 06:53:54.025+0000 WARN Unknown config option: ha.host.coordination 2018-09-04 06:53:54.025+0000 WARN Unknown config option: causal_clustering.transaction_advertised_address 2018-09-04 06:53:54.025+0000 WARN Unknown config option: causal_clustering.discovery_advertised_address 2018-09-04 06:53:54.025+0000 WARN Unknown config option: ha.host.data 2018-09-04 06:53:54.025+0000 WARN Unknown config option: causal_clustering.transaction_listenaddress 2018-09-04 06:53:54.039+0000 INFO ======== Neo4j 3.4.5 ======== 2018-09-04 06:53:54.066+0000 INFO Starting... 2018-09-04 06:53:54.803+0000 ERROR ElasticSearch Integration: syntax error in index_spec_ 2018-09-04 06:53:57.234+0000 INFO Bolt enabled on 0.0.0.0:7687. 2018-09-04 06:54:00.792+0000 INFO Started. 2018-09-04 06:54:01.847+0000 INFO Remote interface available at http://localhost:7474/

jexp commented 5 years ago

Did you use the same version as your neo4j instance has?

What does your spec look like in the config?